cloud9Z9
Newbie level 5
Code:
module fori(A,B);
input [0:5] A;
output [0:5] B;
wire [0:5]A;
reg [0:5]B;
reg i=0;
initial begin
for(i=0;i<6;i=i+1)begin
B[i]=A[i];
end
//B[4]=1'b1;
end
initial begin
$monitor("OR=%b, AND=%b, IN=%b, time=%t\n",B,A,$time);
end
endmodule
module tb_fori();
reg [0:5]A;
wire [0:5]B1;
fori fori1(.A(A),.B(B1));
initial
begin
A[0:5] <=6'b000001;
#10;
A[0:5] <= 6'b100001;
#10;
A[0:5] <= 6'b00011;
#10;
$finish;
end
initial begin
$monitor("OR=%b, AND=%b, IN=%b, time=%t\n",B1,A,$time);
end
endmodule
can we assign the B[4] after the for loop? like i did ....and pls tell me wats wrong with my code it compiles but doesnt give any output when i ./a.out it