Multiple shifts

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Multiple shifts

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Logical left shift 00001011 by 2 places. What is the result?
A 00000010
B 00101100
2. Logical right shift 11010000 by 3 places. What is the result?
A 00011010
B 01101000
3. Logical left shift 10110101 by 3 places. What is the result?
A 10101000
B 00010110
4. A left shift by 3 places on an 8-bit value does what?
A Loses 3 bits from the left end and adds 3 zeros on the right
B Loses 3 bits from the right end and adds 3 zeros on the left
5. Logical right shift 00000011 by 2 places. What is the result?
A 00000011
B 00000000

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
100001011 shifted left 3 places AThe two leftmost bits (10) were lost, but the 2 bits added on the right were 1s in the wrong places. Added bits must be 0s, so the answer is 11001100 only if the shift is done correctly: the correct result is 11001100, so the error is keeping the lost bits instead of dropping them.
211010110 shifted right 2 places B00110101: every bit moves 2 places right, the 2 rightmost bits (10) are lost and 2 zeros are added on the left
3Shifting an 8-bit number left by 3 places moves each bit 3 positions and adds three 0s at the right-hand end C01011000: every bit moves 3 places left, the 3 leftmost 0s are lost and 3 zeros are added on the right
4Shifting all 8 bits out of an 8-bit register leaves only zeros D00000101 -> 00101000
510110011 shifted left 2 places = 11001100 EZeros must be added on the left, not 1s, and the 3 rightmost bits are lost. The correct result is 00001101.
601101100 shifted right 3 places = 11101101 F11111111 shifted right 8 places = 00000000

Definitions

shift n places

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
Left shift 2: 00000111 becomes ________
2.
Left shift by 3 adds _ zeros on the right
3.
_____ shift 2: 10110100 becomes 00101101
4.
Left shift _: 10110011 becomes 00000000
5.
Right shift 3: 00011000 becomes ________

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A Value: 00001101
B Operation: left shift by 2
C Lose 2 leftmost bits: 00
D Add 2 zeros on left: 00110100
Question 2
A Start: 10110100
B Right shift 3: 00101101
C Lost 3 bits: 100 (from right)
Question 3
A Right shift by 3 places
B Start: 00010111
C Lose 3 bits from the left: 000
D Result: 10111000
Question 4
A Start: 01101011
B Left shift by 4 places
C All 8 bits are lost
D Result: 00000000
Question 5
A Start: 11001110
B Right shift by 2 places
C Result: 11110011
D Lost bits: 10

Answer Key

Multiple shifts
Section A: Quick Questions
Q1
B — 00101100
Q2
A — 00011010
Q3
A — 10101000
Q4
A — Loses 3 bits from the left end and adds 3 zeros on the right
Q5
B — 00000000
Section B: Match the Pairs
Q1
00001011 shifted left 3 places → 01011000: every bit moves 3 places left, the 3 leftmost 0s are lost and 3 zeros are added on the right
Q2
11010110 shifted right 2 places → 00110101: every bit moves 2 places right, the 2 rightmost bits (10) are lost and 2 zeros are added on the left
Q3
Shifting an 8-bit number left by 3 places moves each bit 3 positions and adds three 0s at the right-hand end → 00000101 -> 00101000
Q4
Shifting all 8 bits out of an 8-bit register leaves only zeros → 11111111 shifted right 8 places = 00000000
Q5
10110011 shifted left 2 places = 11001100 → The two leftmost bits (10) were lost, but the 2 bits added on the right were 1s in the wrong places. Added bits must be 0s, so the answer is 11001100 only if the shift is done correctly: the correct result is 11001100, so the error is keeping the lost bits instead of dropping them.
Q6
01101100 shifted right 3 places = 11101101 → Zeros must be added on the left, not 1s, and the 3 rightmost bits are lost. The correct result is 00001101.
Section C: Definitions
Q1
shift n places — Shifting by n places moves every bit n positions, losing n bits at one end and adding n zeros at the other. Shift all 8 bits out and you get 00000000.
Section D: Fill in the Blanks
Q1
Left shift 2: 00000111 becomes 00011100
Q2
Left shift by 3 adds 3 zeros on the right
Q3
Right shift 2: 10110100 becomes 00101101
Q4
Left shift 8: 10110011 becomes 00000000
Q5
Right shift 3: 00011000 becomes 00000011
Section E: Spot the Error
Q1
D — In a left shift the bits that are lost come off the left, so the new zeros are added on the right, not the left. It should read: Add 2 zeros on right: 00110100.
Q2
B — 00101101 is the result of shifting right by only 2 places. Shifting right by 3 moves every bit 3 places, giving 00010110.
Q3
A — The working loses bits from the left and the result 10111000 is a left shift. The first line should say Left shift by 3 places.
Q4
B — Only a shift of 8 places pushes all 8 bits out of an 8-bit register. A shift by 4 would leave 4 of the original bits behind. It should say Left shift by 8 places.
Q5
C — A logical right shift adds zeros on the left, never ones. Shifting 11001110 right by 2 gives 00110011.