Page 90 - Bebop to The Boolean Boogie An Unconventional Guide to Electronics Fundamentals, Components, and Processes
P. 90

Binary Arithmetic  w  71

                Now consider the same subtraction performed using the tens complement
             technique (Figure 8-4).


             5tandard subtraction      Tens complement equivalent
                                     r_______--------_
                                                                                   1
                  6   4   7          I     1000                        647         I
                                                                                   I
               -283                  1 -      283               +      717  I
                                     I
               =364                  I=       717               =  1364                 Drop
                                     I    -                            364 I  2%
                                     I      Take tens               -  1
                                     I     complement             Add tens comple-  I
                                     I                             ment to minuend  I
                                     L ________________ J
                           Figure 8-4. Tens complement decimal subtraction



                The advantage of the tens complement is that it is not necessary to
             perform an end-around-carry; any carry-out resulting from the addition of  the
             most significant digits is simply dropped from the final result. The disadvantage
             is that, during the process of creating the tens complement, it is necessary to
             perform a borrow operation for every digit in the subtrahend. This problem
             could be solved by first taking the nines complement of the subtrahend,
             adding one to the result, and then performing the remaining operations as
             for the tens complement.
                Similar techniques may be employed with binary (base-2) numbers, where
             the radix complement is known as the twos complement and the diminished
             radix complement is known as the ones complement. First, consider a binary
             subtraction performed using the ones complement technique (Figure 8-5).

                Once again, the standard way of performing the operation would be to
             subtract the subtrahend (0001 11 10,) from the minuend (001 11001,),
             which may require the use of one or more borrow operations. To perform the
             equivalent operation in ones complement, each of the digits of the subtrahend
             is first subtracted from a 1. The resulting ones complement value is added to
             the minuend, and then an end-around-carry operation is performed. The
             advantage of the ones complement technique is that it is never necessary to
             perform a borrow operation. In fact, it isn’t even necessary to perform a
   85   86   87   88   89   90   91   92   93   94   95