Conversion: dec to bin

73 Views Asked by At

We have: $$\begin{align} A&=\frac{19}{32} \\[0.3em] B&=\frac{21}{32}\\[0.3em] C&=\frac{19}{64}\\[0.3em] D&=\frac{21}{64}.\\[0.3em] \end{align}$$ In binary it is: $$\begin{align} A&=0,10011\strut \\ B&=0,10101\strut\\ C&=0,010011\strut\\ D&=0,010101\strut\\ \end{align}$$ Is it correct? Does it mean that the denominator says how many positions I have after comma?

1

There are 1 best solutions below

1
On BEST ANSWER

The values given are indeed correct. 64 is 1,000000

        1/64                        1/32
19 * 0.000 001 = 0. 010 011       0. 10011
21 * 0.000 001 = 0. 010 101       0. 10101

Dividing by 1000000 in binary is the same as in decimal: shift the comma six places to the left (with zero-filling as needed). So to make 1 000 00 into one, you shift the comma five places to the right, and to divide 10101 by the same amount, shift the comma five to the left, ie 0,10101.

If you need further places, zero-fill to the left. Divide 10011 by 1000000, you need an extra place before the comma, so eg 000000 10011, becomes 00000,0 10011, and delete unnecassary zeros -> 0,010011.