Range and Accuracy

When you are given a number and asked to store it in a certain floating-point format, but the number doesn't fit into the format, you'll, unfortunately, lose some data when you store it. You can, however, store the most accurate (close) number possible, which will reduce the loss of data.

Example: In the $1$-bit sign, $3$-bit exponent (with a bias of $3$), and $3$-bit significand format, we want to represent $11_{10} = 1011_2$, which we write as $1011 \times 2^0 = 101.1 \times 2^1 = 10.11 \times 2^2 = 1.011 \times 2^3 = 0.1011 \times 2^4$. Unfortunately, since we can use only $3$ bits for the significand, we realize that the $4$ bits of $1011_2$ won't fit into the significand, so we will lose data.

To minimize the data loss, we should store the most significant bits of the number. In our case, these will be the $3$ leftmost bits of $1011$, which are $101$. With a bias of $3$, the exponent will be $4 + 3 = 7_{10} = 111$. We, hence, get:

+---+   +---+---+---+   +---+---+---+
| 0 |   | 1 | 1 | 1 |   | 1 | 0 | 1 | --> What number did we actually store here?
+---+   +---+---+---+   +---+---+---+