In binary number system there are only 2 digits 0 and 1, and any number can be represented by these two digits. The arithmetic of binary numbers means the operation of addition, subtraction, multiplication and division. Binary arithmetic operation starts from the least significant bit i.e. from the right most side. We will discuss the different operations one by one in the following article.
There are four steps in binary addition, they are written below
• 101101 + 11001 = 1000110:
• 1011001 + 111010 = 10010011:
• 1110 + 1111 = 11101:
• 10111 + 110101 = 1001100:
• 11011 + 1001010 = 1100101:
00010111 × 00000011 = 01000101
Binary Addition:-
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 0 (carry 1 to the next significant bit)
Example:-
• 10001 + 11101 = 101110:
1 | 1 | |||||
1 | 0 | 0 | 0 | 1 | ||
+ | 1 | 1 | 1 | 0 | 1 | |
1 | 0 | 1 | 1 | 1 | 0 |
• 101101 + 11001 = 1000110:
1 | 1 | 1 | 1 | ||||
1 | 0 | 1 | 1 | 0 | 1 | ||
+ | 1 | 1 | 0 | 0 | 1 | ||
1 | 0 | 0 | 0 | 1 | 1 | 0 |
• 1011001 + 111010 = 10010011:
1 | 1 | 1 | 1 | |||||
1 | 0 | 1 | 1 | 0 | 0 | 1 | ||
+ | 1 | 1 | 1 | 0 | 1 | 0 | ||
1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 |
• 1110 + 1111 = 11101:
1 | 1 | 1 | |||
1 | 1 | 1 | 0 | ||
+ | 1 | 1 | 1 | 1 | |
1 | 1 | 1 | 0 | 1 |
• 10111 + 110101 = 1001100:
1 | 1 | 1 | 1 | 1 | |||
1 | 0 | 1 | 1 | 1 | |||
+ | 1 | 1 | 0 | 1 | 0 | 1 | |
1 | 0 | 0 | 1 | 1 | 0 | 0 |
• 11011 + 1001010 = 1100101:
1 | 1 | 1 | |||||
1 | 1 | 0 | 1 | 1 | |||
+ | 1 | 0 | 0 | 1 | 0 | 1 | 0 |
1 | 1 | 0 | 0 | 1 | 0 | 1 |
Binary Subtraction:-
Here are too four simple steps to keep in memory
• 1011011 − 10010 = 1001001:
• 1010110 − 101010 = 101100:
• 1000101 − 101100 = 11001:
• 100010110 − 1111010 = 10011100:
• 101101 − 100111 = 110:
• 1110110 − 1010111 = 11111:
Here are also four steps to be followed, which are
- 0 - 0 = 0
- 0 - 1 = 1, borrow 1 from the next more significant bit
- 1 - 0 = 1
- 1 - 1 = 0
Example:-
• 1011011 − 10010 = 1001001:
1 | 0 | 1 | 1 | 0 | 1 | 1 | |
− | 1 | 0 | 0 | 1 | 0 | ||
1 | 0 | 0 | 1 | 0 | 0 | 1 |
• 1010110 − 101010 = 101100:
0 | 0 | ||||||
×1 | 10 | ×1 | 10 | 1 | 1 | 0 | |
− | 1 | 0 | 1 | 0 | 1 | 0 | |
1 | 0 | 1 | 1 | 0 | 0 |
• 1000101 − 101100 = 11001:
0 | 1 | 1 | |||||
×1 | ×10 | ×10 | 10 | 1 | 0 | 1 | |
− | 1 | 0 | 1 | 1 | 0 | 0 | |
1 | 1 | 0 | 0 | 1 |
• 100010110 − 1111010 = 10011100:
0 | 1 | 1 | 1 | 10 | |||||
×1 | ×10 | ×10 | ×10 | ×1 | 10 | 1 | 1 | 0 | |
− | 1 | 1 | 1 | 1 | 0 | 1 | 0 | ||
1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 |
• 101101 − 100111 = 110:
0 | 10 | |||||
1 | 0 | ×1 | ×1 | 10 | 1 | |
− | 1 | 0 | 0 | 1 | 1 | 1 |
1 | 1 | 0 |
• 1110110 − 1010111 = 11111:
0 | 10 | 1 | 10 | 10 | |||
1 | ×1 | ×1 | ×10 | ×1 | ×1 | 10 | |
− | 1 | 0 | 1 | 0 | 1 | 1 | 1 |
1 | 1 | 1 | 1 | 1 |
Binary Multiplication:-
- 0×0=0
- 1×0=0
- 0×1=0
- 1×1=1 (there is no carry or borrow for this)
Example:-
00101001 × 00000110 = 11110110 |
0 0 1 0 1 0 0 1 | = | 41(base 10) | ||
× 0 0 0 0 0 1 1 0 | = | 6(base 10) | ||
0 0 0 0 0 0 0 0 | ||||
0 0 1 0 1 0 0 1 | ||||
0 0 1 0 1 0 0 1 | ||||
0 0 1 1 1 1 0 1 1 0 | = | 246(base 10) | ||
00010111 × 00000011 = 01000101
0 0 0 1 0 1 1 1 | = | 23(base 10) |
× 0 0 0 0 0 0 1 1 | = | 3(base 10) |
1 1 1 1 1 | carries | |
0 0 0 1 0 1 1 1 | ||
0 0 0 1 0 1 1 1 | ||
0 0 1 0 0 0 1 0 1 | = | 69(base 10 |
Binary Division:-
Binary division is comprised of other two binary arithmetic operations, multiplication and subtraction; an example will explain the operation more easily.
Example:-
00101010 ÷ 00000110 = 00000111 | 1 | 1 | 1 | = | 7(base 10) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 1 0 | ) | 0 | 0 | | 10 | 1 | 0 | 1 | 0 | = | 42(base 10) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- | 1 | 1 | 0 | = | 6(base 10) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | borrows | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- | 1 | 1 | 0 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | 1 | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- | 1 | 1 | 0 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
No comments:
Post a Comment