Binary Addition:
The following table is useful when adding two binary numbers.
A |
B |
SUM(A+B) |
Carry |
0 |
0 |
0 |
- |
0 |
1 |
1 |
- |
1 |
0 |
1 |
- |
1 |
1 |
0 |
1 |
Example Add: 10112 + 10012
Example :
Perform Binary addition for the following : 2310 + 1210
Step 1 : Convert 23 and 12 into binary form
Step 2 : Binary addition of 23 and 12 :
Binary Subtraction:
The table for Binary Subtraction is as follows:
A |
B |
Difference(A-B) |
Borrow |
0 |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
0 |
0 |
1 |
1 |
1 |
When subtracting 1 from 0, borrow 1 from the next Most Significant Bit, when borrowing from the next Most Significant Bit, if it is 1, replace it with 0. If the next Most Significant Bit is 0, you must borrow from a more significant bit that contains 1 and replace it with 0 and Os upto that point become Is.
Example : Subtract 10010102 – 101002
Example Perform binary addition for the following: (-21)10 + (5)10
Step 1 : Change – 21 and 5 into binary form
Step 2:
Step 3.
Binary Addition of – 21 and 5: