Number Systems: Question 10
Syllabus 1.1
An audio mixing desk stores a channel's volume level as an 8-bit unsigned binary number in a register. To double the volume, the mixer's firmware applies a logical left shift of 1 place to the register.
(a) The register currently holds 01100101. Apply a logical left shift of 1 place. State the new value of the register in binary, and give a denary check of your answer. Show your working. [3]
(b) The firmware then applies a second logical left shift of 1 place, to the result from part (a). State the new value of the register in binary, and state what happens to any bit that is shifted off the left-hand end of the register. [3]
(c) Explain why the shift in part (b) does not correctly double the volume level a second time, even though a logical left shift normally corresponds to multiplying by 2. [2]
Show worked solution Hide worked solution
Worked solution
Part (a): First logical left shift of 1 place
Original register (bit 7 down to bit 0): 0 1 1 0 0 1 0 1
A logical left shift of 1 place drops the leftmost bit, moves every remaining bit one place to the left, and fills the new rightmost position with a 0.
- Drop the leftmost bit (
0) - Remaining bits:
1 1 0 0 1 0 1 - Fill a 0 on the right:
1100101+0=11001010
So the register now holds 11001010. [1 mark]
Denary check: 01100101 = 64 + 32 + 4 + 1 = 101. A logical left shift of 1 place multiplies by 2: 101 x 2 = 202. 11001010 = 128 + 64 + 8 + 2 = 202, which matches. [2 marks]: [1] for the correct original denary value (101), [1] for the correctly doubled and verified result (202).
Part (b): Second logical left shift of 1 place
This shift is applied to the result of part (a), 11001010, not the original register.
- Drop the leftmost bit (
1) - Remaining bits:
1 0 0 1 0 1 0 - Fill a 0 on the right:
1001010+0=10010100
So the register now holds 10010100. [1 mark]
The bit that was shifted off the left-hand end was a 1. In a logical shift, this bit is simply discarded (lost). It does not wrap around to the right-hand end of the register, and it cannot be recovered from the register afterwards. [2 marks]: [1] for the correct new binary value, [1] for correctly identifying that the discarded bit is a 1 which is permanently lost, not rotated.
Denary check: 11001010 = 202, and 202 x 2 = 404. Since 404 is greater than 255, it cannot fit in 8 bits: 404 - 256 = 148, and 10010100 = 128 + 16 + 4 = 148, which matches.
Part (c): Why the volume is not correctly doubled
A logical left shift by 1 place is only equivalent to correctly doubling the stored value when the true doubled result still fits within 8 bits (i.e. is 255 or less). After part (a), the register held 202. Doubling 202 gives the true value 404, but an 8-bit register can only hold values from 0 to 255. Because 404 needs 9 bits to represent exactly, the leading bit (worth 256) is shifted off the left-hand end and lost during the shift in part (b), leaving only the lowest 8 bits: 404 - 256 = 148.
So the register ends up storing 148, not 404. The represented volume level is no longer double the value from part (a), because part of the true result could not fit inside the register’s fixed 8-bit width and was permanently discarded. [2 marks]: [1] for identifying that the true value (404) exceeds what 8 bits can hold, [1] for linking this to the lost leading bit causing the incorrect stored result.
Final answers
- (a)
01100101shifted left 1 =11001010(denary 202) - (b)
11001010shifted left 1 =10010100(denary 148); the 1 bit shifted off the left end is discarded, not wrapped around - (c) The true doubled value (404) needs 9 bits, so the leading bit is lost in the 8-bit register, and the stored result (148) no longer represents double the volume level