Skip to main content
EnglandComputer ScienceSyllabus dot point

How do computers add binary numbers and shift the bits?

Add binary numbers up to and including three 8-bit numbers, recognise overflow, and apply logical and arithmetic binary shifts.

A focused answer to AQA GCSE Computer Science 3.3.2, covering binary addition of up to three 8-bit numbers, overflow, and logical and arithmetic binary shifts.

Generated by Claude Opus 4.88 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. Binary addition
  3. Overflow
  4. Binary shifts
  5. Try this

What this dot point is asking

AQA wants you to add binary numbers (up to three 8-bit numbers in one calculation), recognise when overflow occurs, and carry out logical and arithmetic binary shifts, knowing the effect each shift has on the value.

Binary addition

When AQA asks you to add up to three 8-bit numbers, the safest method is to add them in pairs rather than trying to total three bits plus a carry in one column (which can give a column total of 4, needing a carry of 2). Add the first two numbers, then add the third to that running total. This keeps each column total at 3 or less, so the carry is never more than 1.

The reason the method matters is that the processor does exactly this inside its arithmetic logic unit (ALU): a full adder circuit adds two bits plus a carry-in and produces a sum bit and a carry-out. The carry-out feeds the next column, which is why addition is done right to left.

Overflow

For an unsigned 8-bit register the largest value is 11111111=25511111111 = 255. Any addition whose true total exceeds 255 produces overflow. For example 11111111+0000000111111111 + 00000001 should be 256, which needs the 9 bits 100000000100000000; the leading 1 is lost and the register holds 0000000000000000, the wrong answer. Computers detect this with an overflow (or carry) flag in the status register, which a program can test.

Binary shifts

Shifting is far faster for the CPU than full multiplication or division, which is why compilers replace multiply-by-power-of-two with a shift. An arithmetic shift preserves the sign of a signed (two's complement) number, but AQA 8525 only requires logical shifts, so always fill with zeros and read the question for the direction and number of places.

For example, shifting 0000011000000110 (6) left by one gives 0000110000001100 (12), and shifting 0001010000010100 (20) right by two gives 0000010100000101 (5, that is 20÷420 \div 4).

Try this

Q1. Add the 8-bit binary numbers 0000111100001111 and 0000000100000001. [2 marks]

  • Cue. 0001000000010000 (15+1=1615 + 1 = 16).

Q2. State the effect on the denary value of shifting a binary number left by two places. [1 mark]

  • Cue. It multiplies the value by 4 (222^2).

Exam-style practice questions

Practice questions written in the style of AQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

AQA 20224 marksAdd together the three 8-bit binary numbers 00101100, 00010011 and 00001001. Show your working and give your answer as an 8-bit binary number.
Show worked answer →

Add the numbers one pair at a time, working right to left and carrying when a column totals 2 or 3.

First add 00101100+00010011=0011111100101100 + 00010011 = 00111111 (44+19=6344 + 19 = 63). Then add the third number: 00111111+00001001=0100100000111111 + 00001001 = 01001000 (63+9=7263 + 9 = 72).

The final answer is 0100100001001000, which is 64+8=7264 + 8 = 72 in denary, confirming the result.

Markers reward correct column-by-column carrying, a valid 8-bit answer, and a denary cross-check. One mark is lost for a single carry error even if the method is sound, so show every carry.

AQA 20193 marksA programmer applies a logical right shift of 2 to the 8-bit value 11001000. State the result and explain the effect this has on the denary value.
Show worked answer →

A logical right shift of 2 moves every bit two places right and fills the two vacated leftmost positions with 0. So 1100100011001000 becomes 0011001000110010.

In denary 11001000=20011001000 = 200 and 00110010=5000110010 = 50, so the value has been divided by 22=42^2 = 4 (200÷4=50200 \div 4 = 50).

Markers reward the correct shifted pattern, the zero-fill on the left, and stating that a right shift of nn divides by 2n2^n (here divide by 4). Note that because the two bits shifted off the right were both 0, no precision was lost.

Related dot points

Sources & how we know this