Page 153 - FUNDAMENTALS OF COMPUTER
P. 153

NPP













                  NPP               Number System, Boolean Algebra and Logic Circuits              153


                   3.6 Conversion from any base to             3.6 {H$gr ^r AmYma go Xe_bd _| n[adV©Z
                   Decimal
                      There is a generalised way to convert any   EH$ hr ì`mnH$ {d{Y Ho$ Ûmam {H$gr ^r AmYma dmbr
                  number into decimal. Consider the following  g§»`m H$mo Xe_bd _| ~Xbm Om gH$Vm h¡. O¡gm {H$ ZrMo
                  number whose base is r :
                                                              {bIo Z§~a H$mo Ü`mZ go XoImo, {OgH$m ~og r h¡ …
                                                        ( xyz. pqr) r
                      The integer part of the number is xyz and   BgH$m nyUmªH$ ^mJ xyz h¡ VWm Am§{eH$ ^mJ pqr
                  fractional part is pqr. The decimal equivalent  h¡Ÿ& BgH$m Xe_bd Vwë` Bg àH$ma go àmá {H$`m Om
                  can be obtained as below :
                                                              gH$Vm h¡…
                                                   x  y   z     p   q    r
                                                   ×  ×   ×     .    ×  ×  ×
                                                  r 2  r 1  r 0  r −  1  r −  2  r −  3
                      The decimal number will be:                 AV… Xe_bd g§»`m hmoJr

                                         x ×  r +  2  y ×  r +  1  z ×  r +  0  p ×  r +  −  1  q r×  −  2  +  r r×  −  3
                      The procedure described can be applied to   CnamoŠV ì`mnH$ {d{Y H$mo h_ {ZåZ _| go {H$gr ^r
                  any of the following conversions:           EH$ H$ÝdO©Z Ho$ {bE Cn`moJ _| bm gH$Vo h¢:

                      Binary to Decimal (r = 2), Octal to Decimal  ~mBZar go Xe_bd (r = 2), Am°ŠQ>b go Xe_bd
                  (r = 8),  Hexadecimal to Decimal (r = 16).
                                                              (r = 8),  hoŠgmS>o{g_b go Xe_bd (r = 16),
                      Or  for any arbitrary value of r.           `m r H$m H$moB© ^r ñd¡pÀN>H$ _mZ hmo Ÿ&
                      Now Consider one by one.                    A~ BÝh| h_ EH$-EH$ H$aHo$ CXmhaUm| H$s ghm`Vm

                                                              go g_PVo h¢ Ÿ&
                  Binary to Decimal Conversion                ~mBZar go Xe_bd _| H$ÝdO©Z
                      The base  of Binary number system is 2.     My±{H$ ~mBZar g§»`m nÕ{V H$m AmYma 2 h¡, AV…
                  Therefore all the calculations are done with the  gmar JUZm r = 2 boH$a H$s OmVr h¡ Ÿ&
                  base 2.
                       Problem 3.12                                àíZ 3.12
                      Convert following binary numbers  into      {ZåZ{b{IV ~mBZar g§»`mAm| H$mo CZHo$ Xe_bd
                  their  decimal equivalents.                 Vwë` _| ~X{bE …

                                      (a) 1101       (b) 101.11      (c) 101011
                  Solution :                                  hc :

                      (a) The given Binary Number is 1101. Write  (a) Xr JB© ~mBZar g§»`m 1101 h¡ Ÿ& BgH$s Mmam|
                  the bits giving some space and their positional  {~Q>m| H$mo Wmo‹S>r Xya-Xya {bI bmo Ÿ& CZHo$ R>rH$ ZrMo CZH$m
                  weights below. Multiply the bits with positional  ^ma {bI Xmo Ÿ& A~ ^ma H$m JwUm g§~§{YV {~Q> go H$amo VWm
                  weights and add.
                                                              Eogo gmao JwUZ\$bm| H$mo Omo‹S>mo …
   148   149   150   151   152   153   154   155   156   157   158