Page 161 - FUNDAMENTALS OF COMPUTER
P. 161

NPP













                  NPP               Number System, Boolean Algebra and Logic Circuits              161


                  Binary to Hexadecimal Conversion            ~mBZar go hoŠgmS>o{g_b _| n[adV©Z
                      Given a Binary Number and it is needed to   AmnH$mo `{X  ~mBZar g§»`m  Xr hmo Am¡a Bgo
                  find the hexadecimal equivalent. This problem  hoŠgmS>o{g_b _| n[ad{V©V H$aZm h¡ Vmo Bg g_ñ`m H$mo Xmo
                  can be solved in two ways :
                                                              àH$ma go hb {H$`m Om gH$Vm h¡ …
                      Method  I : First convert the binary number  {d{Y I  : nhbo Xr JB© ~mBZar g§»`m H$mo Xe_bd _|
                  into decimal and then convert the  obtained  VWm Bg Xe_bd H$mo hoŠgmS>o{g_b _| ~XbmoŸ& _mZm {H$
                  decimal into hexadecimal. Suppose the given binary  Xr JB© ~mBZar g§»`m h¡ …
                  number is
                                                         (10101) 2

                                                1
                                         2
                                                    0
                          4
                                  3
                      1 × 2  + 0 × 2  + 1 × 2  + 0 × 2  + 2  × 1
                      16 + 0 + 4 + 0 + 1 = (21) 10
                      Now  convert this decimal  into             Bg Xe_bd H$mo A~ hoŠgmS>o{g_b _| ~XbVo h¢ …
                  hexadecimal:
                                                         16  21  5
                                                         16  1   1
                                                             0
                      Thus,                            (21)  = (15) 16
                                                          10
                      and therefore                  (10101)  = (15) 16
                                                            2
                      Method  II : (Direct Method) In  this       {d{Y II  : Bg {d{Y _| _| h_ Mma-Mma {~Q>m| Ho$
                  method, make groups of four bits. In  integer  g_yh ~ZmVo h¢ Ÿ& nyUmªH$ _| XmE± go VWm AnyUmªH$ _| ~mE± go
                  part of the number  start  from right  and in  àma§^ H$aVo h¢ Am¡a `{X eyÝ` H$s Amdí`H$Vm hmoVmo Cgo
                  fractional part of the binary number start from
                  left and put zeros if necessary. Consider the  A§V _| bJm XoVo h¢ Ÿ& àË`oH$ g_yh Ho$ ñWmZ na CgH$m Mma
                  following examples:                         {~Q> _| hoŠgmS>o{g_b A§H$ {bI XoVo h¢ Ÿ& ZrMo {bI|
                                                              CXmhaUm| go `h ñnï> h¡ …
                       Problem 3.19                                àíZ 3.19
                      Convert following Binary numbers  into      ZrMo {bIo ~mBZar H$mo hoŠgmS>o{g_b _| ~Xbmo …
                  Hexadecimal:
                              (a)  11101101   (b) 10101.110101    (c)  01011.110     (d) 0.10101101
                  Solution :                                  hc :
                      In each case make group of four bits and    Mma-Mma {~Q>m| Ho$ g_yh ~ZmH$a hoŠgmS>o{g_b Vwë`
                  put extra zeros if necessary:
                                                              {bImo Ÿ& (`{X Amdí`H$ hmo Vmo eyÝ` bJmAmo) …

                      (a)   1110 1101 =  (ED ) 16                  (b)   0001 0101. 1101 0100 =  (15.D4 ) 16
                      (c)   0000 1011. 1100 = (OB.C ) 16           (d)   0. 1010 1101 =  (0.AD ) 16
                      (Note  : Memorise table 2.3)                (ZmoQ>: Vm{cH$m 2.3 H$mo AÀN>r Vah `mX H$a b|Ÿ&)
   156   157   158   159   160   161   162   163   164   165   166