Page 60 - Computer Science Class 11 With Functions
P. 60

Find octal representation of (9.7) , (5A.AF) , and (C4.98) .
                                           16      16          16


        Conversion of Octal Numbers to Hexadecimal
        To convert an octal number to a hexadecimal number, first convert it to a binary number and then convert the binary
        number to hexadecimal number.
        Example 48: Convert (75.36) to a hexadecimal number
                                  8
        (75.36) 8
                  7         5   .    3        6
                  ↓        ↓         ↓        ↓
                 111      101       011      110
        Binary equivalent of (75.36)  is (111101.011110) 2
                                 8
                two 0s added                   two 0s added

                  0 0 1 1 1 1 0 1  .  0 1 1 1 1 0 0 0

                    3       D     .     7       8

        Hexadecimal equivalent of (111101.011110)  is (3D.78) 16
                                                2


                 1. Write binary and octal equivalents for the following hexadecimal digits:
                   F, A, 5, C
                 2. Find hexadecimal representation of (10.5) , (32.6)  and (40.3) .
                                                    8      8        8

        Do the following conversions:
        a.  (10011.01)  to decimal
                      2
        b.  (C25.D2)  to decimal
                    16
        c.  (157.25)  to decimal
                   8
        d.  (0.341)  to hexadecimal
                  10
        Ans:
        a.  (10011.01)  to decimal number.
                      2
            Face Value         1      0     0     1    1  .    0      1
                                                        0
            Place value        2 4   2 3    2 2   2 1  2  .   2 –1   2 –2
                         3
                                       1
                                2
                  4
                                              0
                                                     –1
            = 1 × 2  + 0 × 2  + 0 × 2 + 1 × 2 + 1 × 2 + 0 × 2 + 1 × 2 –2
            = 16 + 0 + 0 + 2 + 1 + 0 +  1
                                  4
            = 19 + 0.25
            = 19.25
            = (10011.01)  = (19.25) 10
                       2
        b.  (C25.D2)  to decimal number.
                    16
            Face Value         C      2     5  .   D     2
                                                   –1
                                       1
                                 2
            Place value       16     16   16   .  16   16 –2
                                            0
            = C × 16  + 2 × 16  + 5 × 16 + D × 16 + 2 × 16 –2
                                            –1
                                    0
                           1
                   2
                                     13    2
            = 12 × 256 + 2 × 16 + 5 × 1 +    +
                                     16   256
          58   Touchpad Computer Science-XI
   55   56   57   58   59   60   61   62   63   64   65