Method: Adding 3, 8-Bit Binary Numbers
Adding Binary Numbers
Here's one method for adding 3, 8-bit binary numbers:
- Line up the numbers: Write the binary numbers vertically, aligning the rightmost digits (least significant bits). Use zeros to pad shorter numbers.
- Add each digit pair: Add the corresponding digits following these rules:
- 0 + 0 + 0 = 0
- 0 + 0 + 1 = 1
- 0 + 1 + 0 = 1
- 1 + 0 + 0 = 1
- 0 + 1 + 1 = 0, carry 1 (decimal equiv = 2)
- 1 + 1 + 0 = 0, carry 1 (decimal equiv = 2)
- 1 + 1 + 1 = 1, carry 1 (decimal equiv = 3)
we need to also bring in the carry values
- 1 + 1 + 1 + 1 = 0, double carry 1 (decimal equiv = 4)
- 1 + 1 + 1 + 1 + 1 = 1, double carry 1 (decimal equiv = 5)
- Check for carry:
- If the sum of three digits is 1, write down 1 as the result digit.
- If the sum is 2 (1 + 1 + 0), write down 0 as the result digit and carry 1 to the next column.
- If the sum is 3 (1 + 1 + 1), write down 1 as the result digit and carry 1 to the next column.
- If the sum is 4 (1 + 1 + 1 + 1 in the carry row), write down 0 as the result digit and carry 10 to the next two columns. This is like carrying the 1 twice. in reaslity it is carrying 10 where the 0 goes into the next column and the 1 goes in the column after that (a double carry for the 1).
- Add the carry: If there's a carry from the previous column, add it to the sum of the next digits before checking for carry again.
- Repeat steps 2-4: Continue adding digits and checking for carry until you reach the leftmost digits.
Carry Forward
Carry forward happens when adding binary digits results in a sum greater than 1. In such cases:
- You write down 0 as the result digit for the current column.
- You carry 1 to the next column on the left.
- This "carried 1" is essentially added to the next digit pair in the next column.
- If the primary carry is full as a result of a previous double carry, put the next carry into the secondary carry slot
Examples
Here are some examples of adding 8-bit binary numbers:
Example 1:
Add the following binary numbers:
| Secondary Carry | | | | | | | | | |
| Primary Carry | | 1 | 1 | | | 1 | 1 | 1 | |
| | | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 1 |
| | | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| + | | | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 |
| = | | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 |
It is always good to check your answers using denary
| 111010112 | = | 23510 |
| 100000002 | = | 12810 |
| + | 010001102 | = | 7010 |
| = | 1101100012 | = | 43310 |
Example 2:
Add the following binary numbers (note the carry of 10 as a result of 1+1+1+1 and the single carry forced into the secondary carry slot):
| Secondary Carry | | | | | 1 | | | | |
| Primary Carry | | 1 | 1 | 1 | 1 | | 1 | | |
| | | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 |
| | | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 0 |
| + | | | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 |
| = | | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 |
It is always good to check your answers using denary
| 100111012 | = | 15710 |
| 010111102 | = | 9410 |
| + | 111011002 | = | 23610 |
| = | 1111001112 | = | 48710 |