What should be the o/p in the following case? I have run it on different compilers, got different results in each.
module top;
reg a,b;
function int f(string s);
$display("%s", s);
return 1;
endfunction
initial begin
$display(" Experiment 1 ");
if ( f("hello") & (1==0)) begin
$display(" 1 : if 1 is true");
end
$display(" Experiment 2 ");
if ( (1==0) & f("hello")) begin
$display(" 2 : if 2 is true");
end
$display(" Experiment 3 ");
if ( f("hello") && (1==0)) begin
$display(" 3 : if 3 is true");
end
$display(" Experiment 4 ");
if ( (1==0) && f("hello")) begin
$display(" 4 : if 4 is true");
end
end
endmodule