Renjie
Newbie level 5
Hi guys,
I'm trying to test a 5*5 multiplier; and the two inputs are required to cover all possibilities. So I use two for looping like this:
module tb_mult5x5();
reg [4:0] InA=0, InB=0;
wire [9:0] Product;
integer clk,fp;
mult5x5 mult(InA,InB, Product);
initial begin
for(InA=0;InA<=5'b11111;InA=InA+1)begin
for(InB=0;InB<=5'b11111;InB=InB+1)begin
#1; end
end
#5;
$stop;
end
After simulation, I notice the InA was stuck at 0 and InB goes from 0 to 11111 again and again, obviously the processing can't jump out from the second for looping.
Can anyone figure out what's going wrong here?
Thanks!
I'm trying to test a 5*5 multiplier; and the two inputs are required to cover all possibilities. So I use two for looping like this:
module tb_mult5x5();
reg [4:0] InA=0, InB=0;
wire [9:0] Product;
integer clk,fp;
mult5x5 mult(InA,InB, Product);
initial begin
for(InA=0;InA<=5'b11111;InA=InA+1)begin
for(InB=0;InB<=5'b11111;InB=InB+1)begin
#1; end
end
#5;
$stop;
end
After simulation, I notice the InA was stuck at 0 and InB goes from 0 to 11111 again and again, obviously the processing can't jump out from the second for looping.
Can anyone figure out what's going wrong here?
Thanks!