In this, We will discuss about how we represent fractional numbers in binary number system.
The binary point plays the same role as that of decimal point in decimal number system i.e. it separates the integer binary bits and fractional bits.
The procedure is similar to the procedure we followed to represent decimal fraction.
Each step involved in representation of the binary fraction is illustrated below.
Example 1: (110.011)2 is the binary equivalent of 6.375 in decimal number system.
Step 1:
Write down the sequence of binary weights depending on the number of bits in the given example separated by the binary point as shown below
22 21 20 2 -1 2 -2 2 -3 ← Weights
. |
MSB LSB
Step 2: Assign the values to the weights starting from LSB till the binary point and again starting from the binary point assign integer values towards far left up to the MSB as done below.
22 21 20 2 -1 2 -2 2 -3 ← Weights
1 | 1 | 0 | . | 0 | 1 | 1 |
MSB LSB
Step 3: Compute the product of individual bits and its associated binary weights to get the products which looks like the following
0 x 2 -1 ← LSB
1 x 2 -2
1 x 2 -3
.
0 x 2 0
1 x 2 1
1 x 2 2 ← MSB
Step 4: Add the individual products separated by the binary point as illustrated below
1 x 2 2 + 1 x 2 1 + 0 x 2 0 . 0 x 2 -1 + 1 x 2 -2 + 1 x 2 -3
= 1 x 2 2 + 1 x 2 1 + 0 x 2 0 . 0 x 2 -1 + 1 x 2 -2 + 1 x 2 -3
↑ ↑
MSB LSB
MSB LSB
= 1 x 4 + 1 x 2 + 0 x 1 . 0 x ( 1 / 2 ) + 1 x ( 1 / 4 ) + 1 x ( 1 / 8 )
= 4 + 2 + 0 . 0 + 0 . 25 + 0 . 125
= ( 6 . 375 )10