0% found this document useful (0 votes)
30 views

Subtraction With Complements

1) Subtraction can be performed by adding the minuend to the complement of the subtrahend. 2) The complement of a number is that number's representation in a system where the roles of 0 and 1 are reversed (such as 10's complement in decimal). 3) Adding the minuend to the complement of the subtrahend allows subtraction to be performed as an addition problem.

Uploaded by

muktikanta
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Subtraction With Complements

1) Subtraction can be performed by adding the minuend to the complement of the subtrahend. 2) The complement of a number is that number's representation in a system where the roles of 0 and 1 are reversed (such as 10's complement in decimal). 3) Adding the minuend to the complement of the subtrahend allows subtraction to be performed as an addition problem.

Uploaded by

muktikanta
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

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

You might also like