Method: Adding 8-Bit 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.