Learn in your language
Skip to content
IGCSE · Cambridge (CIE) · 0478

Perform logical right and repeated shifts

Apply right and repeated logical shifts, explaining zero-fill, lost bits and division by powers of two.

Section 1 · Data representation

Cambridge IGCSE Computer Science 0478 · Data representation · 2026–2028 Version 6 · 1.1

This sequence follows Cambridge IGCSE Computer Science 0478, 2026–2028 syllabus Version 6. It covers subject content sections 1.1–1.3 only. The separately published 2029–2031 syllabus is not mapped here. Practice is original, self-checked and does not award an official Cambridge grade. Full timed papers and human subject-teacher review remain outstanding.

Before you begin

  • No programming language is required. Be comfortable with place value and multiplication; each lesson introduces the computer-science notation it uses.

Work on paper. Try each question before revealing help, and explain why your method works.

Quick readiness check

Which bit is discarded in a logical right shift?

What you will learn

  • Perform a logical right shift on a positive 8-bit integer
  • Perform multiple shifts in sequence
  • Explain the effect of discarded least significant bits

A right shift inserts zeros on the left

Move every bit one place right; the rightmost bit is discarded and a zero enters at the left. Repeat for each shift rather than jumping to a guessed result.

Apply and check the rule

For an unsigned positive integer, one right shift divides by two and discards any remainder. Two right shifts divide by four, again discarding low bits. The result is integer division, not a fractional binary value.

Pause and explain

What does two-place logical right shifting do to a positive integer when considered arithmetically?

Put the idea to work

Worked example

Shift 00101101₂ right twice.

Show the worked solution
  1. After one shift: 00010110; the final 1 is lost.
  2. After a second: 00001011; another 0 is lost.
  3. 45 divided by 4 gives integer result 11.

Answer 00001011₂ (11)

Try a topic test

Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.

Test this topic →

From guided practice to a new situation

Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.

1 · Guided

Shift 10010010₂ right once.

Give me a hint

Drop the rightmost bit; insert zero at the left.

Compare my reasoning
  1. Discard the final 0.
  2. Move the remaining bits one place right.
  3. The value 146 becomes 73.

01001001₂ (73)

Look for these in your work

  • Leading zero inserted
  • Rightmost bit discarded
  • Value halves
2 · Independent

Shift 01100101₂ right twice.

Give me a hint

Write the intermediate pattern after the first shift.

Compare my reasoning
  1. First: 00110010; discard the final 1.
  2. Second: 00011001; discard the final 0.
  3. 101 divided by 4 gives 25.

00011001₂ (25)

Look for these in your work

  • Intermediate pattern correct
  • Final pattern correct
  • Remainder handling understood
3 · Transfer

A sensor value 173 is right-shifted twice before display. State the binary result and what happened to the discarded information.

Give me a hint

Convert to eight-bit binary, then shift one position at a time.

Compare my reasoning
  1. 173 is 10101101₂.
  2. After two right shifts: 00101011₂.
  3. The two least significant bits were discarded; 173/4=43 remainder 1.

00101011₂ (43). The original lower two bits are lost, including the remainder 1.

Look for these in your work

  • Starting pattern correct
  • Two shifts shown
  • Lost bits/remainder explained

Common mistakes

  • Wrapping a lost bit around to the left
  • Forgetting that a right shift discards a remainder
Recall without your notes

What can you explain now?

What is 00010111₂ after one logical right shift?

Compare with the explanation

00001011₂

The last 1 is discarded and a zero enters on the left; 23 divided by 2 gives 11 remainder 1.

After trying it yourself, choose your next review. This is your self-assessment.

Your review choice appears on Today. Sign in to sync it across devices.

Make it stick

Why can a right shift of an odd value change its value by more than an exact division by two?

If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.

Keep learning Computer Science

Course scope and assessment

165 original lessons map the listed objectives across all 10 main topics in the 2026–2028 Version 6 syllabus, with worked explanations and guided, independent and transfer practice. This is mapped teaching coverage, not proof of full exam readiness. Three earlier starter lessons remain available but are not counted as syllabus-mapped teaching. Practical programming experience in an executable browser workspace, full timed-paper practice, human subject-teacher review and the separate 2029–2031 syllabus remain outstanding. Practice is self-checked and does not award an official Cambridge grade.

StudyForA · Learn with understanding

Original teaching content and links to official sources. Check your exam year and qualification before using a resource.