Page 287 - FUNDAMENTALS OF COMPUTER
P. 287

NPP













                  NPP               Number System, Boolean Algebra and Logic Circuits              287

                  Solution:

                      (a) (+25) – (+25)  represent both numbers   (a) XmoZm|  H$mo 8-{~Q>m|  Ho$ gmBÝS>  _op½ZQ²>`yS> _|
                  in 8-bit sign-magnitude form :              {bIZo na
                                                  (00011001)  – (00011001)
                      Take  2's complement of  subtrahend.        KQ>H$ H$m 2's H$m°påßb_|Q> bmoŸ& (-) Ho$ ñWmZ na
                  Replace (–) with (+) and add. Neglect any end  (+) {bImo VWm Omo‹S>moŸ& A§{V_ hm{gb H$mo N>mo‹S>mo…
                  carry.
                                                            0 0 0 1 1 0 0 1
                                                              + 1 1 1 0 0 1 1 1
                                                            0 0 0 0 0 0 0 0
                                              end        1
                                              carry
                      Therefore, result is 00000000  and its      AV… n[aUm_ 00000000 h¡ {OgH$m Xe_bd 0
                  decimal number is 0. Thus,                  hmoVm h¡… AV…
                                                       (+ 25) – (+ 25) = 0
                      (b) (+43)  –  (–20), Signed-Magnitude       (b) (+43) – (–20), ( + 43) H$m gmBÝS> _op½ZQ²>`yS
                  representation of (+43) is :                Vwë` Bg àH$ma h¡…
                                                      0 0 1 0 1 0 1 1
                      Signed - 2's  Complement representation     (-20) H$m gmBÝS> 2's H$m°påßb_|Q> Vwë` Bg àH$ma
                  (–20) is (Which is obtained by 2’s complement  h¡… (Omo {H$ +20 Ho$ Vwë¶ H$m 2’s H$m°påßb‘|Q> boZo na
                  of + 20)
                                                              àmßV hmoJm)
                                                      1 1 1 0 1 1 0 0
                      Take 2's complement of subtrahend (–20)     (- 20) H$m 2's H$m°påßb_|Q> hmoJm…
                  which will be
                                                      0 0 0 1 0 1 0 0
                      Replace (–) with (+) and add:               (-) Ho$ ñWmZ na (+) {bIH$a Omo‹S>mo…
                                                   0 01 01 01 1
                                               +   000 1 0 1 00

                                                   00 111111

                      MSB is  0 which shows  that the  result is  My±{H$ MSB eyÝ` h¡ AV… n[aUm_ YZmË_H$ h¡, Omo
                  positive and it is +63. Therefore:          + 63 hmoVm h¡ Ÿ& AV…
                                                   (+43)  – (–20) = (+63)

                       Problem 3.82                                àíZ 3.82
                      Perform 2's complement addition:            2's H$m°påßb_|Q> go Omo‹S>mo…
                                                 (a) (+32) + (–14)  (b) (–47) + (–31)
   282   283   284   285   286   287   288   289   290   291   292