Binary addition: How carry works
Add one bit at a time. A carry moves from a small place value to the next one.
Number basics
1 + 1 = 10₂
In one binary place, 1 + 1 makes 0 and carries 1 to the next place. The subscript 2 means “this number is binary.”
What the column sum means
For one column, add the A bit, the B bit and the carry from the previous column. This small sum can be 0, 1, 2 or 3. Write its rightmost binary digit. Carry its left digit to the next column.
0 + 0 + 0 = 0 = 0₂Write: 0 Carry: 00 + 1 + 0 = 1 = 1₂Write: 1 Carry: 01 + 1 + 0 = 2 = 10₂Write: right digit 0 Carry: left digit 11 + 1 + 1 = 3 = 11₂Write: right digit 1 Carry: left digit 1Add these bytes
One column per step
| Bit | Place value | A | B | Carry in | Column sum | Result bit | Carry out |
|---|
“Carry in” is the value (0 or 1) passed from the previous column. “Column sum” is A + B + carry in, shown in decimal and binary. The left digit is the carry out.
Full sum
The leftmost slot is carry out from bit 7. It is not part of the 8-bit result.
Simplification: this example adds unsigned 8-bit values. It shows carry out. It does not model the Z80 flags yet.