Logical right shift

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

Logical right shift

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Logical right shift of 8-bit 11001100 by one place gives:
A 01100110
B 10011001
2. What fills the empty space on the left after a logical right shift?
A A copy of the bit that fell off
B A 0
3. What happens to the bit that falls off the right end during a logical right shift?
A It is lost
B It wraps round to the left end
4. Logical right shift of 00010111 by one place gives:
A 10001011
B 00001011
5. Which statement describes a logical right shift of one place on a positive 8-bit integer?
A Its value is halved, rounded down
B Its value is doubled

Match the Pairs

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

Left columnRight column
100101100 >> 1 = 00010110 AThe right-most 1 is lost off the end, and a 0 is added at the left.
200010111 >> 1 = 00001011 BA logical right shift of one place on an 8-bit value: every bit moves right and a 0 enters on the left.
3Zeros come in on the left: shifting 10000000 right by one place gives a leading 0 at the left CThe bit that falls off the right end is lost and not stored or kept anywhere.
4Shifting a positive 8-bit integer right by one place halves its value, rounded down D10000000 >> 1 = 01000000
500110100 >> 1 = 10011010 EA 1 was put in the left end. A logical right shift always fills the empty left end with 0, so the answer should be 00011010.
600001010 >> 1 = 00000101 and the 0 on the right is stored in a spare box F00001001 >> 1 = 00000100

Definitions

logical right shift

Fill in the Blanks

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

1.
Before: 00001100 Logical right shift by 1 place After: ________
2.
Before: 10110000 Logical right shift by 1 place After: _0011000
3.
Before: 00001101 After: 00000110 Bit lost off the right end: _
4.
00001100 is 12 in denary After one right shift: 00000110 New denary value: _
5.
A logical _____ shift halves a positive integer, rounding down.

Spot the Error

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

Question 1
A Start: 00101100 (42)
B Shift right 1 place
C Bit lost: 0
D Result: 00010110 (22)
Question 2
A Start: 00001101 (13)
B Logical right shift by 1
C Bit lost: 1
D Fill on left: 1
E Result: 00000110 (6)
Question 3
A Start: 10000000 (128)
B Shift left 1 place
C New left bit: 0
D Result: 01000000 (64)
Question 4
A Start: 00000111 (7)
B Shift right 1 place
C Result: 00001110 (14)
D Bit lost: 1
Question 5
A Start: 00110100 (52)
B Shift right 2 places
C Bits lost: 00
D Result: 00001101 (26)

Answer Key

Logical right shift
Section A: Quick Questions
Q1
A — 01100110
Q2
B — A 0
Q3
A — It is lost
Q4
B — 00001011
Q5
A — Its value is halved, rounded down
Section B: Match the Pairs
Q1
00101100 >> 1 = 00010110 → A logical right shift of one place on an 8-bit value: every bit moves right and a 0 enters on the left.
Q2
00010111 >> 1 = 00001011 → The right-most 1 is lost off the end, and a 0 is added at the left.
Q3
Zeros come in on the left: shifting 10000000 right by one place gives a leading 0 at the left → 10000000 >> 1 = 01000000
Q4
Shifting a positive 8-bit integer right by one place halves its value, rounded down → 00001001 >> 1 = 00000100
Q5
00110100 >> 1 = 10011010 → A 1 was put in the left end. A logical right shift always fills the empty left end with 0, so the answer should be 00011010.
Q6
00001010 >> 1 = 00000101 and the 0 on the right is stored in a spare box → The bit that falls off the right end is lost and not stored or kept anywhere.
Section C: Definitions
Q1
logical right shift — Moves every bit one place right. The bit at the right end is lost and a 0 fills the empty left end. For a positive integer this halves the value (rounded down).
Section D: Fill in the Blanks
Q1
Before: 00001100 Logical right shift by 1 place After: 00000110
Q2
Before: 10110000 Logical right shift by 1 place After: 00011000
Q3
Before: 00001101 After: 00000110 Bit lost off the right end: 1
Q4
00001100 is 12 in denary After one right shift: 00000110 New denary value: 6
Q5
A logical right shift halves a positive integer, rounding down.
Section E: Spot the Error
Q1
A — 00101100 is 32 + 8 + 4 = 44, not 42. The start value must be 44 so that shifting right gives 22 (half of 44).
Q2
D — In a logical right shift the empty place on the left is always filled with 0, not 1. It should read 'Fill on left: 0'.
Q3
B — The question is about a right shift. The bits move one place right, so the line should be 'Shift right 1 place'. A left shift would give 00000000 and lose the 1.
Q4
C — 00001110 is what a left shift gives (it doubles the value). A right shift moves the bits right to give 00000011, which is 3.
Q5
D — 00001101 is 8 + 4 + 1 = 13. Shifting right 2 places divides 52 by 4, which gives 13, not 26. 26 would be a shift of only 1 place.