Learn
1.1.4 | BINARY ADDITION AND OVERFLOW
01 | ADDING WITH ONLY TWO DIGITS
Binary addition works like the column addition you already know: line up the digits, start on the right and carry to the next column when needed.
In denary, a column total of ten creates a carry. In binary, a column total of two creates a carry, because each place is worth twice the place to its right.
This lesson adds unsigned 8-bit integers. Their range is 0 to 255. Signed addition uses different overflow rules and is not the model used here.
02 | THE FOUR BASIC RULES
| First bit | Second bit | Write here | Carry left |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
1 + 1 means two in denary, written as 10 in binary. Write the 0 in the current column and carry the 1 to the column on its left.
1 + 1 --- 10
The carried 1 has twice the current column’s place value. You are not losing the value; you are representing it in the next position.
03 | REMEMBER THE INCOMING CARRY
A column can receive a carry from the column on its right. Add that carry to the two original bits, then decide separately what to write here and what to carry left.
| First bit | Second bit | Carry in | Write here | Carry left |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
1 + 1 + a carried 1: write 1 in this column and carry 1 to the next column on the left. They belong in different positions, not together in one result cell.
In the worked additions below, the lighter green row shows incoming carries. The original operands remain dark. Blank carry cells mean there is no incoming carry.
04 | FIRST EXAMPLE: NO CARRIES
| Row | Beyond 8 bits | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|---|
| Carry in | |||||||||
| First value | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | |
| + Second value | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | |
| Sum | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 |
Each column contains at most one 1. Add from right to left and write each result directly. Check in denary: 20 + 9 = 29.
Keep all eight columns aligned, including leading zeros. Otherwise you may accidentally add different place values together.
05 | WORKED EXAMPLE: CARRIES THROUGH SEVERAL COLUMNS
The operands are written horizontally, with matching place values lined up. Start at the right. Each carry is already shown above the column that receives it.
| Row | Beyond 8 bits | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|---|
| Carry in | 1 | 1 | 1 | 1 | 1 | 1 | |||
| First value | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | |
| + Second value | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | |
| Sum | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 |
Read the sum horizontally, from 128 down to 1: 01001000. The carry is included exactly once in each column.
Denary check: 45 + 27 = 72. A carry inside the eight columns is normal and does not by itself mean overflow.
06 | A CHAIN OF CARRIES
| Row | Beyond 8 bits | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|---|
| Carry in | 1 | 1 | 1 | 1 | |||||
| First value | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | |
| + Second value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | |
| Sum | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
The rightmost 1 + 1 writes 0 and carries 1. The next three columns each add a 1 and the incoming carry, so each also writes 0 and carries 1.
At the 16 column, 0 + 0 + 1 writes 1. The chain stops, and the result fits within eight bits.
This is a useful pattern to recognise: adding one to a run of trailing 1s turns those trailing bits to 0 and increments the next position.
07 | OVERFLOW: THE RESULT DOES NOT FIT
An unsigned 8-bit register can hold only eight bits. Its greatest value is 11111111₂ = 255₁₀. Overflow occurs when the correct sum is outside the range that can be represented.
| Row | Beyond 8 bits | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|---|
| Carry in | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| First value | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| + Second value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | |
| Sum | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Full mathematical result: 100000000₂ = 256₁₀.
Low eight bits: 00000000₂ = 0₁₀.
Overflow: yes, because 256 exceeds 255.
If only the low eight result bits are retained, the extra leading bit does not fit and the retained pattern is not the correct unsigned sum. A real processor may record a carry condition; software behaviour depends on the system.
08 | OVERFLOW WITH ANOTHER SUM
| Row | Beyond 8 bits | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|---|
| Carry in | 1 | 1 | |||||||
| First value | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | |
| + Second value | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | |
| Sum | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |
The correct sum is 300, which needs nine bits. An 8-bit-only result retains 00101100, representing 44.
Check: 300 − 256 = 44. For addition of two unsigned 8-bit values, an outgoing carry beyond the 128 column indicates that the sum exceeds the range.
Do not report 44 as the full mathematical answer. State the correct sum, retained bits and overflow separately when asked.
09 | TRY AN EIGHT-BIT ADDER
Enter two eight-bit patterns. Predict the sum and whether it fits, then inspect the result and carry row.
10 | A RELIABLE EXAM METHOD
- Line up the eight-bit operands by place value.
- Start at the rightmost column.
- Add both bits and the incoming carry.
- Write the result bit and pass the outgoing carry left.
- Check for a carry beyond the leftmost available bit.
- Use denary as a separate check if helpful.
For an overflow explanation, connect the result to the range: “The sum is greater than 255, so it cannot be represented in an unsigned 8-bit register.” Simply writing “there is a carry” is not enough when the carry stays inside the register.
PRACTISE | ADD, CHECK AND EXPLAIN
Complete the activities, then try the scored and written questions without the adder.