The program gave output a=1 and b=4 and a 5 ,b 0 without “display” statement in always block , when I include I get the values present in always block. Can anyone explain the reason for this shift in output?
module rr;
int a;
int b;
initial
begin
a=1;
b=4;
end
always@(*)
begin
a=3;
// $display("%d",a);
b=7;
end
initial
begin
#2;
a=5;
b=0;
end
initial
begin
$monitor("%d and %d",a,b);
end
endmodule