|
|
1 `timescale 1ns/100ps
2 module real_literals ();
3
4 real a;
5 shortreal b;
6
7 initial begin
8 $monitor ("@ %gns a = %e b = %e ", $time, a, b);
9 a = '0;
10 b = 1.0e2;
11 #1 a = 2e5;
12 // Type casting
13 #1 b = shortreal'(a);
14 #1 a = 2.1E-2;
15 // Type casting
16 #1 b = shortreal'(a);
17 #1 $finish;
18 end
19
20 endmodule
You could download file real_literals.sv here
|