If we have three binary bits, then we can represent eight numbers, starting from 0 to 7. So, in other words, 0 to 7 is the range of numbers that we can represent using three binary bits. However, this range is defined for unsigned magnitude numbers. In this article, we will get to know the range of numbers that we can represent for a fixed number of binary bits, and for the different signed number representations that we have already learned.
For ‘n’ binary bits, the following are the range of numbers that can be represented:
Unsigned Magnitude | Sign-Magnitude | 1’s Complement | 2’s Complement |
0 to 2n – 1 | -(2n-1 – 1) to +(2n-1 – 1) | -(2n-1 – 1) to +(2n-1 – 1) | -(2n-1) to +(2n-1 – 1) |
For Sign-magnitude and 1’s complement form, ‘0’ has two representations, one for ‘+ve 0’ and another for ‘-ve 0’. However, for 2’s complement form, ‘0’ has only one representation. That is why, you can notice that 2’s complement form can represent one additional negative number. This is also a primary reason that 2’s complement form is preferred in digital computers, as there is no ambiguity in representing ‘0’.
The following table shows the range of numbers that can be represented for 8 binary bits (that means n = 8):
Unsigned Magnitude | Sign-Magnitude | 1’s Complement | 2’s Complement |
0 to 255 | -127 to +127 | -127 to +127 | -128 to +127 |
It is always important to know the range of numbers that can be represented by a certain number of binary bits. This will also help us to figure out whether there is any overflow or not after an arithmetic operation, if the size of the register storing the result is known. Check here to find some overflow examples.