module tb;
int x;
function int sum(
input int a,b);
return a+b;
endfunction
initial begin
x=5 + sum(2,3);
$display("value of x is %od",x);
end
endmodule
value of x is 00000000012d
module tb;
int x;
function int sum(
input int a,b);
return a+b;
endfunction
initial begin
x=5 + sum(2,3);
$display("value of x is %od",x);
end
endmodule
value of x is 00000000012d
In reply to jpkumar:
The output looks correct to me. What were you expecting for an output?
Your output format is %od (letter o, not number 0), which is octal format. 12 in octal is 10 decimal, which is correct.
thankyou cgales
i can’t seen that one.