📁 Topic 3 · 3.1 Number Representation
3.1c Binary arithmetic — addition and overflow
Edexcel 4CP0 · iGCSE Computer Science · ~10 min read
Notes
──
Video
──
Slides
──
Worksheet
──
Quiz

Binary Addition Rules

Binary addition works like denary addition, but with only two digits. The rules are:

OperationResultCarry
0 + 000
0 + 1 (or 1 + 0)10
1 + 101 (carry 1)
1 + 1 + 1 (with carry)11 (carry 1)

Worked Example 1: Simple Addition

Add 00110101 (53) + 00101010 (42):

00110101 (53)
+ 00101010 (42)
──────────
01011111 (95)

Working column by column from right: 1+0=1, 0+1=1, 1+0=1, 0+1=1, 1+0=1, 1+0=1, 0+0=0, 0+0=0. Result: 01011111 = 64+16+8+4+2+1 = 95 ✓

Worked Example 2: With Carry

Add 01110011 (115) + 00110101 (53):

01110011 (115)
+ 00110101 (53)
──────────
10101000 (168)

Overflow

Overflow occurs when the result of a binary addition is too large to be stored in the number of bits available. In an 8-bit system, values can only range from 0 to 255. If the result exceeds 255, the carry bit goes beyond bit 7 (into a 9th bit), which is lost — causing an incorrect result.

Overflow Example

Add 11000000 (192) + 11000000 (192):

11000000 (192)
+ 11000000 (192)
──────────
1 10000000 (should be 384, but 9th bit is lost)

Result stored: 10000000 = 128 ← WRONG (overflow!)

The correct answer (384) cannot fit in 8 bits. The carry into the 9th bit is lost, giving the incorrect result of 128.

How Overflow is Detected

  • A carry-out from the most significant bit (bit 7) indicates overflow in unsigned arithmetic
  • Modern processors have an overflow flag that is set when overflow occurs
  • Software can check this flag and handle the error appropriately

Binary Shifts

A binary shift moves all bits in a binary number left or right by a given number of positions. Bits that shift off the end are lost, and vacated positions are filled with 0s.

Logical Shift Left

Shifting left by 1 position multiplies the value by 2 (for each position shifted). Bits lost off the left end may cause overflow.

Original: 00001010 (10)
Shift left 1: 00010100 (20) ← ×2
Shift left 2: 00101000 (40) ← ×4

Logical Shift Right

Shifting right by 1 position divides the value by 2 (integer division — remainders are discarded). Bits shifted off the right end are lost.

Original: 00010100 (20)
Shift right 1: 00001010 (10) ← ÷2
Shift right 2: 00000101 (5) ← ÷4
📝 Exam Tip: Shift left = ×2 per position; shift right = ÷2 per position (integer). When asked about overflow, also state that it occurs when the result is too large to be stored in the available number of bits AND explain what incorrect value is produced. Just saying "the bits don't fit" is not enough for full marks.
⚠️ Common Mistakes
  • Forgetting to carry — when two 1s are added, write 0 and carry 1 to the next column
  • Not carrying the triple carry (1+1+1=11 in binary = 1 remainder, carry 1)
  • Saying overflow "corrupts" data rather than giving an incorrect/smaller result
← 3.1b Hexadecimal Topic 3 · 3.1 Number Representation Next: 3.1d Negative Numbers →
🔒
Pro Content
Subscribe to access all 47 Edexcel iGCSE lessons.
£7.99/month
or £59/year