Page 145 - FUNDAMENTALS OF COMPUTER
P. 145

NPP













                  NPP               Number System, Boolean Algebra and Logic Circuits              145


                  Use of Hexadecimal number                   hoŠgmS>o{g_b g§»`mAm| Ho$ Cn`moJ
                      Hexadecimal number system  is used  in      hoŠgmS>o{g_b Agoå~br ^mfm _| àmoJ«mq_J H$aVo g_`
                  assembly language programming.  The         H$m_ _| AmVo h¢ Ÿ& Bg ^mfm _| h_ {ZX}em| d S>mQ>m H$mo
                  instructions and data are entered as Hexadecimal
                  numbers because instruction  code and data are  hoŠgmS>o{g_b _| {bIH$a àXmZ H$aVo h¢ Š`m|{H$ ~mBZar _|
                  very lengthy in binary form. Each Hexadecimal  {bIZo na  b§~mB© ~hþV  Á`mXm hmo  OmVr h¡& àË`oH$
                  digit is converted into 4-bit numbers.      hoŠgmS>o{g_c A§H$ 4 {~Q> _| ~Xc OmVm h¡Ÿ&
                   3.5 Conversion from Decimal to any Base    3.5 Xe_bd go {H$gr ^r AmYma _| ~XbZm
                      Suppose a decimal number is given and       AJa AmnH$mo H$moB© Xe_bd g§»`m Xr JB© hmo Am¡a
                  you are asked to find its equivalent in a number  {H$gr Xygao AmYma r dmbr g§»`m nÕ{V _| ~XbZo H$mo
                  system whose base is  r. (r =  2  for Binary,  r
                  = 8 for  octal,  r =  16 for Hexadecimal).  The  H$hm J`m hmo (r = 2 (~mBZar) , r = 8 (Am°ŠQ>b), r = 16
                  process of conversion is different for integer  (hoŠgmS>o{g_b) ) V~ nyUmªH$ d AnyUmªH$ XmoZm| {hñgm| Ho$
                  part and fractional part. The table shown below  {bE AbJ-AbJ {d{Y`m| H$m Cn`moJ hmoVm h¡ Ÿ& BZ {d{Y`m|
                  gives details  of the  procedure:           H$mo AmJo Xem©B Vm{cH$m 3.4 _| {X`m J`m h¡ Ÿ&
                                  Table 3.4                                   Vm{cH$m 3.4

                      Decimal to Any Base (r) Conversion               Xe_cd AmYma r _|  ~XcZm
                                 Integer part                                   nyUmªH$
                     *  Divide by the Base r.                   *   r go ^mJ Xmo
                     *  Write the quotient below and remainder  * ^mJ\$b H$mo ZrMo {bImo d eof\$b H$mo grYo hmW
                        at the right hand side.
                                                                    H$s Va\$ {bIm| Ÿ&
                     *  Repeat  the same  procedure until the   * Bgr {H«$`m H$mo XmohamAmo O~ VH$ {H$ ^mJ\$b
                        quotient becomes zero.                      eyÝ` Z Am OmE Ÿ&

                     *  Read the remainders from bottom to top.  * eof\$bm| H$mo ZrMo go D$na n‹T>mo Ÿ&
                     *  This is the result.
                                                                * `ht n[aUm_r g§»`m h¡ Ÿ&

                                Fractional Part                                AnyUmªH$
                    *   Multiply by r.                          *   r  go JwUm H$amo Ÿ&
                    *   Write the fractional part of the product  * JwUZ\$b Ho$  Am§{eH$ {hñgo H$mo ZrMo VWm nyUmªH$
                        below and the integer at right hand side.
                                                                    dmbo {hñgo H$mo grYo hmW H$s Va\$ {bImoŸ&
                    *   Repeat the  same procedure until   the  * Bgr {H«$`m H$mo XmohamAmo O~ VH$ {H$ Am§{eH$ {hñgm
                        product becomes zero. (or stop after few
                        places of point).                           eyÝ` Z hmo Ÿ& (`m Hw$N> A§H$m| Ho$ ~mX éH$ OmAmo)&
                    *   Read the integer parts from top  to     * nyUmªH$ dmbo {hñgo H$mo D$na go ZrMo n‹T>moŸ&
                        bottom and place a leading point.
                    *   This is the  result.                    * `hr n[aUm_r g§»`m h¡ Ÿ&
   140   141   142   143   144   145   146   147   148   149   150