Exp6 122 DSD
Exp6 122 DSD
6
Roll No. : 117
Aim : Study of Full adder using case statement.
Objective : Designing Full adder using case statement.
Program : module fa(sum,carry,a,b,cin);
Full output reg sum,carry; Truth Table :
Adder input wire a,b,cin;
always @(a,b,cin) Input Output
begin A B Cin Sum Carry
case({a,b,cin}) 0 0 0 0 0
3'b000:begin sum=0;carry=0;end 0 0 1 1 0
3'b001:begin sum=1;carry=0;end 0 1 0 1 0
0 1 1 0 1
3'b010:begin sum=1;carry=0;end
1 0 0 1 0
3'b011:begin sum=0;carry=1;end 1 0 1 0 1
3'b100:begin sum=1;carry=0;end 1 1 0 0 1
3'b101:begin sum=0;carry=1;end 1 1 1 1 1
3'b110:begin sum=0;carry=1;end
3'b111:begin sum=1;carry=1;end
endcase
end
endmodule
Full Adder
RTL View : Decoder0
a
b IN[2..0] OUT[7..0] WideOr1
cin
carry
DECODER
WideOr0
sum