Page 91 - Bebop to The Boolean Boogie An Unconventional Guide to Electronics Fundamentals, Components, and Processes
P. 91
72 ChupterEight
Standard subtraction
001 11001
-0001 11 10 57,, - 30,, = 27,,
=00011011
I 1 1 1 1 1 1 1 1 00111001 I
I
!-00011110 +I 1100001 ,
I 10001 10 10 I
End-
~=11100001 '1 around-
1 - I
I
1
carry
, Take one5 Complement 0001 101 1 I
I
I
Figure 8-5. Ones complement binary subtraction
subtraction, because the ones complement of a binary number can be simply
generated by inverting all of its bits; that is, by exchanging all the Os with 1s
and vice versa.
Now consider the same binary subtraction performed using the twos
complement technique (Figure 8-6).
As before, the advantage of the twos complement is that it is not necessary
to perform an end-around-carry; any carry-out resulting from the addition of
the two most significant bits is simply dropped from the final result. The disad-
vantage is that, during the process of creating the twos complement, it is
necessary to perform a borrow operation for almost every digit in the subtra-
hend. This problem can be solved by first taking the ones complement of the
subtrahend, adding one to the result, and then performing the remaining
operations as for the twos complement.