Arithmetic Shift (Glossary Entry)

The arithmetic shift is similar to the logical shift except in the case of the most significant bit. It only differs from the logical shift when applied to signed integers.

For signed integers, a right arithmetic shift will push in a copy of the sign (most significant) bit. The sign bit is duplicated and pushed into the right hand side as shown below:

Arithmetic Right Shift applied to a negative integer

For positive numbers, the same is done, and is equivalent to a logical right shift:

Arithmetic Right Shift on a positive signed integer

A left arithmetic shift will maintain the sign (most significant) bit. A shown below,  a zero is not shifted into the most significant bit position as this would change the sign. The value pushed into the least significant bit position is 0.

Arithmetic Left Shift on a negative integer

Numerically, the right arithmetic shift will divide a 2‘s compliment number by 2 irrespective of polarity. Similarly, the left arithmetic shift will multiply a 2‘s compliment number by 2 irrespective of polarity.