I have following code ::
`timescale 1ns / 1ps
module top ;
real T ;
initial begin
T = ( 55 / 100 ) ;
$display(" T is %0f ",T);
T = 55.55 ;
$display(" T is %0f ",T);
T = 0.005 * 55.55 ;
$display(" T is %0f ",T);
T = 1fs ; // Time Literal would be scaled to time unit ( LRM Section 5.8 )
$display(" T is %0f ",T);
end
endmodule
The O/P I observe is ::
T is 0.000000
T is 55.550000
T is 0.277750
T is 0.000001
I have a few questions
[Q1] Does the time_unit and time_precision come into picture for the code ?
[Q2] Since time_precision is 1ps , real numbers are rounded up to 3 decimal places .
How is it that for the 3rd display I observe :: 0.277750 i.e up to 6 decimal places
[Q3] For 1st O/P why is it that I observe 0.000000 .
Even if I add real type cast i.e **real'( 55 / 100 )** I still observe 0.000000
[Q4] For 2nd and 3rd assignment , T has values 55.550000 and 0.277750 respectively . Can I say these are 55.55ns and 0.27775ns ?
What if I change the timescale to :: `timescale 10 ns / 1 ps