Published by: Dikshya
Published date: 09 Jul 2023
Arithmetic operations in the binary number system, such as addition, subtraction, multiplication, and division, follow similar principles as in the decimal system. Here's how each operation works in the binary number system:
To perform addition in the binary number system, you align the digits according to their place values and add them from right to left, just like in decimal addition. Here's a step-by-step process for adding binary numbers:
- Set up the addition with the binary numbers aligned by place value.
- Start adding the rightmost digits (the least significant bits). Add the binary digits along with any carry-over from the previous column.
1. If the sum is 0, write down 0 and carry over 0.
2. If the sum is 1, write down 1 and carry over 0.
3. If the sum is 2, write down 0 and carry over 1.
4. If the sum is 3, write down 1 and carry over 1.
- Move to the next column (to the left) and repeat the addition process, including the carry-over from the previous column if applicable.
- Continue this process until you have added all the columns.
- If there is a carry-over after adding the leftmost column, write it down as well.
Example:
1011 + 1101= 11000
In this example, we add the binary numbers 1011 and 1101. Adding from right to left, we start with 1 + 1, which gives us a sum of 10 (2 in decimal).
We write down 0 and carry over 1. Moving to the next column, we have 1 + 0 + the carried-over 1, resulting in a sum of 10 (2 in decimal). We write down 0 and carry over 1 again. In the third column, we have 0 + 1 + the carried-over 1, giving us a sum of 10 (2 in decimal). Again, we write down 0 and carry over 1. Finally, in the leftmost column, we add 1 + 1 + the carried-over 1, which gives us a sum of 11 (3 in decimal). We write down 1 and carry over 1.
Since there are no more columns, we write down the final carried-over 1. The result is 11000, which is the binary representation of the decimal number 24. Therefore, the binary addition of 1011 and 1101 is equal to 11000.
To perform subtraction in the binary number system, you align the digits according to their place values and subtract them from right to left, similar to decimal subtraction. Here's a step-by-step process for subtracting binary numbers:
- Set up the subtraction with the binary numbers aligned by place value.
- Start subtracting the rightmost digits (the least significant bits). If the digit being subtracted is larger than the digit being subtracted from, borrow from the next higher place value.
1. If the digit being subtracted is 0 and the digit being subtracted from is 0, write down 0.
2. If the digit being subtracted is 1 and the digit being subtracted from is 0, borrow 1 from the next higher place value and write down 1.
3. If the digit being subtracted is 0 and the digit being subtracted from is 1, borrow 1 from the next higher place value and write down 1.
4. If the digit being subtracted is 1 and the digit being subtracted from is 1, write down 0.
- Move to the next column (to the left) and repeat the subtraction process, including any borrows from the previous column if applicable.
- Continue this process until you have subtracted all the columns.
- If there is a borrow from the leftmost column, subtract it as well.
Example:
1011-1101= 10
In this example, we subtract the binary number 1101 from 1011. Subtracting from right to left, we start with 1 - 1, which gives us 0. Moving to the next column, we have 0 - 0, resulting in 0. In the third column, we have 1 - 1, which is also 0. Finally, in the leftmost column, we have 1 - 1, resulting in 0. Since there are no more columns, we write down the final result as 10. The result is a binary number, and it represents the decimal value 2. Therefore, the binary subtraction of 1101 from 1011 is equal to 10.
Multiplication and division are arithmetic operations that can be performed in various number systems, including decimal, binary, octal, and hexadecimal. Here's an overview of how multiplication and division work in these number systems:
1. Multiplication:
- To multiply numbers in any number system, you use the multiplication algorithm by multiplying each digit of one number by each digit of the other number, shifting the result based on the place value.
In decimal:
In binary, octal, and hexadecimal:
2. Division:
- To divide numbers in any number system, you use the division algorithm to find the quotient and remainder.
In decimal:
a. Set up the division with the dividend and divisor aligned by place value.
b. Perform long division, bringing down digits from the dividend, dividing, and finding the quotient digit.
c. Multiply the divisor by the quotient digit and subtract the result from the partial dividend to obtain a new partial dividend.
d. Repeat the process until you have exhausted all the digits of the dividend.
e. The final quotient is the series of quotient digits obtained, and the remainder is the final partial dividend.
In binary, octal, and hexadecimal:
a. The process is the same as in decimal, but with the specific digits of the respective number system.
b. Set up the division with the dividend and divisor aligned by place value.
c. Perform long division, bringing down digits from the dividend, dividing, and finding the quotient digit.
d. Multiply the divisor by the quotient digit and subtract the result from the partial dividend to obtain a new partial dividend.
e. Repeat the process until you have exhausted all the digits of the dividend.
f. The final quotient is the series of quotient digits obtained, and the remainder is the final partial dividend.
These are the general principles of multiplication and division in different number systems. The specific algorithms and digits used depend on the base of the number system being used.