In reply to dave_59:
Use an int cast.
module top;
real A;
initial begin
A = 3.4;
A = int'(A);
$display(A);
A = 3.5;
A = int'(A);
$display(A);
A = 3.6;
A = int'(A);
$display(A);
end
endmodule
Hi Dave,
module top;
initial begin
int C;
C = $rtoi(44 *(16/44));
$display("The result = 'd%0d and 'b%0b",C,C);
end
endmodule
In the above example, the output C is zero. How to get non-zero value? Can you please help me out with this regard.
Thank you,
Regards,
Muneeb Ulla Shariff