The difference of numbers 101 and 1010 is 0101.
In order to learn Binary Subtraction, we will use the example: 1010 – 101.
Step 1: Take the 1's column and subtract it, (0 – 1), yielding 1 as per the binary subtraction condition with a borrow of 1 from the 10's position.
Step 2: The value 1 in the 10's column is changed to the value 0 after borrowing 1 from the 10's column.
1 Borrow
Step 3: Subtract the value in the tenth place, resulting in (0 – 0) = 0.
1 Borrow
Step 4: Subtract the values in the hundredth place. Take 1 from the 1000th position (0 – 1) = 1.
1 1 Borrow
When we compare the binary subtraction resulting value to the decimal value, we should get the same result. The decimal number 10 is equal to the binary value 1010, while the binary value 101 is equal to 5.
So, 10 – 5 = 5
As a result, the binary number 0101 equals the decimal number 5.
Binary Subtraction Using 1's Complement
1's complement of a number is obtained by interchanging every 0 to 1 and every 1 to 0 in a binary number. For instance, the 1's complement of the binary number 110₂ is 001₂.
- The positive sign is represented by the number 0.
- The negative sign is represented by number one
Procedure for Binary Subtraction by 1's Complement
The steps to perform binary subtraction using 1's complement are as follows:
- Write the subtrahend's 1's complement.
- Then, using the minuend, subtract the 1's complement subtrahend.
- If there is a carryover in the result, add it in the least significant bit.
- If there is no carryover, take the resultant's 1's complement, which is negative.
Example: Subtract (110101)₂ – (100101)₂
- (1 1 0 1 0 1)2 = 5310
- (1 0 0 1 0 1)2 = 3710 – subtrahend
Add the 1's complement of the subtrahend to the minuend now.
1 carry
1 carry
——————
0 1 0 0 0 0
Therefore, the solution is 010000. (010000)2 = 1610
Binary Subtraction Using 2's Complement
Step 1: Determine the 2’s complement of the smaller number
Step 2: Add this to the larger number.
Step 3: Omit the carry. Note that, there is always a carry in this case.
Exampe-1: Subtract (1010)2 from (1111)2 using 2’s complement method.
Solution:
Subtraction of Larger Number from Smaller Number:
To subtract a larger number from a smaller number using 2’s complement subtraction, following steps are to be followed:
Step 4: To get answer in true form, take 2’s complement and change its sign.
Example-2: Subtract (1010)2 from (1000)2 using 2’s complement.
Solution:
You can use a great app that can help you with Number Systems and Boolean algebra, This app will give you all the answers to your question. Download the "Logic Kit" app on App Store to solve any problem in these subjects. Click here to download the app.