Edexcel GCSE Computer Science (1CP2) · Data › Binary
Practise Logical and arithmetic shifts. 11 exam-style questions plus unlimited generated ones on this subtopic, at up to four difficulty levels, with full mark schemes and a progress tracker. Free, no account needed.
Cover the answers and test yourself. The app has these as flashcards that come back just before you'd forget them.
Give the result of a logical shift left by 2 places on the 8-bit binary number 0000 1101.
0011 0100
A program uses a binary shift to divide 8-bit unsigned integers by 8. State the type of shift and the number of places needed.
A logical shift right by 3 places
State the denary value of the register before and after the shift.
Before: 3; after: 6
A logical shift right by 2 places is applied to the 8-bit unsigned binary value 0110 1000. Give the 8-bit result of the shift.
0001 1010
Sample questions
Written for this site in the style of Edexcel exam questions. They are not taken from real past papers.
Question 1Easy3 marks
(a) Identify the description of a logical shift left by one place.[1]
Each bit moves one place to the left and a 0 is added on the right
Each bit moves one place to the right and a 0 is added on the left
Each bit is changed from 0 to 1 or from 1 to 0
The most significant bit is copied into the empty position
(b) Give the result of a logical shift left by 2 places on the 8-bit binary number 0000 1101.[1]
(c) State the effect of the shift in part (b) on the denary value of the number.[1]
Show the answer and mark scheme
(a)Answer: Each bit moves one place to the left and a 0 is added on the right
(b)Answer: 0011 0100
0011 0100
(c)Answer: It is multiplied by 4 (13 → 52).
it is multiplied by 4 (13 becomes 52)
Question 2Medium4 marks
A program uses a binary shift to divide 8-bit unsigned integers by 8.
(a) State the type of shift and the number of places needed.[2]
(b) Give the result of applying this shift to 0110 1111.[1]
(c) 0110 1111 represents 111. State why the result of the shift is not exactly 111 ÷ 8.[1]
Show the answer and mark scheme
(a)Answer: A logical shift right by 3 places
logical shift right
(by) 3 places
(b)Answer: 0000 1101
0000 1101
(c)Answer: 111 ÷ 8 = 13.875; the bits shifted out on the right are lost, so the result is rounded down to 13.
111 ÷ 8 = 13.875, but the three bits shifted off the right-hand end are lost, so the result is rounded down to 13 / precision is lost
Question 3Hard4 marks
Explain the difference between a logical shift right and an arithmetic shift right. Use the 8-bit two's complement integer 1100 1000 (−56) to illustrate your answer.[4]
Show the answer and mark scheme
Answer: Logical: 0s enter on the left → 0110 0100 = +100 (sign lost). Arithmetic: the sign bit is copied → 1110 0100 = −28 (correctly halved).
a logical shift right fills the empty positions on the left with 0s
an arithmetic shift right fills them with copies of the sign bit (the most significant bit)
a logical shift right by 1 place gives 0110 0100, which is +100, so the sign has changed / the value is wrong
an arithmetic shift right by 1 place gives 1110 0100, which is −28, so the number has been halved and stays negative
so an arithmetic shift is used to divide two's complement (signed) integers by powers of 2