Method: Adding 8-Bit Binary Numbers
Adding Binary Numbers
Here's how to add two 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 (0 + 0, 0 + 1, 1 + 0, 1 + 1) following these rules:
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 0, carry 1
- 1 + 1 + 1(carry) = 1, carry 1
- Check for carry:
- If the sum of two digits is 1, write down 1 as the result digit.
- If the sum is 2 (1 + 1), write down 0 as the result digit and carry 1 to the next column.
- Add the carry: If there's a carry from the previous column, add it to the sum of the next digit pair 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 two 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.
Examples
Here are some examples of adding 8-bit binary numbers:
Example 1:
Add the following binary numbers:
carry: 111
0011 0101
+ 0101 1010
-----------------
answer: 1000 1111
-----------------
The sum is: 1000 1111