Arithmetic Binary Shift
Arithmetic Binary Shift
Learning objectives
In this lesson you will learn to:
For more information about this topic and additional student activities
see Topic 2 of the student book.
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-02-P9: Arithmetic binary shifts
= 0 0 1 0 1 1 1 0 0 (decimal 46)
The Most Significant Bit (MSB) is shifted left, out of the pattern.
Each remaining bit is shifted left to the next location.
A new 0 is placed into the vacated location on the right (the Least Significant Bit - LSB).
This has the effect of multiplying by 2.
Left arithmetic shifting is the same as left logical shifting.
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-02-P9: Arithmetic binary shifts
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-02-P9: Arithmetic binary shifts
Signed integers
Let’s look at a signed integer and perform a left arithmetic shift of 3.
The signed integer is a two’s complement binary of -22:
1 1 1 0 1 0 1 0
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-02-P9: Arithmetic binary shifts
Overflow
We’ve looked at overflows before.
We’ve just seen the effect that overflows have when performing
shifts.
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-02-P9: Arithmetic binary shifts
Explain how an arithmetic shift right differs from a logical shift right.
• Arithmetic right shifting maintains the MSB and duplicates it in
every vacant position.
• Logical right shifting fills in with 0s on the left.
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.