In an arithmetic right shift, each bit in a binary number is shifted to the right by a specified number of positions. The leftmost bit (the bit) is replicated to fill the vacated positions. If the number is , zeros are shifted in from the left. If the number is negative, ones are shifted in from the left. Arithmetic right shifts are commonly used for division by powers of two in signed integer arithmetic.
In an arithmetic left shift, each bit in a binary number is shifted to the left by a specified number of positions. The leftmost bit is lost (shifted out) and are shifted in from the right. Arithmetic left shifts are commonly used for multiplication by powers of two in signed integer arithmetic.
For example, the original number 1101 (decimal -3) after an arithmetic right shift by 1 becomes 1110 (decimal -2), while after an arithmetic left shift by 1 it becomes 1010 (decimal -6). In a logical shift, zeros are filled in the vacated positions on the , and the sign bit is treated as just another bit. In contrast, in an arithmetic right shift, the sign bit is preserved, allowing the representation of negative values to be maintained.