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.

full subtractor using case statement...plzz tell me error

Status
Not open for further replies.

rids1

Newbie level 4
Joined
Dec 4, 2013
Messages
6
Helped
1
Reputation
2
Reaction score
0
Trophy points
1
Activity points
33
module full_sub(a,a1,c,d,b,e);
input a,a1,c;
output reg d,b,e;

always@(a1 or a or c)
begin
e={a,b,c};

case(e)
000:
begin
d=0;
b=0;
end

001:
begin
d=1;
b=1;
end

010:
begin
d=1;
b=1;
end

011:
begin
d=0;
b=0;
end


100:
begin
d=1;
b=0;
end

101:
begin
d=0;
b=0;
end

110:
begin
d=0;
b=0;
end

111:
begin
d=1;
b=1;
end
endcase
end

endmodule
 

plz tell me hw i can correct it........
 

is it e={a,b,c}; or
e={a,a1,c};


also 'e' is declared as one bit, but e={a,b,c} is three bit
so the tool will truncate the three bit into one bit.

so case expression never matches..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top