Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] How to declare two bit input in UCF of verilog

Status
Not open for further replies.
Moonightingale

You declare outputs one through eight in your code, but you never assign them values. Instead you assign "result" the values of one thru eight depending on your case statement. I'm not sure this code would even synthesize correctly. It looks very badly wrong.

I'll bet the synthesis tool is just removing those outputs altogheter, since they are useless. So by the time the PAR tool tries to apply the UCF to your design, the outputs are long gone.

You really need to take another look at that code, and you always need to look at the synthesis logs to see what the tool did to your code.

r.b.
 
Last edited:

Sir kindly kindly write code for me
I am desparate to operate this question now
I have also changed my code

module alu2bit(aluout,result,a,b,select,zero,one,two,three,four,five,six,seven,eight,nine);
output [3:0] aluout; // the result
output [3:0]result;
input [1:0] a,b; // input a and b
input [1:0] select;
reg [3:0] aluout,result;
output zero,one,two,three,four,five,six,seven,eight,nine;
always@(a or b)
begin
case (select)
2'b00:aluout=a+b; // For addition of two bits
2'b01:aluout=a-b; // For addition of two bits
2'b10:aluout=a*b; // For multiplication of two bits
endcase
if (aluout==4'd0) zero<=1'b0; // no LED will glow
else if (aluout==4'd1) one<=1'b1;
else if (aluout==4'd2) two<=1'b1;
else if (aluout==4'd3) three<=1'b1;
else if (aluout==4'd4) four<=1'b1;
else if (aluout==4'd5) five<=1'b1;
else if (aluout==4'd6) six<=1'b1;
else if (aluout==4'd7) seven<=1'b1;
else if (aluout==4'd8) eight<=1'b1;
else result=zero;
end
endmodule

it is also not working
 

when you assign 1 to a led you should set all the others to 0, now you only light one led and you let all the others in the state they were.
Maybe use one 8 bit output (instead of one,two,three..) and do
10000000
01000000
00100000
where each bit is one led.

Alex
 

Is this a homework assignment or something? :p If it is not, but just something you chose to try and learn verilog, might I suggest trying something simpler. When it works, you can always add stuff.

Regardless, why do you maintain on having for example "aluout" as a module output, when 1) you don't declare it in the ucf, and 2) you don't seem to be needing it as an output anyways since you only use it internally. Dont panic. Think logically. What are the inputs you really need as inputs. What are the outputs you really need to go out of the module. Only those should show in the

Code:
module alu2bit( fixit );

declaration.

as far as I got your explanation you only need "a", "b", "sel" as inputs (all these as 2-bit inputs), and "one" ... "eight" as the outputs (all as 1-bit outputs to the leds). So maybe fix that first.
 

Sorry, no thanks.

I'm busy at work right now writing RTL and I have several projects of my own at home.

Besides, you'll never learn anything if you don't do it yourself.

Did you look at the synthesis logs?

r.b.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top