Method : 16's complement subtraction steps :
1. At first, find 16's complement of the B(subtrahend).
2. Then add it to the A(minuend).
3. If the final carry over of the sum is 1, then it is dropped and the result is positive.
4. If there is no carry over, then 16's complement of the sum is the final result and it is negative.
1. Find Subtraction of 1B06 and 77C using 16's complement method
Here A = 1B06, B = 077C.
Find A - B = ? using 16's complement
First find 16's complement of B = 077C
Note : 16's complement of a number is 1 added to it's 15's complement number.
15's complement of 077C is
Now add 1 : F883 + 1 = F884
Now Add this 16's complement of B to A
Hints : (Move mouse over the steps for detail calculation highlight)
Step-1 `=6+4` `=6+4` `=10` `=16xx0+10` `=A_16` `:.` Sum`=A` | Step-2 `=0+8` `=0+8` `=8` `=16xx0+8` `=8_16` `:.` Sum`=8` |
Step-3 `=B+8` `=11+8` `=19` `=16xx1+3` `=13_16` `:.` Sum`=3` and carry`=1` | Step-4 `=1+1+F` `=1+1+15` `=17` `=16xx1+1` `=11_16` `:.` Sum`=1` and carry`=1` |
The left most bit of the result is called carry and it is ignored.
So answer is 138A
2. Find Subtraction of B06 and C7C using 16's complement method
Here A = B06, B = C7C.
Find A - B = ? using 16's complement
First find 16's complement of B = C7C
Note : 16's complement of a number is 1 added to it's 15's complement number.
15's complement of C7C is
Now add 1 : 383 + 1 = 384
Now Add this 16's complement of B to A
Hints : (Move mouse over the steps for detail calculation highlight)
Step-1 `=6+4` `=6+4` `=10` `=16xx0+10` `=A_16` `:.` Sum`=A` | Step-2 `=0+8` `=0+8` `=8` `=16xx0+8` `=8_16` `:.` Sum`=8` |
Step-3 `=B+3` `=11+3` `=14` `=16xx0+14` `=E_16` `:.` Sum`=E` | |
Here there is no carry, answer is - (16's complement of the sum obtained E8A)
Note : 16's complement of a number is 1 added to it's 15's complement number.
15's complement of E8A is
Now add 1 : 175 + 1 = 176
So answer is -176
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then