GCSE · Computer Science · Eduqas · Spec C500QS
Arithmetic shift functions
Slide a binary number two places left and it quadruples, though nothing was multiplied. So what goes wrong when a 1 falls off the end?
Computer Science · Arithmetic shifts
Slide the bits, watch the number
The row starts as 00010110, which reads as 22. Shift it left 2 places in your head: every bit moves two columns left and two 0s fill the gap on the right. Now click the bits into your answer and read the new value. Then try 1 place and 3 places.
Predict, then check
Right shifts halve each bit's place value. Decide before you look.
00010111 is 23. Shift it right 1 place. What number do the 8 bits show?
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Slide every bit sideways and the number doubles or halves, until the 8 boxes run out.
What you need to know
- An arithmetic shift slides every bit left or right by a stated number of places, inside a fixed number of bits.
- In a left shift, bits move towards the most significant end and the gaps at the right-hand end fill with 0s.
Have a goSam says shifting 00000110 left 2 places gives 00000001. Sam has slid the bits the wrong way. What is the real answer?
00011000
Left means towards the most significant end, with 0s filling the gaps on the right. Sam's answer has the bits moving the opposite way.
- Bits pushed beyond the most significant end of the fixed number of bits are shifted out and lost.
- Shifting left doubles each bit's place value, so n places left multiplies an unsigned number by 2ⁿ, provided no 1 is shifted out.
- The places shifted set the power of two: 1 place gives 2, 2 gives 4, 3 gives 8, and n gives 2ⁿ.
Have a go00000011 (3) is shifted left and becomes 00110000 with no 1 lost. How many places was it shifted, and what is the new value?
4 places, so × 16: 3 becomes 48
Count how far the 1s moved: 4 places. n places multiplies by 2ⁿ, which is 2⁴ = 16, not by 4, and 3 × 16 = 48.
- Push a 1 out of an unsigned number and the true answer no longer fits, so ×2ⁿ breaks.
Have a goPoor little 1 in 01000000 (64, unsigned) gets shoved 2 places left in an 8-box row. Where does it end up, and what do the boxes read?
Off the end: 00000000, which reads 0
Both places push the 1 past the most significant end, where it is shifted out and lost. ×4 would need 256, which does not fit in 8 bits.
- For two's complement, a left shift is ×2ⁿ only when every shifted-out bit and the new sign bit match the original sign bit.
- A right shift moves bits towards the least significant end, and bits pushed past the right-hand end are shifted out and lost.
- On a right arithmetic shift, the sign bit is copied into every vacated place at the left, so the sign is preserved.
- Right n places divides a positive number by 2ⁿ, exactly only when 0s alone are shifted out; a lost 1 loses the remainder.
The big picture
An arithmetic shift slides every bit of a fixed-width binary number left or right by a stated number of places. A left shift fills the right-hand gaps with 0s and loses any bits pushed past the left-hand end; it multiplies an unsigned number by 2ⁿ as long as no 1 is lost, and a two's complement number only when the shifted-out bits and new sign bit match the original sign bit. A right shift loses bits at the right-hand end and copies the sign bit into the gaps at the left; it divides a positive number by 2ⁿ exactly only when 0s alone are shifted out.
Key points
Worked example
Problem
Shift the 8-bit unsigned number 00001101 left 3 places. Give the result in binary and in denary, and say what the shift did to the value.
⚠ Watch out
Thinking every shift is exact. A left shift multiplies by 2ⁿ only while no 1 is lost (unsigned), or while every shifted-out bit and the new sign bit match the original sign bit (two's complement). A right shift copies the sign bit, and loses the remainder if a 1 goes.
Memory hook
Left: 0s in, times 2ⁿ. Right: the sign copied in, divide by 2ⁿ. Then always ask what fell off the end.
Check yourself
Without looking back: shift 11001000 right 3 places with an arithmetic shift. Write the result, say what was copied into the gaps and why, and say whether any 1 bits were shifted out.
Flashcards
(11)What is an arithmetic shift?
In a left arithmetic shift, what fills the vacated places?
In a left shift, what happens to bits that move beyond the most significant end?
Why does a left shift multiply an unsigned number by 2ⁿ?
What does the number of places shifted set?
An unsigned left shift pushes a 1 out of the 8 bits. What goes wrong?
Two's complement left shift: when is it ×2ⁿ, and when does it overflow?
In a right arithmetic shift, which way do the bits move and what is lost?
In a right arithmetic shift, what fills the vacated places at the left?
Why does a right shift halve a positive number's place values?
A right shift of a positive number shifts out a 1. What is the result?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore Eduqas GCSE Computer Science topics
How this lesson was checked. This Eduqas GCSE Computer Science (specification C500QS)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 16 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.