For 599 and 015, Find BCD Subtraction using 9's complement
Solution:
`599-015` BCD subtraction using `9's` complement
Steps for BCD subtraction using `9's` complement
For `A-B`
1. Take `9's` complement for B
2. Add it to A using BCD addition
3. If addition is invalid BCD then add 6
4. If carry then add it to the next bits
5. In final result, if carry is occured then add it the remaining result and if
there is no any carry over, then take `9's` complement of the result and it is negative.
1. Take `9's` complement for `015`
Note : 9's complement of a number is obtained by subtracting all bits from 999
9's complement of 015 is
2. Add `599` and `984` using BCD addition
BCD code for 599 : | 0101 | 1001 | 1001 |
BCD code for 984 : | 1001 | 1000 | 0100 |
|
Addition : | 1110 | 10001 | 1101 |
If Invalid BCD then add 6 : | 0110 | 0110 | 0110 |
|
Addition : | 10100 | 10111 | 10011 |
|
Remaining bits except carry : | 10100 | 0111 | 0011 |
Carry : | 1 | 1 | |
|
Addition : | 10101 | 1000 | 0011 |
BCD value : | 15 | 8 | 3 |
The left most bit of the result is 1, called carry and This will be added to `583`.
`583+1=584`
So final answer of BCD Subtraction is `584`
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then