Page 268 - FUNDAMENTALS OF COMPUTER
P. 268

NPP













                   268                         Fundamentals of Computers                           NPP


                      That means,  add 7  three times or  add  3  AWm©V² 7 H$mo 3 ~ma Omo‹S>mo `m 3 H$mo 7 ~ma Omo‹S>moŸ&
                  seven times you will get the result. In fact, the  XmoZm| pñW{V`m| _| `moJ g_mZ AmEJmŸ& dmñVd _| H$åß`yQ>a
                  basic logic circuit in the computer is an adder.  _| Omo n[anW hmoVm h¡ dh Ho$db Omo‹S>Zo dmbm (ES>a) hmoVm
                  Therefore each operation is converted into ad-  h¡Ÿ& Bgr{bE gmar {H«$`mAm| H$mo Omo‹S> H$s {H«$`m _| n[ad{V©V
                  dition.                                     H$aHo$ g§§nÝZ H$adm`m OmVm h¡Ÿ&
                  Shift and Add  Method (Long-Hand            {eâQ> H$amo d Omo‹S>mo {d{Y (bm±J-h|S> {d{Y)
                  Method)

                      Looking to the previous problems and so-    CnamoŠV g_ñ`m H$mo XoIH$a EH$ AëJmo[aW_ ~Zm`m
                  lutions, an algorithm can be designed. This is  Om gH$Vm h¡ Ÿ& Bgo {eâQ> H$amo Am¡a Omo‹S>mo {d{Y H$hVo
                  called shift and add method. The algorithm is  h¢Ÿ& AëJmo[aX_ Bg àH$ma h¡…

                  as follows:
                  1.  Read multiplicand and multiplier.       1. _ëQ>rpßbH|§$S> ({Og_| JwUm H$aZm h¡) VWm _ëQ>rßbm`a
                                                                  ({OgH$m JwUm H$aZm h¡) H$mo n‹‹T>moŸ&

                  2.  Count the number of bits in the multiplier.  2. _ëQ>rßbm`a _| {~Q>m| H$s g§»`m {JZmo Ÿ& _mZm {H$ `h
                      Let it be n.                                n h¡&
                  3.  Examine the LSB of multiplier. If it is 1, call  3. _ëQ>rßbm`a H$s LSB H$mo XoImo Ÿ& `{X `h 1 h¡ Vmo
                      the multiplicand as the first partial product  _ëQ>rpßbH|$S> H$mo àW_ Am§{eH$ JwUZ\$b H$hmo d
                      and go to step 5. If it is zero go to step 4.  ñQ>on (5) na OmAmo AÝ`Wm (4) na OmAmo Ÿ&

                  4.  Call zero as the first partial product.  4. eyÝ` H$mo Am§{eH$ JwUZ\$b H$hmoŸ&
                  5.  Examine next LSB of the multiplier. If it is  5. A~ _ëQ>rßbm`a H$s AJbr LSB H$mo XoImo AJa `h
                      ‘1’, shift the partial product by one bit to the  1 hmo Vmo Am§{eH$ JwUZ\$b H$mo grYo hmW H$s Va\$
                      right and add the multiplicand. Call  the   EH$ {~Q> {eâQ> H$amo VWm _ëQ>rpßbH|$S> H$mo Omo‹S>mo Ÿ&
                      sum as the new partial product. If LSB is   Bg `moJ H$mo Z`m Am§{eH$ JwUZ\$b H$hmo Ÿ& AÝ`Wm
                      zero, shift right to get new partial product.  {g\©$ {eâQ> H$amoŸ&
                  6.  n = n – 1, if n = 0 the result is equal to the  6.  n = n-1, `{X  n = 0 h¡ Vmo Am§{eH$ JwUZ\$b hr
                      partial product else go to step 5.          n[aUm_ hmoJmŸ& AÝ`Wm (5) na OmAmoŸ&

                  7.  Write partial product as the final product.  7. Am§{eH$ JwUZ\$b H$mo hr A§{V_ JwUZ\$b {bImoŸ&
                      The “Shift and Add method” of multipli-     Xmo ~mB©Zar Zå~a Ho$ _pëQ>pßbHo$eZ H$s “{eâQ> EÊS>
                  cation  of two binary numbers  can be  easily  EoS> _oWS>” Bg MmQ>© Ho$ Ûmam AmgmZr go g_Pr Om gH$Vr
                  understood with the following Flow chart :  h¡:
   263   264   265   266   267   268   269   270   271   272   273