Subtraction with Complements
Subtraction with Complements
• The direct method of subtraction taught in elementary
schools uses the borrow concept.
• In this method, we borrow a 1 from a higher
significant position when the minuend digit is smaller
than the subtrahend digit.
• The method works well when people perform
subtraction with paper and pencil.
• However, when subtraction is implemented with
digital hardware, the method is less efficient than the
method that uses complements.
Subtraction of two n‐digit unsigned numbers
M - N in base r
• The subtraction of two n‐digit unsigned numbers M - N
in base r can be done as follows:
1. Add the minuend M to the r’s complement of the
subtrahend N. Mathematically,
M + (rn - N) = M - N + rn.
2. If M ≥ N, the sum will produce an end carry rn, which can
be discarded; what is left is the result M - N.
Subtraction of two n‐digit unsigned numbers
M - N in base r
3. If M ˂ N, the sum does not produce an end
carry and is equal to rn - (N - M), which is the
r’s complement of (N - M).
To obtain the answer in a familiar form, take
the r’s complement of the sum and place a
negative sign in front.
Subtraction of two n‐digit unsigned numbers
M - N in base r
• Both numbers must have the same number of digits
1.Calculate the r’s complement of the subtrahend N.
Add the minuend M to the r’s complement of the
subtrahend N.
Subtraction Using 10’s complement
Subtraction Using 10’s complement
Subtraction Using 2’s complement
Both numbers must have the same number of digits
Subtraction Using 9’s complement
Subtraction Using 1’s complement