How much binary fixed point xxx representation do you have?

I am trying to measure how accurate it is when converting fixed points to binary representation. At first I tried using this 0.9375. And I got the binary file 0.1111. second i tried to use this 0.9377 and i also got the 0.1111 binary

There is nothing else between them.

Also how can I solve this problem? Is there any other way? Do the conversion?

For your understanding, I let me know another example, For example, if I want to convert 3.575 to binary, then 3.575 - 11.1001. but if I go back to decimal again, then 3.5625. This is so different from the original value.

+1
source share
1 answer

:

2: 4 , 4-

-2^3  2^2  2^1  2^0  .  2^-1    2^-2    2^-3    2^-4
  -8    4    2    1  .   0.5    0.25   0.125  0.0625

4- 0,0625

3.575 could be 11.1001 = 2+ 1+ 0.5 + 0.0625 => 3.5625 to low
      or       11.1010 = 2+ 1+ 0.5 + 0.125  => 3.625  to high

, 4 , "3.575".

, 2, : "3.575" (50 ).

3.575 * 2^2   = 14.3 (not integer)
3.575 * 2^20  = 3748659.2
3.575 * 2^30  = 3838627020.8
3.575 * 2^40  = 3930754069299.2 (not integer)
3.575 * 2^50  = 4025092166962381.0 (INTEGER) we need 50 bits!

3.575 => 11.10010011001100110011001100110011001100110011001101

(<<) , , , - .

, .

+2

All Articles