AQA · GCSE · Computer Science

    Course version: 8525 · Version from Sept 2020

    Binary arithmetic: Describe situations where binary shifts can be used.

    A binary shift moves every bit in a pattern a fixed number of places left or right, filling the vacated positions with zeros.

    Checked against the AQA 8525 specification (opens in a new tab) on .

    • Point 5 of 6

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    A binary shift moves every bit in a pattern a fixed number of places left or right, filling the vacated positions with zeros. A left shift of n places multiplies the value by 2ⁿ, so shifting 00001010 (10) left by 2 gives 00101000 (40). A right shift of n places divides by 2ⁿ, discarding bits shifted off the right end, so 00010100 (20) shifted right by 2 gives 00000101 (5). Learners should recognise practical situations: fast multiplication or division by powers of two in low-level code, scaling values, packing or unpacking bit fields, and extracting individual bits such as flags. They should also note the loss of bits shifted beyond the register width, which changes the result.

    What earns the marks

    • A left shift by n places multiplies the binary value by 2ⁿ, illustrated with a worked example such as 00001010 shifted left 2 places giving 00101000.
    • A right shift by n places divides by 2ⁿ, discarding bits shifted off the right end, illustrated with a worked example such as 00010100 shifted right 2 places giving 00000101.
    • A valid situation is fast multiplication or division by powers of two in low-level or embedded code, where a shift is quicker than a multiply instruction.
    • A valid situation is extracting or testing individual bits, such as isolating a flag bit or unpacking a bit field, by shifting and then masking.
    • Recognition that bits shifted beyond the fixed register width are lost, so the result can differ from exact arithmetic when overflow occurs.

    Common mistakes and how to put them right

    • Thinking a left shift divides by two.

      Put it right by stressing that left shift multiplies by 2ⁿ and right shift divides by 2ⁿ.

    • Assuming a right shift rounds to the nearest value.

      Put it right by explaining that bits shifted off the right end are discarded, so the result is truncated.

    • Believing shifts preserve every bit regardless of register width.

      Put it right by showing that bits moved past the end of the fixed-width pattern are lost.

    Exam tips

    • Always state the direction and the number of places, then give the multiplication or division factor as 2ⁿ.
    • Work a short example with an 8-bit pattern to prove the effect before naming the situation.
    • When asked for situations, name a concrete context such as scaling a sensor reading or testing a flag bit, not just 'maths'.

    Try the lesson

    The start of the Binary arithmetic: Describe situations where binary shifts can be used. lesson, made from checked teaching notes for this specification point.

    Have a go first

    A program needs to double an integer quickly. Which operation achieves this using a binary shift?

    There is more to this lesson

    The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.

    Carry on with the full lesson

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge

    Test your understanding of Binary arithmetic: Describe situations where binary shifts can be used.

    Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.

    Take topic quiz

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge