Page 158 - FUNDAMENTALS OF COMPUTER
P. 158

158                         Fundamentals of Computers                           NPP


                  must be a decimal number. If a conversion is to  _| go EH$ H$m ^r AmYma 10 Zht h¡ Ÿ& Eogr n[apñW{V _|
                  be done from one number  system to another  A^r VH$ H$s {d{Y`m| H$m Cn`moJ Zht {H$`m Om gH$Vm h¡ Ÿ&
                  none of the above  methods  can be used.  For  O¡go Am°ŠQ>b go ~mBZar  _| H$ÝdO©ZŸ& Bg Vah H$s g_ñ`m
                  example a conversion from Binary to octal. One
                  way of performing these types of conversion is  H$mo hb H$aZo H$m EH$ VarH$m hmo gH$Vm h¡ {H$ nhbo Am°ŠQ>b
                  to first convert the given number into decimal,  H$mo Xe_bd _| ~Xbmo Ÿ& Bg Xe_bd g§»`m hoVw A~ ~mBZar
                  and from this  number find the  number in the  {ZH$mb bmo Ÿ& bo{H$Z Bg {d{Y _| h_| Xmo Vah H$s JUZmE± H$aZm
                  desired base. That  means for a given problem  n‹S> ahr h¢Ÿ& AV… h_ Am°ŠQ>b, ~mBZar VWm hoŠgmS>o{g_b Ho$
                  we will have to perform two conversion. But in  {bE Hw$N> g§{já {d{Y`m| H$m Cn`moJ ^r H$a|Jo& BZH$m| h_
                  case of Binary, octal and Hexadecimal, we have  EH$-EH$ H$aHo$ g_PVo h¢&
                  a direct method also. We will learn one by  one.

                  Binary to Octal Conversion                  ~mBZar go Am°ŠQ>b _| n[adV©Z
                      Method I : First convert the given binary   {d{Y I : nhbo ~mBZar H$mo Xe_bd _| ~Xb| Am¡a Bg
                  number into  decimal  and then convert the  Xe_bd H$mo Am°ŠQ>b _| ~Xb| …
                  obtained decimal number into octal.

                       Problem 3.16   NPP                          àíZ 3.16
                      Convert Binary 11010 into octal Number.     ~mBZar g§»`m 11010 H$mo Am°ŠQ>b _| ~XbmoŸ&
                  Solution :                                  hc :
                      The given binary  number  is 11010. The     11010 H$m Xe_bd _mZ Bg àH$ma h¡ …
                  decimal value of this number is :
                                                   4
                                               1 × 2  + 1 × 2  + 0 × 2  + 1 × 2  + 0 ×  2 0
                                                                         1
                                                                  2
                                                          3
                                               16 + 8 + 0 + 2 + 0  = 26
                      Now,  Convert (26)  into octal. The         A~ (26)  H$mo Am°ŠQ>b _| Bg àH$ma ~Xbmo …
                                         10
                                                                         10
                  procedure is  shown below :
                                                      8 26 2
                                                      8   3  3
                                                          0

                      Thus,                            (26)  = (32) 8
                                                          10
                      Therefore,        (11010)  = (26)  = (32)    or,   (11010)  = (32) 8
                                                            8
                                                     10
                                                                          2
                                               2
                  Method  II : (Direct Method)                {d{Y II : (àË`j {d{Y)
                      In this method, starting from L SB (Right   Bg {d{Y _| grYo hmW H$s Amoa go ewê$ hmoH$a ~mBZar
                  Hand Side) make groups of three bits. At the  g§»`m _| VrZ-VrZ {~Q>m| Ho$ g_yh ~ZmVo h¢ Ÿ& `{X A§V _|
                  end insert leading zeros if the bits are less than
                  three. The problem 2.17 can also be solved as :  VrZ go H$_ {~Q> ~MVr h¡ Vmo h_ eyÝ` bJm XoVo h¢ Ÿ& O¡go
                                                              CnamoŠV g_ñ`m H$mo Eogo ^r hb H$a gH$Vo h¢ …
                                                         011
                                                                  010
                                                      ← ←
   153   154   155   156   157   158   159   160   161   162   163