I want to convert $\frac{2}{7}$ to a binary number in a $32$ bit computer. That is, $1$ bit is assigned to the sign of the number, $8$ bits are assigned to the exponent, and $23$ bits are assigned to the mantissa.
So $x = \pm q \times 2^{m}$ where $\frac{1}{2} \leq q < 1$ (if $x \neq 0$) and $m = e - 127$ is an integer. Suppose the leading binary digit $1$ is shifted just to the left of the binary point. In this case, the representation would be $q = (1.f)_{2}$ and $1 \leq q < 2$. So in effect, the machine has a $24$-bit mantissa.
The binary representation of $\frac{2}{7}$ is $\left ( 0.010 \overline{010} \right )_{2}$. In normalized notation, this is $ \left ( 0.10\overline{010} \right )_{2} \times 2^{-1}$.
I want to write out fully what this number would like in the $32$ bit computer. So, I should write out $24$ bits for the mantissa.
$$x = \left ( 0.\underbrace{10010010010010010010010}_{23 \text{ bits}}\underbrace{\_}_{24\text{'th bit}} \right )_{2} \times 2^{-1}$$
For the $24th$ bit, do I put a $0$? There is not enough room for the entire $3$-period of $\overline{010}$ so what do I do?
1
in the most significant place (except for value 0) and in IEEE representations that bit is not stored. $\endgroup$ – Weather Vane Sep 5 '17 at 16:55