How to calculate floating point animation in Verilog? So far, I usually used shift <1024, then the floating point number becomes an integer. Then I do some operations, then → 1024 to get the drop again.
For example, 0.3545 = 2 ^ -2 + 2 ^ -4 + ...
I have a question about something else like this. I do not know where the minus (-) is:
0.46194 = 2 ^ -1 - 2 ^ -5 - 2 ^ -7 + 2 ^ -10.
I just watch it from someone. but like you, it looks like
0.46194 = 2 ^ -2 + 2 ^ -3 + 2 ^ -4 + 2 ^ -6 + 2 ^ -7 + 2 ^ -10 + .....
I don’t understand how he knows that minus is used?
How do we know when he needs a minus? Also how can I apply to verilog RTL?
UPDATE: I understand the concept of using minus in work. But is there any other way of equation or methodology to reduce the expression multiplying force 2?
UPDATE: how can we use this method in verilog? for example, I leaned in at 0.46194 = 2 ^ -1 - 2 ^ -5 - 2 ^ -7 + 2 ^ -10. then this code was also written in verilog. 0.011101101 = 'hED =' d237. So the question is, how can we apply it to an application in verilog?
UPDATE: Sir, please check this? there is a small difference result.
0.46194 = 0.011101101. I just tried this
0.011101101
0.100T10T01
= 2 ^ -1 - 2 ^ -4 + 2 ^ -5 - 2 ^ -7 + 2 ^ -9. = 0.462890625
Something other. What am I wrong?
source
share