4. Find Subtraction of 10100 and 11010 using 2's complementSolution:2's complement subtraction steps :
1. At first, find 2'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 2's complement of the sum is the final result and it is negative.
Here A = 10100, B = 11010.
Find A - B = ? using 2's complement
First find 2's complement of B = 11010
Note : 2's complement of a number is 1 added to it's 1's complement number.
Step-1: 1's complement of 11010 is obtained by subtracting each digit from 1
Step-2: Now add 1 :
00101 + 1 = 00110
Step-3: Now Add this 00110 to 10100
Step by step solution of 10100 + 00110 = 11010
Write the numbers, so that each digit lines up vertically
Step-1 :
`=0_2+0_2`
`=0_10+0_10`
`=0_10`
`=0_2`
Write the 0 in the sum place
Step-2 :
`=0_2+1_2`
`=0_10+1_10`
`=1_10`
`=1_2`
Write the 1 in the sum place
Step-3 :
`=1_2+1_2`
`=1_10+1_10`
`=2_10`
`=2xx1+0`
`=10_2`
Write the 0 in the sum place and carry the 1 to the next carry place
Step-4 :
`=1+0_2+0_2`
`=1+0_10+0_10`
`=1_10`
`=1_2`
Write the 1 in the sum place
Step-5 :
`=1_2+0_2`
`=1_10+0_10`
`=1_10`
`=1_2`
Write the 1 in the sum place
Here there is no carry, answer is - (2's complement of the sum obtained 11010)
Note : 2's complement of a number is 1 added to it's 1's complement number.
Step-1: 1's complement of 11010 is obtained by subtracting each digit from 1
Step-2: Now add 1 :
00101 + 1 = 00110
So answer is -00110
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then