How do we add binary numbers by hand, and what happens when the result is too big for the register?
Perform binary addition showing carries, and explain overflow when a result exceeds the fixed width of a register
A focused answer to the O-Level Computing point on binary addition. Adding binary numbers column by column with carries, checking the result against denary, and understanding overflow in a fixed-width register.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
SEAB wants you to add binary numbers by hand, showing the carries, and to explain overflow: what happens when an addition produces a result that does not fit in the fixed number of bits the register has. The central idea is that binary addition works exactly like denary addition, but you carry whenever a column reaches the base, which in binary is .
The answer
The four addition rules
Adding two bits (plus any carry coming in) follows four simple cases:
0 + 0 = 0
0 + 1 = 1
1 + 1 = 10 (write 0, carry 1)
1 + 1 + 1 = 11 (write 1, carry 1)
The last case happens when there is also a carry into the column.
Adding column by column
Start at the rightmost column (the least significant bit) and work left. Add the two digits and any incoming carry, write the result digit, and pass any carry to the next column:
carries: 1 1 0
0 1 0 1
+ 0 0 1 1
---------
1 0 0 0
Here and , and , which checks.
Checking with denary
Always confirm a binary addition by converting both numbers and the result to denary. If in denary does not equal the denary value of your binary result, you have dropped a carry somewhere.
Fixed-width registers
A register stores a fixed number of bits, often . An unsigned 8-bit register can hold the values to , because patterns. The largest unsigned value is for bits.
Overflow
Overflow happens when an addition produces a carry out of the most significant bit, because the result needs more bits than the register has. The extra bit is lost, so the stored answer is wrong. You detect overflow by checking for a carry out of the top column, or by checking whether the true result exceeds .
Examples in context
Example 1. A counter wrapping round. An 8-bit counter that reads and is told to add overflows: the carry ripples out of the top bit and the counter wraps to . This is why an odometer or a game score can suddenly reset to zero.
Example 2. Adding bytes in a program. When two byte values are added in low-level code, the programmer must know the register width. If two large bytes are added without room for the carry, the result silently wraps, causing a bug that a denary check during testing would reveal.
Try this
Q1. Add and and give the 8-bit result. [2 marks]
- Cue. ; the run of ones rolls over with carries to set the next bit.
Q2. State the largest value an unsigned 8-bit register can hold, and why. [2 marks]
- Cue. , because bits give patterns, from to .
Q3. Add and in an 8-bit register and explain the result. [3 marks]
- Cue. , which needs bits; the carry out of the top bit is lost, so the register stores , an overflow.
Exam-style practice questions
Practice questions written in the style of SEAB exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Original4 marksAdd the 8-bit binary numbers and . Show your carries and give the 8-bit result. Check your answer by converting to denary.Show worked answer →
Add column by column from the right, carrying whenever a column reaches :
carries: 1 1 1 1 1 0
0 0 1 1 0 1 1 0
+ 0 0 0 1 1 1 0 1
-----------------
0 1 0 1 0 0 1 1
The result is . Check: and , and . Also . The two agree.
Markers reward correct carry propagation, the 8-bit result, and a denary check that matches.
Original4 marksAn 8-bit register stores unsigned integers. The values and are added. (a) Give the 9-bit sum. (b) Explain why overflow occurs and what the register would actually store.Show worked answer →
(a) Adding the two 8-bit numbers:
1 1 0 0 1 0 0 0
+ 0 1 0 1 0 0 0 0
-----------------
1 0 0 0 1 1 0 0 0
The full sum needs bits: . In denary .
(b) An unsigned 8-bit register can only hold to (). The sum needs a ninth bit, but there is no column for it, so the carry out of the most significant bit is lost. This is overflow. The register keeps only the lowest 8 bits, , which is the wrong answer.
Markers reward identifying the carry out of the top bit, the range to , and the truncated stored value .
Related dot points
- Explain why computers use binary, describe place value in binary and hexadecimal, and state why hexadecimal is used as shorthand for binary
A focused answer to the O-Level Computing point on number systems. Why computers use binary, place value in binary and hexadecimal, the meaning of bits and bytes, and why hexadecimal is a compact shorthand for binary.
- Convert whole numbers between denary, binary and hexadecimal using place value, repeated division and nibble grouping
A focused answer to the O-Level Computing point on number base conversion. Converting between denary, binary and hexadecimal using place value, repeated division by two, and grouping binary into nibbles.
- Explain how text (ASCII), sound (sampling) and images (pixels and colour depth) are represented as binary in a computer
A focused answer to the O-Level Computing point on representing data. How text uses character codes such as ASCII, how sound is sampled, and how images are stored as pixels with a colour depth, all as binary.
- Use units of storage from bit to terabyte, and explain lossless and lossy compression and why files are compressed
A focused answer to the O-Level Computing point on data measurement. Units from bit and byte up to terabyte, calculating file sizes, and the difference between lossless and lossy compression and why files are compressed.
- Describe the role and main parts of the CPU, the fetch-execute cycle, and how clock speed and cores affect performance
A focused answer to the O-Level Computing point on the CPU. The role of the processor, its main parts, the fetch-execute cycle that runs every instruction, and how clock speed and the number of cores affect performance.