Representing Numbers in the Floating-Point Format

  1. Analysis for $-18$: (1) it is negative, so the sign bit will be $1$. (2) We know that $18_{10} = 10010_2$, but since the significand represents a fraction form (i.e., $0.1xxxx\dots$,) we need to shift the digits of $10010_2$ several times to the right while increasing the exponent by $1$ each time we shift: $10010 \times 2^0 = 1001.0 \times 2^1 = 100.10 \times 2^2 = 10.010 \times 2^3 = 1.0010 \times 2^4 = 0.10010 \times 2^5$. As such, the significand will be $10010$. (3) Finally, for the exponent, we stopped at $2^5$, whose exponent is $5$. When we add the bias of $15$, we get $5 + 15 = 20$, which makes our exponent equal to $10100$. The number $-18$, therefore, in its floating-point form is:
    +---+   +---+---+---+---+---+   +---+---+---+---+---+
    | 1 |   | 1 | 0 | 1 | 0 | 0 |   | 1 | 0 | 0 | 1 | 0 | = -18_{10}
    +---+   +---+---+---+---+---+   +---+---+---+---+---+