Worked example 1
An 8-bit register contains the binary value 00110101. What is the result, in binary and denary, after applying: a) LSL 2, b) LSR 3?
Show solution outline
The original value 00110101 is in denary.
a) LSL 2 (Logical Shift Left by 2):
- Original: 00110101
- Shift 1: 01101010 (The leading 0 is discarded, a 0 is added at the end)
- Shift 2: 11010100 (The leading 0 is discarded, a 0 is added at the end)
- Result (Binary): 11010100
- Result (Denary): .
- Check: . The calculation is correct.
b) LSR 3 (Logical Shift Right by 3):
- Original: 00110101
- Shift 1: 00011010 (The trailing 1 is discarded, a 0 is added at the start)
- Shift 2: 00001101 (The trailing 0 is discarded, a 0 is added at the start)
- Shift 3: 00000110 (The trailing 1 is discarded, a 0 is added at the start)
- Result (Binary): 00000110
- Result (Denary): .
- Check: with a remainder of 5. This is correct for integer division.