Addition and subtraction are basic arithmetic operations that we learn in school. However, when we work with numbers in different bases, the process of addition and subtraction can become more complex. In this article, we will discuss how to perform addition and subtraction in different bases, including binary, octal, and hexadecimal.
The addition and subtraction of numbers in other bases will be best understood by watching the video below.
BINARY ADDITION
Binary addition is similar to decimal addition, except that we only have two digits, 0 and 1. The rules for binary addition are:
0 + 0 = 0.
0 + 1 = 1.
1 + 0 = 1.
1+ 1 = 10.
Notice that the sum of 1 and 1 is 10 in binary, which means we have to carry over a digit to the next column. Let’s look at an example of binary addition:
We start by adding the rightmost digits, which are 0 and 1. The sum is 1, so we write down 1 in the result. Then we move to the next column and add 1 and 0, which gives us 1. We continue in this way until we have added all the digits. In the last column, we have to carry over a digit from the previous column, which gives us 1 + 1 + 1 = 11. We write down 1 and carry over the other 1 to the next column.
BINARY SUBTRACTION
Binary subtraction is also similar to decimal subtraction, except that we only have two digits, 0 and 1. The rules for binary subtraction are:
0 - 0 = 0.
0 - 1 = 1. (with a borrow of 1)
1 - 0 = 1.
1 - 1 = 0.
Notice that when we subtract 1 from 0, we have to borrow a digit from the next column. Let’s look at an example of binary subtraction:
1101 - 1010 = 111We start by subtracting the rightmost digits, which are 1 and 0. The difference is 1, so we write down 1 in the result. Then we move to the next column and subtract 0 from 1, which gives us 1. However, we need to borrow a digit from the next column, so we subtract 1 from 1 and get 0. We continue in this way until we have subtracted all the digits.
OCTAL ADDITION AND SUBTRACTION
Octal addition and subtraction are similar to decimal addition and subtraction, except that we only have eight digits, 0 to 7. The rules for octal addition and subtraction are the same as decimal addition and subtraction.
Let’s look at an example of octal addition:
73 + 45 = 120We start by adding the rightmost digits, which are 3 and 5. The sum is 10 in decimal, which means we have to carry over a digit to the next column. We continue in this way until we have added all the digits.
Let’s look at an example of octal subtraction:
73 - 45 =26We start by subtracting the rightmost digits, which are 3 and 5. Since 3 is smaller than 5, we need to borrow a digit from the next column. We subtract 1 from 7 and get 6, then we add 8 to 3 and get 11. Finally, we subtract 5 from 11 and get 6. We continue in this way until we have subtracted all the digits.
HEXADECIMAL ADDITION AND SUBTRACTION
Hexadecimal addition and subtraction are similar to binary addition and subtraction, except that we have sixteen digits, 0 to 9 and A to F. The rules for hexadecimal addition and subtraction are the same as binary addition and subtraction.
Let’s look at an example of hexadecimal addition:
2A + 1E = 48We start by adding the rightmost digits, which are A and E. The sum is 18 in decimal, which means we have to carry over a digit to the next column. We continue in this way until we have added all the digits.
Let’s look at an example of hexadecimal subtraction:
2A - 1E = CWe start by subtracting the rightmost digits, which are A and E. Since A is larger than E, we do not need to borrow a digit from the next column. We subtract E from A and get 4. We continue in this way until we have subtracted all the digits.
See also: CONVERSION FROM BASE 10 TO OTHER NUMBER BASES WITH VIDEOS
CONCLUSION
Performing addition and subtraction in different bases can be challenging, especially when we move to bases with more than ten digits. However, by understanding the rules for each base and practising with examples, we can become proficient in these operations. It is also important to note that computers use binary arithmetic for calculations, which means that understanding how to perform addition and subtraction in binary is essential for computer science and programming.
Leave a Reply