Binary Subtraction
Binary subtraction is one of the four binary operations, where we perform the subtraction method for two binary numbers (comprising only two digits, 0 and 1). This operation is similar to the basic arithmetic subtraction performed on decimal numbers in Maths. Hence, when we subtract 1 from 0, we need to borrow 1 from the next higher order digit, to reduce the digit by 1 and the remainder left here is also 1. Read other binary operation here.
Binary Subtraction
|
Note: For fractional binary numbers, the same rule applies for subtraction, and the decimal should be appropriately placed.
The concepts that are included in this lesson are:
- Definition
- Table
- Rules
- How to Subtract Binary Numbers?
- Solved Examples
- Binary Subtraction Using One’s Complement
- FAQs
What is Binary Subtraction?
Can you subtract binary numbers? The answer is yes. Subtraction of binary numbers is an arithmetic operation similar to the subtraction of decimal numbers or base 10 numbers. For example, 1 + 1 + 1 = 3 in base 10 and 1 + 1 + 1 = 11 in binary number system. When you add and subtract binary numbers, you will need to be careful when borrowing as these will take place more often.
When you subtract several columns of binary digits, you must take into account the borrowing. When 1 is to be subtracted from 0, the result is 1 where 1 is borrowed from the next highest order bit or digit.
More Topics Related to Binary Subtraction | |
---|---|
Binary Division | Binary Calculator |
Binary Addition | Binary Multiplication |
Binary Division | Number System |
Binary Subtraction Table
The subtraction of binary numbers is given by:
Binary Number | Subtraction Value |
0 – 0 | 0 |
1 – 0 | 1 |
0 – 1 | 1 (Borrow 1 from next high order digit) |
1 – 1 | 0 |
Note:
The addition of two binary number 1 and 1 is 10, where we consider 0 and carry forward 1 to next high order. But in the case of subtraction of 1 and 1, the answer is equal to 0, and nothing is carried forward.
In case of decimal subtraction, when 1 is subtracted from 0, then we borrow 1 from next preceding number and make it 10, and after subtraction, it results in 9, i.e. 10 – 1 = 9. But for binary subtraction, it results in 1 only.
Binary Subtraction Rules
Rules and tricks: Binary subtraction is much easier than the decimal subtraction when you remember the following rules:
- 0 – 0 = 0
- 0 – 1 = 1 ( with a borrow of 1)
- 1 – 0 = 1
- 1 – 1 = 0
Now, look at the example of the binary subtraction: 101 from 1010
How to Subtract Binary Numbers?
Learn how to do binary subtraction using the example: 1010 – 101
Procedure to do Binary Subtraction:
1010
(-) 101
- Step 1: First consider the 1’s column, and subtract the one’s column,( 0 – 1 ) and it gives the result 1 as per the condition of binary subtraction with a borrow of 1 from the 10’s place.
- Step 2: After borrowed 1 from the 10’s column, the value 1 in the 10’s column is changed into the value 0
1 Borrow
1 0 1 0
(-) 1 0 1
——————
1
- Step 3: So, subtract the value in the 10’s place, ( 0 – 0 ) = 0.
1 Borrow
1 0 1 0
(-) 1 0 1
——————
0 1
- Step 4: Now subtract the values in 100’s place. Borrow 1 from the 1000’s place ( 0 – 1 ) = 1.
1 1 Borrow
1 0 1 0
(-) 1 0 1
——————
0 1 0 1
So, the resultant of the subtraction operation is 0101.
When you cross-check the binary subtraction resultant value with the decimal value, the resultant value should be the same.
The binary value 1010 is equal to the decimal value 10, and 101 is equivalent to 5
So, 10 – 5 = 5
Therefore, the decimal number 5 is equal to the binary number 0101.
Binary Subtraction Examples
Consider other examples of binary subtractions are as follows:
Example 1: 0011010 – 001100
Solution:
1 1 Borrow
0 0 1 1 0 1 0
(-) 0 0 1 1 0 0
——————
0 0 0 1 1 1 0
Decimal Equivalent :
0 0 1 1 0 1 0 = 26
0 0 1 1 0 0 = 12
Therefore, 26 – 12 = 14
The binary resultant 0 0 0 1 1 1 0 is equivalent to the 14
Example 2: 0100010 – 0001010
Solution:
1 1 Borrow
0 1 0 0 0 1 0 = 3410
(-) 0 0 0 1 0 1 0 = 1010
——————
Binary Subtraction Using 1’s Complement
- The number 0 represents the positive sign
- The number 1 represents the negative sign
Procedures for Binary Subtraction by 1’s Complement
- Write the 1’s complement of the subtrahend
- Then add the 1’s complement subtrahend with the minuend
- If the result has a carryover, then add that carry over in the least significant bit
- If there is no carryover, then take the 1’s complement of the resultant, and it is negative.
Binary Subtraction Questions Using 1’s Compement
Question 1:
(110101)2 – (100101)2
Solution:
(1 1 0 1 0 1)2 = 5310
(1 0 0 1 0 1)2 = 3710 – subtrahend
Now take the 1’s complement of the subtrahend and add with minuend.
1 carry
1 1 0 1 0 1
(+) 0 1 1 0 1 0
——————
0 0 1 1 1 1
1 carry
——————
0 1 0 0 0 0
Therefore, the solution is 010000
(010000)2 = 1610
Question 2:
(101011)2 – (111001)2
Solution:
Take 1’s complement of the subtrahend
1 1 1
1 0 1 0 1 1
(+) 0 0 0 1 1 0 (1’s complement)
——————
1 1 0 0 0 1
Now take the 1’s complement of the resultant since it does not carry 1
The resultant becomes 0 0 1 1 1 0
Now, add the negative sign to the resultant value
Therefore the solution is – (001110)2.
For more information on binary operations like addition, multiplication, and division operations register with BYJU’S – The Learning App and also watch exciting videos to learn with ease.
Frequently Asked Questions
What is Binary Subtraction?
Binary subtraction, unlike decimal subtraction, involves only two digits, i.e. 0 and 1. Visit BYJU’S to learn everything about binary subtraction.
What are the Rules of Binary Subtraction?
There are four rules of binary subtraction which are:
- 0 – 0 = 0
- 0 – 1 = 1 ( with a borrow of 1)
- 1 – 0 = 1
- 1 – 1 = 0
What is the binary subtraction of 1111011.11 and 1010101.10?
1111011.11
– 1010101.10
——————–
100110.01
——————–
What is the difference between binary addition and binary subtraction?
In case of binary subtraction, when 1 is subtracted from 0, then we borrow 1 from the next order digit and get the remainder as 1.
What signs do the binary digits 0 and 1 represent?
1 represents negative sign (-)