Subtraction Using Complements can be done by two ways:
Subtraction Using r's Complement:
The subtraction of two positive numbers (M-N) both of base r can be done as follows;
- Add the minuend M to the r's complement of subtracted N.
- Inspect the result obtained in step 1 for end carry.
- If end carry occurs, discard it.
- If end carry doesn't occur, take r's complement if the number obtained in step 1 and place a negative sign in front.
For decimal numbers:
Example: Subtract (72532-3250) using 10's complement.
M= 72532
N= 03250
Here, end carry occurs as 1. So, 10's complement= 69282
For binary numbers:
Example: Subtract (1000100-1010100) using 2's complement.
M= 1000100
N= 11010100
2's complement of N=10110
Now, adding 2's complement of N to M
10110+1000100= 110000
Here, end carry occurs as 1, so 2's complement = -10000
Subtraction Using r-1's Complement:
- Add the minuend M to the r-1's complement of subtracted N.
- Inspect the result obtained in step 1 for end carry.
- If end carry occurs, add 1 to the least significant bit, i.e. end-around carry.
- If end carry doesn't occur, take r-1's complement of the number obtained in step 1 and place a negative sign in front.
For decimal number:
453.35+678.82= 1132.17
Here, end carry occur, so 9's complement = 132.18
For binary numbers:
Example Subtract (1000100-1010100) using 1's complement.
M= 1000100
N= 11010100
1's complement of N=101011
Now, adding 1's complement of N to M
101011+1000100= 1101111
Here, end carry doesn't occur as 1, so 1's complement of 1101111= -1000 which is the required answer.
You can use a great app that can help you with Number Systems and Boolean algebra, This app will give you all the answers to your question. Download the "Logic Kit" app on App Store to solve any problem in these subjects. Click here to download the app.