Perform subtraction on the given unsigned binary numbers using the 2’s complement of the subtrahend. Where the result should be negative, find its 2’s complement and affix a minus sign.
(a) 10011 - 10010 (b) 100010 - 100110
(c) 1001 - 110101 (d) 101000 - 10101
Ans:
(a) 10011 - 10010
2’s complement of 10010 =01101+1
=01110
10011 + 01110 =100001
Here there is a carry 1, so by discarding 1 the result is 00001.
(b) 100010 - 100110
2’s complement of 100110 = 011001+1
= 011010
100010 + 011010 = 111100
Here there is no carry, so affix negative sign to 2’s complement of 111100
The result is - 000100 .
(c) 1001 - 110101
2’s complement of 110101 =001010 + 1
=001011
001001 +001011 = 010100
Here there is no carry, so affix negative sign to 2’s complement of 010100
The result is -101100.
(d) 101000 – 10101
2’s complement of 10101= 01010 + 1
= 01011
101000+001011 = 110011
Here there is no carry, so affix negative sign to 2’s complement of 110011
The result is -001101.