Adding Binary Numbers
Basics of Adding Binary Numbers
- Binary numbers are in base 2, which means they have only two digits: 0 and 1.
- Like decimal addition, binary addition also follows a set of rules, which are different due to the binary system.
- Adding binary numbers is much like adding decimal numbers. The main difference is that carrying over happens when the sum reaches 2 instead of 10.
Rules of Adding Binary Numbers
- When adding binary numbers, four basic scenarios can occur: 0 + 0, 0 + 1, 1 + 0, and 1 + 1.
- The result of 0 + 0 or 0 + 1 or 1 + 0 is exactly as it appears: 0 or 1. No need to carry over anything.
- The scenario 1 + 1, however, is a bit more complicated. As 2 doesn’t exist in the binary system, the result is set to 0 and a 1 is carried over, similar to carrying the 1 in decimal addition when the sum exceeds 9.
Process of Adding Binary Numbers
- Start from the rightmost (least significant) digit and move to the left, following your binary addition rules. This is similar to how you would add decimal numbers.
- Keep in mind to add any carried number to the next calculation, just as you would in decimal addition.
- If there’s a carry after adding the leftmost (most significant) digits, write it down. Overflow may occur if the computational system doesn’t have room for that carry.
Practical Example
- Let’s take the binary numbers 11010 and 10101 for instance.
- Starting from the right, the sum is 1 (0 + 1). Write down 1.
- The second column from the right adds up to 2 (1 + 1). According to our rule, we write down 0 and carry over 1.
- In the third column, the numbers add up (0+0+carry 1) to 1. Write down 1 and do not carry over anything.
- In the fourth column, the numbers add up to 2 again (1+1). Write down 0 and carry over 1.
- The leftmost column numbers add up (carry 1 + 1) to 2. Write down a 0 and carry 1.
- As there are no more columns, write down the carry. The final answer is 101111.