This article describes binary arithmetic functions such as addition, subtraction, multiplication, and division. Arithmetic is a mathematics that defines rules and regulations to perform different kinds of operations on numbers. Binary arithmetic is a branch of mathematics in which we perform operations on various arithmetic operations on binary digits or bits.
This article will cover the four basic arithmetic operations: addition, subtraction, multiplication, and division on binary numbers. So, let’s start with binary addition.
Binary Addition
Binary arithmetic addition involves adding two binary numbers to find their sum. Two or more numbers are combined using the following binary addition rules.
Bit 1 | Bit 2 | Sum | Carry |
0 | 0 | 0 + 0 = 0 | 0 |
0 | 1 | 0 + 1 = 1 | 0 |
1 | 0 | 1 + 0 = 1 | 0 |
1 | 1 | 1 + 1 = 0 | 1 |
Let us take an example to understand the binary addition.
Example – Add (1010011)2 and (1100111)2.
Solution – The addition of these two binary numbers is performed as follows:
The binary addition arithmetic steps involved in this addition are explained below:
Step 1 – Adding rightmost bits 1 and 1:
(1)2 + (1)2 = (10)2
0 is the sum bit, and 1 is the carry bit.
Step 2 – Adding subsequent bits 1 and 1 along with 1 carry from the previous addition-step 1:
(1)2 + (1)2 + (1)2 = (11)2
Here, the rightmost 1 is the sum bit, and the leftmost 1 is the carry bit.
Step 3 – Adding next bits 0 and 1 along with 1 carry from the previous step:
(1)2 + (0)2 + (1)2 = (10)2
0 is the sum bit, and 1 is the carry bit.
Step 4 – Adding next bits 0 and 0 with 1 carry from the previous step:
(1)2 + (0)2 + (0)2 = (1)2
Here, 1 is the sum bit and no carry bit.
Step 5 – Adding bits 1 and 0:
(1)2 + (0)2 = (1)2
Here, 1 is the sum bit and no carry bit.
Step 6 – Adding bits 0 and 1:
(0)2 + (1)2 = (1)2
Here, 1 is the sum bit and no carry bit.
Step 7 – Adding leftmost bits 1 and 1:
(1)2 + (1)2 = (10)2
0 is the sum bit, and 1 is the carry bit.
As there are no further bits left to add. Hence, we write the carry bit in the leftmost position of the sum. Hence, we get the binary number (10111010)2 as the sum of the two binary numbers.
This is how we can perform binary arithmetic addition of two binary numbers. Let us now learn to perform the subtraction of binary numbers.
Binary Subtraction:
Binary subtraction is an arithmetic operation performed on binary numbers to determine the difference between them.
The following rules are used to perform binary subtraction.
Bit 1 | Bit 2 | Difference | Borrow |
0 | 0 | 0 – 0 = 0 | 0 |
0 | 1 | 0 – 1 = 1 | 1 |
1 | 0 | 1 – 0 = 1 | 0 |
1 | 1 | 1 – 1 = 0 | 0 |
Let us now take an example to perform binary subtraction.
Example – Subtract (100111)2 from (111011)2.
Solution – The subtraction of the given binary numbers is shown in the following figure.
The step-by-step explanation of this binary arithmetic subtraction is given below:
Step 1 – Subtracting rightmost digits 1 from 1:
(1)2 – (1)2 = (0)2
Here, the difference is 0.
Step 2 – Subtracting next bits 1 from 1:
(1)2 – (1)2 = (0)2
Here, the difference is also 0.
Step 3 – Subtracting next bits 1 from 0:
Since 0 < 1, we borrow 1 from the next bit. Hence, after borrowing from the next bit, it becomes 0. The bit 0 becomes 2 (as a binary number system). Then,
(2)2 – (1)2 = (1)2
Here, 2 is the base 2 and not decimal 2. The difference is 1.
Step 4 – Subtracting next bits 0 from 0 (1):
(0)2 – (0)2 = (0)2
The difference is 0.
Step 5 – Subtracting next bits 0 from 1:
(1)2 – (0)2 = (1)2
The difference is 1.
Step 6 – Subtracting the leftmost bits 1 from 1:
(1)2 – (1)2 = (0)2
The difference is 0.
Hence, the final difference is (010100)2. This is how we can perform the binary subtraction.
Let us now discuss how to perform binary multiplication.
Binary Multiplication:
Binary multiplication is used to find the product of two binary numbers. The following are the rules to be followed while performing binary arithmetic multiplication.
Bit 1 | Bit 2 | Product |
0 | 0 | 0 × 0 = 0 |
0 | 1 | 0 × 1 = 0 |
1 | 0 | 1 × 0 = 0 |
1 | 1 | 1 × 1 = 1 |
Let us now understand the binary multiplication with the help of an example.
Example – Multiply (11011)2 with (110)2.
Solution – The binary multiplication of given binary numbers is shown below.
The step-by-step explanation of this multiplication of binary numbers is given below.
Step 1 – Multiple 0 of the binary number (110)2 with all the bits of the number (11011)2 and write the partial results as in this case (00000)2.
Step 2 – Multiply the next bit 1 of the number (110)2 with each bit of the number (11011)2, and the result will be (11011)2. write in a new line shifted one digit left.
Step 3 – Multiply the leftmost bit 1 of the number (110)2 with each bit of the number (11011)2, and the result will be (11011)2 again. Write it in a new line shifted one digit left.
Step 4 – Add all three partial results to obtain the final product of the given binary numbers. Which is (10100010)2.
This is how we can perform binary arithmetic multiplication of two binary numbers.
Let us now learn to perform the division of binary numbers.
Binary Division:
We can also perform arithmetic operations for the division of binary numbers. It gives two results; one is quotient, and the other is remainder.
The following rules are to be kept in mind while performing binary division.
Bit 1 | Bit 2 | Product |
0 | 0 | 0 ÷ 0 = Error |
0 | 1 | 0 ÷ 1 = 0 |
1 | 0 | 1 ÷ 0 = Error |
1 | 1 | 1 ÷ 1 = 1 |
Let us see an example to understand the binary division.
Example – Divide (10111)2 by (101)2.
Solution – The division of given binary numbers is shown below.
Conclusion
Hence, this is all about binary arithmetic. In this article, we have studied all four basic arithmetic operations, namely, binary addition, binary subtraction, binary multiplication, and binary division. I have explained all these operations with the help of numerical examples.