Saturday, December 31, 2022

 11 i/p (1bit wide) ADDER:-

module add11 (cout3,cout2,cout1,s,a,b,c,d,e,f,g,h,i,j,k);
input a,b,c,d,e,f,g,h,i,j,k;
output cout3,cout2,cout1,s;
add10 ad1 (c3,c2,c1,s1,a,b,c,d,e,f,g,h,i,j);
ha h1 (c4,s,s1,k);
ha h2 (c5,cout1,c4,c1);
ha h3 (c6,cout2,c5,c2);
ha h4 (c7,cout3,c6,c3);
endmodule


 TEST BENCH:-

module adtb ();
reg a,b,c,d,e,f,g,h,i,j,k;
wire cout3,cout2,cout1,s;
add11 dut (cout3,cout2,cout1,s,a,b,c,d,e,f,g,h,i,j,k);
integer z;
initial
begin
for (z=0;z<=2047;z=z+1)
begin
{a,b,c,d,e,f,g,h,i,j,k}= z;
#1;
$display(a,b,c,d,e,f,g,h,i,j,k,":",cout3,cout2,cout1,s);
end
end
endmodule

No comments:

Post a Comment

VERILOG CODES :-

 VERILOG CODES :- (by NUTAN.K) COMBINATIONAL :-  1.MUX:- (one bit wide)  1a) 2:1 MUX and its Testbench   1b) 4:1 MUX using 2:1 and its testb...