In an earlier post, we have seen that how to convert any number system to decimal number system. However, that article presents the conversions only for the whole numbers. In this article, we will consider the fractional number system conversion. The following technique is used to convert any binary fractional number to its equivalent decimal number. The technique is same for the other number systems as well.
Technique
- Multiply each bit by 2n, where ‘n’ is the “weight” of the bit. Remember, the weights are positive for the bits before the binary point, and negative for the bits after the binary point.
- Add all the results to get the final decimal number
Examples
10.10112 = ?10
10.10112 = 1×21 + 0x20 + 1×2-1 + 0x2-2 + 1×2-3 + 1×2-4 = 2 + 0 + 0.5 + 0 + 0.125 + 0.0625 = 2.687510
Here, you can observe that there are two bits before the binary point. So, weights are ‘0’ and ‘1’. There are four bits after the binary point. So, weights are -1 to -4.