⬅➡ Component 1 · 1.2 Data Representation
1.2.4c Binary Shifts (Left & Right)
OCR J277 · GCSE Computer Science · ~10 min read
Notes
──
Video
──
Slides
──
Worksheet
──
Quiz

What are Binary Shifts?

A binary shift moves all the bits in a binary number left or right by a specified number of places. Bits shifted beyond the edge of the register are lost; vacant positions are filled with 0s.

Binary shifts are used by CPUs for fast multiplication and division by powers of 2.

Left Shift

A left shift by 1 place multiplies the value by 2. A left shift by n places multiplies by 2ⁿ.

  • All bits move one position to the left
  • The MSB is shifted out and lost
  • A 0 is inserted at the LSB (rightmost position)

Example: Left shift 00001100 by 1 place

1286432168421
Before (12)00001100
After shift left 100011000

Result: 00011000 = 24. 12 × 2 = 24 ✓

Example: Left shift 00000011 by 3 places

1286432168421
Before (3)00000011
After shift left 300011000

Result: 00011000 = 24. 3 × 2³ = 3 × 8 = 24 ✓

Right Shift

A right shift by 1 place divides the value by 2 (integer division, remainder lost). A right shift by n places divides by 2ⁿ.

  • All bits move one position to the right
  • The LSB is shifted out and lost
  • A 0 is inserted at the MSB (leftmost position)

Example: Right shift 00011000 by 1 place

1286432168421
Before (24)00011000
After shift right 100001100

Result: 00001100 = 12. 24 ÷ 2 = 12 ✓

Example: Right shift 00011100 by 2 places

1286432168421
Before (28)00011100
After shift right 200000111

Result: 00000111 = 7. 28 ÷ 4 = 7 ✓

Shift Rules Summary

Shift typeDirectionEffect on valueBits shifted outFill with
Left shift ×1← left× 2MSB lost0 at LSB
Left shift ×n← left n× 2ⁿn MSBs lost0s at LSB
Right shift ×1→ right÷ 2LSB lost0 at MSB
Right shift ×n→ right n÷ 2ⁿn LSBs lost0s at MSB

Why Use Shifts Instead of Multiplication?

Bit shifting is a much faster CPU operation than conventional multiplication or division circuits. It is used in:

  • Graphics processing (scaling values)
  • Audio processing (adjusting sample values)
  • Arithmetic optimisation by compilers
  • Cryptography and hashing algorithms

Data Loss in Shifts

Bits shifted beyond the register boundary are permanently lost. If a 1-bit is shifted out during a left shift, the result is smaller than expected (similar in concept to overflow). If a 1-bit is shifted out during a right shift, the result is an integer division — any remainder is discarded.

For example: right shift 00000111 (7) by 1 = 00000011 (3), not 3.5. The 1 shifted out from the LSB is lost.

Exam tip: Always show the before and after bit patterns in a shift question. State what is filled in (0s) and what is lost. For the mathematical effect, state: left shift by n = multiply by 2ⁿ; right shift by n = divide by 2ⁿ (integer division). Common mark scheme wording: "bits shift left one position, 0 inserted at LSB, value doubles."
⚠️ Common Mistakes
  • Filling vacant positions with 1s instead of 0s — always use 0s
  • Shifting in the wrong direction — left shift moves bits toward the MSB (multiply); right shift moves toward LSB (divide)
  • Forgetting that shifted-out bits are lost permanently
  • Stating that right shift by 1 = divide by 2 exactly — it's integer division; odd numbers lose the remainder
  • Confusing left shift with multiplication and getting the power of 2 wrong: shift by 3 = ×8, not ×3
✅ Notes completed!
Video coming soon

What's in this video

  • • Left shift: fill with 0s at LSB, bits move toward MSB = multiply by 2
  • • Right shift: fill with 0s at MSB, bits move toward LSB = divide by 2
  • • Worked examples with before/after bit tables
  • • Why CPUs use shifts for fast arithmetic
Click slide or press arrow keys to navigate

Worksheet — 1.2.4c Binary Shifts

8 questions · 18 marks · Show bit patterns before and after

Q1State what happens to the bits when a left shift is performed. What value is placed in the vacated position?[2]
✅ Mark scheme
All bits move one position to the left [1]; a 0 is inserted in the LSB (rightmost) position; the MSB is shifted out and lost [1].
Q2Perform a left shift by 1 on 00001011. Show the result in binary and denary, and verify mathematically.[3]
✅ Mark scheme
Binary: 00010110 [1]; Denary: 22 [1]; check: 11 × 2 = 22 ✓ [1].
Q3Perform a right shift by 1 on 01100100. Give the result in binary and denary.[2]
✅ Mark scheme
Binary: 00110010 [1]; Denary: 50 [1]; check: 100 ÷ 2 = 50 ✓.
Q4Perform a left shift by 3 on 00000101. Give the result and state the mathematical equivalent.[3]
✅ Mark scheme
Left shift 3: 00101000 [1]; denary: 40 [1]; 5 × 2³ = 5 × 8 = 40 ✓ [1].
Q5What is the effect of a right shift by 2 on a binary number? State the mathematical equivalent.[2]
✅ Mark scheme
Right shift by 2 divides by 4 (= 2²) using integer division [1]; two 0s are inserted at the MSB and two bits are lost from the LSB [1].
Q6Right shift 00010101 (21) by 1 place. What is the result? Is the result exact? Explain.[3]
✅ Mark scheme
Result: 00001010 = 10 [1]; not exact: 21 ÷ 2 = 10.5, but the LSB (1) is lost so the result is 10 (remainder discarded) [1]; this is integer division [1].
Q7A programmer wants to multiply an 8-bit value by 8 using binary shifts. How many left shifts are needed, and why?[2]
✅ Mark scheme
3 left shifts are needed [1]; because 2³ = 8, and each left shift doubles the value [1].
Q8Give one reason why a CPU uses binary shifts instead of conventional multiplication for multiplying by powers of 2.[1]
✅ Mark scheme
Binary shifts are faster to perform than multiplication circuits; they require fewer clock cycles and less hardware complexity. [1]
?
out of 18 — self-mark above
Topic Quiz
Question 1 of 15
You scored
out of 15
Card 1 of 15
Click to reveal definition
🎉
Complete!
TermDefinition
🎯

Mini Test — 1.2.4c Binary Shifts

10 questions · 10 marks · 10 minutes

  • • 5 multiple choice + 5 short answer
  • • Show bit patterns for shift questions
← 1.2.4b Binary Addition 1.2 Data Representation 1.2.4d Hexadecimal →
🔒
Unlock Everything
Subscribe to access all OCR J277 lessons.
£7.99/month
or £59/year
Subscribe now →