We’re moving to a new home! Our website is currently in test mode while we update and transfer our content. Some pages and resources may be temporarily unavailable. We’ll be back with all resources shortly. Thank you for your patience.

CIE IGCSE | 1.1.5 Binary Shifts

Lesson objective

Perform logical left and right shifts on positive 8-bit integers and explain zeros, lost bits and changes in value.

Learn

1.1.5 | BINARY SHIFTS

01 | MOVE THE BITS, KEEP THE REGISTER WIDTH

A binary shift moves bits to different place-value positions. Moving left places them in larger-value columns; moving right places them in smaller-value columns.

This lesson uses logical shifts of unsigned 8-bit values. The register keeps eight positions. Zeros enter the newly empty positions, and bits moved beyond the edge are discarded.

The bits do not rotate around to the other end. Signed arithmetic shifts follow different rules and are outside this lesson’s model.

02 | LEFT SHIFT BY ONE POSITION

13 shifted left once becomes 26
Row1286432168421
Before00001101
Move left← 1 position
After00011010

Discarded: 0. Inserted: 1 zero. Green cells show the inserted zeros.

Start with 00001101, representing 13. Every bit moves one column left, so the rightmost position receives a 0.

00001101₂ = 13₁₀
00011010₂ = 26₁₀
13 × 2 = 26

The discarded leftmost bit is 0, so no significant value is lost. Each retained 1 moves to a place worth twice as much.

03 | LEFT SHIFT BY SEVERAL POSITIONS

13 shifted left twice becomes 52
Row1286432168421
Before00001101
Move left← 2 positions
After00110100

Discarded: 00. Inserted: 2 zeros. Green cells show the inserted zeros.

Two left shifts multiply by 2 twice: ×4. Three multiply by 8. In general, a left shift of n positions multiplies by 2ⁿ, provided no significant 1 bits are lost.

13 × 2² = 13 × 4 = 52
00001101 → 00110100

“Left two” means multiply by four when it fits, not add two or multiply by two.

04 | RIGHT SHIFT BY ONE POSITION

44 shifted right once becomes 22
Row1286432168421
Before00101100
Move right→ 1 position
After00010110

Discarded: 0. Inserted: 1 zero. Green cells show the inserted zeros.

Every bit moves one column right. A 0 enters on the left and the old rightmost bit is discarded.

00101100₂ = 44₁₀
00010110₂ = 22₁₀
44 ÷ 2 = 22

Here the discarded bit is 0, so the division gives an exact whole-number result.

05 | RIGHT SHIFTS DISCARD FRACTIONAL PARTS

13 shifted right once becomes 6
Row1286432168421
Before00001101
Move right→ 1 position
After00000110

Discarded: 1. Inserted: 1 zero. Green cells show the inserted zeros.

13 ÷ 2 = 6.5, but an unsigned integer register does not retain the .5. The low bit representing the remainder is discarded, leaving 6.

43 shifted right twice becomes 10
Row1286432168421
Before00101011
Move right→ 2 positions
After00001010

Discarded: 11. Inserted: 2 zeros. Green cells show the inserted zeros.

43 ÷ 4 = 10.75. The two low bits 11 are lost and the retained result is 10. For this unsigned model, a right shift of n positions gives integer division by 2ⁿ, discarding any fractional part.

06 | LEFT SHIFTS CAN LOSE IMPORTANT BITS

193 shifted left once retains 130
Row1286432168421
Before11000001
Move left← 1 position
After10000010

Discarded: 1. Inserted: 1 zero. Green cells show the inserted zeros.

The leftmost 1 is discarded. The correct mathematical product is 193 × 2 = 386, which cannot fit in an unsigned 8-bit value.

Full product: 386₁₀ = 110000010₂ (9 bits)
Retained bits: 10000010₂ = 130₁₀

Do not say that this shift correctly multiplies the retained value by two. It attempted that effect, but the fixed-width result lost a significant bit.

For an unsigned 8-bit value, a one-position left shift fits exactly only when the original value is at most 127. For two positions the maximum is 63.

07 | LOST ZEROS AND LOST ONES ARE DIFFERENT

Every shift can discard edge bits. Losing a leading zero on a left shift does not change the expected product; losing a leading 1 does.

A right shift can discard remainder information. If you shift back afterwards, you may not recover the original pattern.

13: 00001101
Right 1 → 00000110 (6)
Left 1  → 00001100 (12), not 13

The lost bit is not stored somewhere inside the result waiting to be restored. Explain what leaves the register and where the new zeros enter.

08 | TRY IT: SHIFT AN EIGHT-BIT PATTERN

Predict the result, then check it. The diagram keeps the original and shifted bytes horizontal and highlights inserted zeros.

09 | ANSWER WITH THE PATTERN AND THE REASON

  1. Identify direction and number of positions.
  2. Move the bits, preserving the eight-bit width.
  3. Insert zeros at the correct edge.
  4. Record bits discarded at the other edge.
  5. State the retained binary and denary values.
  6. Explain multiplication, integer division or lost significant bits.

Keep your place values aligned. Never simply add zeros to make a nine- or ten-bit answer when the question specifies an 8-bit register.

PRACTISE | SHIFT WITHOUT THE CHECKER

Complete the activities, then use the Questions tab for independent practice.

SHIFT MACHINE

Enter your answers. Binary patterns must keep the requested width; spaces and hex letter case are accepted.

MATCH THE TERMINOLOGY

Choose the term that matches each description.

Terminology

Terminology

Logical left shift

Move bits left, insert zeros at the right, discard bits beyond the left edge.

Logical right shift

Move bits right, insert zeros at the left, discard bits beyond the right edge.

Most significant bit

The bit with the greatest place-value magnitude.

Least significant bit

The rightmost bit, with place value 1.

Integer division

Division that discards the fractional part for positive values.

Lost bits

Bits moved beyond the fixed width and discarded.

Questions

Questions

APPLY YOUR SKILLS

Enter your answers. Binary patterns must keep the requested width; spaces and hex letter case are accepted.

TICK-BOX QUIZ

Select all correct choices. Each exact set earns one point.

1. What enters the right side during a logical left shift?
2. A left shift by 3 places, with no significant bits lost, multiplies by what?
3. What is 13 after a logical right shift by 1?
4. Which statements are correct?
5. Which is 00010000 shifted right by 2?
6. Can the opposite shift always restore the original?

WRITTEN QUESTIONS

Answer in your book first. These are practice questions and suggested answers, not official exam questions or mark schemes.

1. Shift 00101010 left by two places. Give binary and denary answers. [2 marks]

2. Shift 00101011 right by two places. Explain the result. [3 marks]

3. Explain why 10000001 shifted left once does not give 258. [2 marks]

4. Explain the effect of a three-place logical shift. [2 marks]

Flashcards

Flashcards

Click a card to flip it. Tick the cards you need to revisit.

0 cards selected for revision.

    Selections are kept while this page is open.

    Workbook

    Workbook

    A place to practise, explain and apply your learning.

    COMING SOON

    The workbook for 1.1.5 Binary Shifts is coming soon. For now, use the Questions tab and write your answers in your exercise book.