AQA GCSE CSPaper 2 · Unit 3Lesson 6

Paper 2 · Unit 3 · CS-L3-06

Binary Shifts

60 minutes · AQA 8525 · Paper 2 — Fundamentals of data representation

Spec & Goals 3 min

AQA Spec 3.3.4 · Binary arithmetic

By the end of this lesson you can:

  1. Perform a logical binary shift left or right by a number of places.
  2. State the effect of a left shift (×2) and a right shift (÷2) per place.
  3. State what happens to bits shifted off the end of the number.

Warm-Up 5 min

Last lesson you added 8-bit binary numbers with carries and met overflow. Shifting is a quick way to multiply or divide.

Quick starter

In denary, what does adding a 0 to the right of a number do — for example, 6 becoming 60?

Reveal the answer

It multiplies by 10, because denary is base 10. In binary (base 2), shifting left by one place multiplies by 2 instead.

Key Concept — logical shifts 14 min

A logical binary shift moves every bit left or right by a fixed number of places. Empty positions are filled with 0, and any bits pushed off the end are lost.

What a shift does to the value

Because binary is base 2, each place a bit moves changes its place value by a factor of 2.

OperationEffect on the numberFill / loss
Shift left 1 placemultiplies by 2 (×2)0 fills the right; top bits can be lost
Shift right 1 placedivides by 2 (÷2)0 fills the left; bottom bits can be lost
Shift left n placesmultiplies by 2nas above, repeated
Shift right n placesdivides by 2nas above, repeated

Worked Example — shifting 6 left and right 12 min

Start: 00000110. Check the value: 4 + 2 = 6.

Shift left by 1 place. Every bit moves one column towards the left; a 0 fills the empty right-hand position.

Place1286432168421
Before (6)00000110
After ≪100001100

Result: 00001100 = 8 + 4 = 12. That is 6 × 2 = 12. A left shift multiplied by 2.

Shift right by 1 place (from the original 00000110). Every bit moves one column right; a 0 fills the empty left-hand position.

Place1286432168421
Before (6)00000110
After ≫100000011

Result: 00000011 = 2 + 1 = 3. That is 6 ÷ 2 = 3. A right shift divided by 2.

Try It Yourself 12 min

🟢 Easy

Goal: Shift 00000010 left by 1 place. Give the 8-bit result and its denary value.

Hint: the start value is 2, and a left shift multiplies by 2.

🟡 Medium

Goal: Shift 00011000 right by 2 places. Give the result and explain what happened to the value.

Hint: right by 2 places divides by 2 twice, i.e. by 4.

🔴 Stretch

Goal: Shift 00000101 (5) right by 1 place. Give the result, and explain why some precision is lost.

📝 Exam Practice 10 min

Answer the way the examiner expects — the command word and the marks tell you how much to write.

Calculate[2 marks]

Shift 00010100 left by 2 places. Give the result in binary.

Mark scheme
  • All bits moved 2 places left, 0s filling the right (1).
  • Answer 01010000 (1). Check: 20 × 4 = 80 = 64+16.
State[1 mark]

State the effect of a single left shift on a number.

Mark scheme
  • It multiplies the number by 2 (1).
State[1 mark]

State what happens to bits that are shifted off the end of a binary number.

Mark scheme
  • They are lost / discarded (1).

Recap & Key Terms 3 min

A logical binary shift moves every bit left or right; 0s fill the empty positions and bits pushed off the end are lost. Each left shift multiplies by 2 and each right shift divides by 2, so right shifts can lose precision.

Binary shift
Moving all the bits of a binary number left or right by a number of places.
Logical shift
A shift that fills the vacated positions with 0s and discards any bits moved off the end.
Shift left
Moving bits towards the most significant end; multiplies the value by 2 for each place shifted.
Shift right
Moving bits towards the least significant end; divides the value by 2 for each place shifted.

Homework 1 min

Task (≤ 15 min): Shift 00001001 left by 3 places. Give the 8-bit result and explain the effect on the value.

Model answer
Place1286432168421
Before (9)00001001
After ≪301001000

Result: 01001000 = 64 + 8 = 72. The value 9 was multiplied by 23 = 8, and 9 × 8 = 72. Award marks for: correct shifted bits with 0s filling the right (1), and explaining it multiplies by 8 / 2³ (1).