A
Alireza
Guest
Hello ,
I tried to use the following loop to build allpossible cases for my 4
bit adder.but when simulation it goes to infinte loop.what is the
problem?
module test;
wire c,cout,s,out;
reg a,b,sw,carry;
reg[3:0] a1,a2;
wire[3:0] sum;
wire[3:0] result;
hAdd h(c,s,a,b);
fullAdder_4 adder(cout,sum,a1,a2);
always begin
$monitor($time," a:%d b:%d cout,sum:%d ",a1,a2,{cout,sum});
a1=0;
a2=0;
for(a1=0 ; a1 <= 15; a1 = a1 + 1)
begin
#100 for(a2=0 ; a2 <= 15; a2 = a1 + 1)
#100;
end
#100 $finish;
end
endmodule
I tried to use the following loop to build allpossible cases for my 4
bit adder.but when simulation it goes to infinte loop.what is the
problem?
module test;
wire c,cout,s,out;
reg a,b,sw,carry;
reg[3:0] a1,a2;
wire[3:0] sum;
wire[3:0] result;
hAdd h(c,s,a,b);
fullAdder_4 adder(cout,sum,a1,a2);
always begin
$monitor($time," a:%d b:%d cout,sum:%d ",a1,a2,{cout,sum});
a1=0;
a2=0;
for(a1=0 ; a1 <= 15; a1 = a1 + 1)
begin
#100 for(a2=0 ; a2 <= 15; a2 = a1 + 1)
#100;
end
#100 $finish;
end
endmodule