Page 57 - Computer Science V2.0 Class 11
P. 57

Note that the number (0.298828125)  is slightly less than (0.3) . Recall that the binary representation of (0.3)  being
                                                  10
                                                                        10
                                                                                                                  10
                 non-terminating, we had to ignore the bits beyond a certain number of bits (nine bits in the above example). So, when
                 we convert the truncated binary number to decimal, we do not get back the number (0.3) .
                                                                                                 10
                 Example 22: (1100101.01) to decimal
                                        2
                   Face Value       1     1     0    0     1    0     1     .    0     1
                   Place Value      2 6   2 5   2 4  2 3   2 2  2 1   2 0        2 –1  2 –2
                                 5
                                                      2
                                                             1
                                        4
                                               3
                         6
                                                                            –1
                                                                    0
                    = 1 × 2  + 1 × 2  + 0 × 2  + 0 × 2  + 1 × 2  + 0 × 2  + 1 x 2  + 0 × 2  + 1 × 2 –2
                    = 64 + 32 + 0 + 0 + 4 + 0 + 1 +   0   +   1
                                              2    4
                    = (101.25) 10
                 Conversion of Fractional Numbers from Decimal to Octal
                 To convert fractional numbers in the decimal number system to octal, follow the following steps:
                 1.  Multiply the fractional part by 8.
                 2.  Note the integer part.
                 3.  Multiply only the fractional part by 8.
                 4.   In the case of terminating fractions, repeat steps 2 and 3 till the fractional part becomes zero. In the case of
                    non-terminating fractions, repeat steps 2 and 3 until the desired number of bits after the radix point has been
                    obtained. Examples 23 and 24 illustrate the conversion of terminating and non-terminating fractions.
                 5.  The integer part from top to bottom forms the octal number.
                 Example 23: Convert (0.125)  to its equivalent octal number.
                                          10
                                          Fraction part   Integer part
                   0.125 ×  8  =     1.0      0.0             1
                   0.0 ×  8      =     0.0    0.0             0
                   (0.125)  = (0.1) 8
                          10
                 Example 24: Convert (0.740234375)  to its equivalent octal number.
                                                 10
                                                      Fraction part    Integer part
                   0.740234375 ×  8   =   5.921875      0.921875           5
                   0.921875  ×  8         =  7.375       0.375             7
                   0.375   ×  8              =   3.0      0.0              3
                   (0.740234375)  = (0.573) 8
                                10
                 Example 25: Convert (0.1) to its equivalent octal number.
                                        10
                                                Fraction part     Integer part
                   0.1 ×  8  =     0.8              0.8               0
                   0.8 ×  8  =     6.4              0.4               6
                   0.4 ×  8  =     3.2              0.2               3
                   0.2 ×  8  =     1.6              0.6               1
                   0.6 ×  8  =     4.8              0.8               4
                   0.8 ×  8  =     6.4              0.4               6
                   0.4 ×  8  =     3.2              0.2               3
                   0.2 ×  8  =     1.6              0.6               1
                   0.6 ×  8  =     4.8              0.8               4






                                                                                 Number Systems and Encoding Schemes  43
   52   53   54   55   56   57   58   59   60   61   62