How to perform Arithmetic Operations on Binary Numbers?
How to Perform Arithmetic Operations on Binary Numbers?
Binary numbers hold the utmost importance in the number system. The number system is a system of numbers in which the way of representing numbers is involved. The numbers are also used on a larger scale in computer tools. For truth tables, binary numbers are very essential.
A truth table is a table in which separated columns are present for each given input and there is also a column for the output of the given input values. Binary numbers are very essential for different purposes.
What are Binary Numbers?
Binary numbers are those numbers in which only zero and one are involved. It doesn’t contain any number other than zero or one. Although the other numbers can be converted to binary then proceed further.
All types of integers can be converted to binary number systems by a small process. Such numbers are of great importance for converting the given number into one’s or two’s complement.
In simple words, base two numbers are called binary numbers. Base two numbers are those numbers that are less than two. Hence in base two, there is only two number that is zero and one. Positional numerals are also referred to as binary numbers.
Let’s take an example to convert decimal to binary.
Example
Convert the given decimal number to a binary number, 12000.
Solution
Step 1: Write the given decimal number, present in the problem.
12000
Step 2: Apply the division rule.
2 | 12000 |
2 | 6000 – 0 |
2 | 3000 – 0 |
2 | 1500 – 0 |
2 | 750 – 0 |
2 | 375 – 0 |
2 | 187 – 1 |
2 | 93 – 1 |
2 | 46 – 1 |
2 | 23 – 0 |
2 | 11 – 1 |
2 | 5 – 1 |
2 | 2 – 1 |
1 – 0 |
Step 3: Take all the remainder, which will be the binary number.
(10111011100000)_{2}
Hence, (10111011100000)_{2} is a binary number of 12000.
Now let’s take an example to convert binary to decimal.
Example
Convert (11110110)_{2} to a decimal number.
Solution
Step 1: Write the given binary number, from the problem.
(11110110)_{2}
Step 2: Multiply each digit of (11110110)_{2} by 2, as it is the base two-element.
(1 x 2) (1 x 2) (1 x 2) (1 x 2) (0 x 2) (1 x 2) (1 x 2) (0 x 2)
Step 3: Put plus sign between them.
(1 x 2) + (1 x 2) + (1 x 2) + (1 x 2) + (0 x 2) + (1 x 2) + (1 x 2) + (0 x 2)
Step 4: Take power from 0 to 7 from right to left.
(1 x 2^{7}) + (1 x 2^{6}) + (1 x 2^{5}) + (1 x 2^{4}) + (1 x 2^{3}) + (0 x 2^{2}) + (1 x 2^{1}) + (0 x 2^{0})
Step 5: Solve the exponents.
(1 x 128) + (1 x 64) + (1 x 32) + (1 x 16) + (1 x 8) + (0 x 4) + (1 x 2) + (0 x 1)
Step 6: Simplify.
128 + 64 + 32 + 16 + 8 + 0 + 2 + 0 = 250
Hence, 251 is the decimal number of (11110110)_{2}.
How to solve arithmetic operations on binary numbers?
Arithmetic operations are usually referred to as sum, subtract, multiply, or divide. The basic rule should be in mind that even if arithmetic operations are applied to it, the output must be zero and one.
If the output contains even a single digit other than zero and one then your output will be considered as wrong. The sum of 1 with itself must always be zero by carrying one to the other digit. Also, the carry taken from the previous digit must be two.
For performing arithmetic operations on the binary numbers you can use the following binary calculator.
https://www.allmath.com/binary-calculator.php
Let’s discuss the operations of binary numbers with a lot of examples.
1. Addition of Binary numbers
The addition of binary numbers is pretty simple. Only the knowledge of some basic concepts of the addition of binary numbers is required.
- Zero plus one is always equal to one, e.g., 0 + 1 = 1
- One plus zero is also always equal to one, e.g., 1 + 0 = 1
- Zero plus zero should be zero, e.g., 0 + 0 = 0
- One plus one must be zero by carrying one to the next digit, e.g., 1 + 1 = 10
Example
Find the sum of given binary numbers, (10010110)_{2}, (1110011)_{2}.
Solution
Step 1: Write the given binary numbers along with the sum sign between them.
(10010110)_{2} + (1110011)_{2}
Step 2: Solve.
(10010110)_{2 } + (1110011)_{2 }(100001001)_{2}
Hence, the sum of (10010110)_{2}, (1110011)_{2 }is (100001001)_{2}.
2. Subtraction of Binary numbers
The subtraction of the binary numbers is very simple. Only the knowledge of some basic concepts of subtraction of binary numbers is required.
- Zero minus one is not possible so we have to take carry from the other digit, the carry taken must be two, e.g., 10 – 1 = 1
- One minus zero is also always equal to one, e.g., 1 – 0 = 1
- Zero minus zero should be zero, e.g., 0 – 0 = 0
- One minus one must be zero, e.g., 1 – 1 = 0
Example
Find the difference of given binary numbers, (10010110)_{2}, (1110011)_{2}.
Solution
Step 1: Write the given binary numbers along with the minus sign between them.
(10010110)_{2} – (1110011)_{2}
Step 2: Solve.
(10010110)_{2 } – (1110011)_{2 } (100011)_{2}
Hence, the difference of (10010110)_{2}, (1110011)_{2 }is (100011)_{2}.
3. Multiplication of Binary numbers
In this operation, when we multiply the binary number with one the output remains the same, and when we multiply the number with zero all the output becomes zero. Then in the end add the multiplied results for the final output.
Example
Multiply the given binary numbers.
100011, 10110
Solution
Step 1: Write the given binary numbers along with the cross sign between them.
100011 x 10110
Step 2: Solve the Multiplication.
100011
x 10110
000000
100011x
100011xx
000000xxx
100011xxxx
1100000010
Hence, (1100000010)_{2} is the output of (100011)_{2} x (10110)_{2}.
4. Division of Binary Numbers
The division of binary numbers is rather difficult. For the division of two binary numbers, we have to take both numbers one inside and the other outside.
Example
Find the quotient of given binary numbers, (100011)_{2}, (10110)_{2}.
Solution
Step 1: Place the quotient sign among binary numbers.
(100011)_{2} / (10110)_{2}
Step 2: Solve the division.
Summary
Performing arithmetic operations is very simple just some basic rules are to be followed to perform such tasks. Binary numbers can be converted into decimal and decimal numbers into binary. Binary numbers are very helpful in one’s and two’s complement.
Resources and Related Articles: