raghavkmr
Junior Member level 2
- Joined
- Nov 26, 2013
- Messages
- 23
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 194
Code:
module real2bits();
real n;
reg [63:1]b;
initial begin
n = 15.0 ;
$display("n---->%f",n);
$display("b---->%b",b);
#1
b = $realtobits(n);
$display("b---->%b",b);
#10
$finish;
end
endmodule
output is --->
n---->15.000000
b---->xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
b---->100000000101110000000000000000000000000000000000000000000000000
which is wrong for n=15 ,b should be 1111
why this is happening