Subtract the following (10101)2-(10001) using 1'scomplement
We need to subtract:
(10101)2−(10001)2
Using 1’s complement method.
Step 1: Write the numbers
10101
10001
Step 2: Find 1’s complement of the subtrahend
Subtrahend = 100011000110001
Invert all bits:
10001→01110
Step 3: Add the minuend and the 1’s complement
10101
+ 01110
100011
There is an end-around carry = 1.
Step 4: Add the carry to the remaining bits
Remaining 5 bits:
00011
Add carry 1:
00011+1=00100
Final Answer
(10101)2−(10001)2= (00100)2
(100)2
(1011)2
10101 = (21)10
10001 = (17)10
21-17 = 4