Page 318 - FUNDAMENTALS OF COMPUTER
P. 318

318                         Fundamentals of Computers                          NPP


                    3.47 Binary Adder/Subtractor                3.47 ~mBZar ES>a/g~Q´>oŠQ>a
                        Adder/Subtractor is a combinational logic   ES>a/g~Q´>oŠQ>a n[anW Omo‹S>Zo VWm KQ>mZo XmoZm| Ho$
                    circuit which can add as well as subtract two  H$m`© _| AmVm h¡, Bg{bE Bgo ES>a/g~Q´>oŠQ>a H$hVo h¢Ÿ&
                    binary numbers. For  subtraction it, uses  2's  KQ>mZo hoVw 2's H$m°påßb_|Q {d{Y H$m Cn`moJ H$aVo h¢Ÿ& KQ>mZo
                    complement method.  The subtraction  is     Ho$ ~OmE {H$gr g§»`m H$m 2's H$m°påßb_|Q Omo‹S> {X`m OmVm
                    equivalent  to addition of 2's complement.
                    Consider the following circuit:             h¡Ÿ& {ZåZ n[anW H$mo XoImo…

                                        A 3               A 2               A 1              A 0


                               B 3              B 2               B 1               B 0
                                                                                                  SUB









                                                  F.A.
                                         C 3
                        C 4     F.A.   NPP                 C 2      F.A.     C 1     F.A.      C 0
                                S 3               S 2               S 1               S 0


                       X 4      X 3               X 2               X 1               X 0
                        When SUB = 0 first Full Adder will add A 0  O~ SUB = 0 hmoVm h¡ V~ àW_ \w$b ES>a A  VWm
                                                                                                    0
                    and B , the second Full Adder will add A , B 1  B  Omo‹S>Vm h¡ Ÿ& Bgr Vah ~mH$s \w$b ES>a _| hm{gb d
                         0
                                                         1
                                                                 0
                    and  the carry C 1  of first Full Adder. It works as  {~Q>m| H$mo Omo‹S>Vo h¢ Ÿ& AV… `h ES>a H$m H$m`© H$aVm h¡&
                    a binary adder. When SUB = 1, the second binary  bo{H$Z O~  SUB = 1 hmoVm h¡, Vmo gmao \w$b ES>am| Ho$
                    number B B B B  is inverted. And the outputs  AmCQ>nwQ> H$mo Bg àH$ma go {bIm Om gH$Vm h¡ …
                            3 2 1 0
                    of Full Adders would give
                                                      A 3   A 2  A 1   A 0
                                                  +   B 3   B 2   B 1  B 0

                                                                  +     1

                        This is addition of 2's Complement of       AV… h_  B B B B   Ho$  2's H$m°påßb_|Q   H$mo
                                                                             3 2 1 0
                    B B B B   to A A A A . It is  equivalent to  A A A A   _|  Omo‹S> aho h¢&  AWm©V²  B B B B   H$mo
                                      1
                                        0
                     3 2 1 0
                                    2
                                 3
                                                                      1
                                                                        0
                                                                   2
                                                                                               3 2 1 0
                                                                 3
                    subtracting  first number from second. When  A A A A   _| go  KQ>m aho  h¢Ÿ&  AV…  SUB  = 1  go
                    SUB = 1 this circuit works as a subtractor and  3  2  1  0
                    when SUB = 0 it works as an adder.          g~Q´>oŠQ>a H$m VWm SUB = 0 go ES>a H$m n[anW àmá hmo
                                                                ahm h¡…
   313   314   315   316   317   318   319   320   321   322   323