Page 82 - Engineering Digital Design
P. 82

2.9 BINARY ARITHMETIC                                                53


                    Direct subtraction of two binary numbers also parallels that for base 10 subtraction.
                  Now however, when the subtrahend bit is 1 when the minuend bit is 0, a borrow is required
                  from the next MSB. Thus, the borrowing process begins at the MSB and ends with the
                  LSB — the opposite of the carry process for addition. Remember that a borrow of \2 from
                  the next MSB, creates a 10 2 in the column being subtracted. The following 8-bit example
                  illustrates the subtraction process in base 2:
                  EXAMPLE 2.22

                                               10  i
                                             0 0 f0 10 0 10  f-  Borrows
                                  101,o    0 I Z 0 0 1 0 1 2 = Minuend
                                 -58| 0 -00 1 1 1 0 1 0 2 = Subtrahend
                                   43 m    001010 1 1 = Difference

                  Here, the notation 0 or I represents denial of the 0 or 1 when a borrow is indicated. Notice,
                  as in the example just given, that the borrowing process may involve more than one level
                  of borrowing as the process proceeds from right to left.

                  2.9.2 Two's Complement Subtraction

                  Computer calculations rarely involve direct subtraction of binary numbers. Much more
                  commonly, the subtraction process is accomplished by 2's complement arithmetic — a con-
                  siderable savings in hardware. Here, subtraction involves converting the subtrahend to 2's
                  complement by using Eq. (2.14) in the form $2 + 1 and then adding the result directly to
                  the minuend. For an n-bit operand subtraction, n + 1 bits are used where the MSB bit is
                  designated the sign bit. Also, the carry overflow is discarded in 2's complement arithmetic.
                  The following example illustrates the process for two four-bit numbers, A and B:
                 EXAMPLE 2.23
                                 A     o;noi              o;iioi =+is 10
                                -B   -0:0111             +i:i001 = -7 10
                                                    r-Q] 0:0110 = +6, 0
                                                 Discard   L ~ Sign bit positive
                                                 overflow
                    Further illustration continues by interchanging the minuend and subtrahend so as to yield
                  a negative number:
                 EXAMPLE 2.24
                                 A     OiOlll             OiOlll = +7 10
                                -B   -OillOl
                                                                      ]0
                                                 Discard  ~—Sign Bit negative
                                                overflow
   77   78   79   80   81   82   83   84   85   86   87