In an arithmetic right shift, each bit in a binary number is shifted to the right by a specified number of . The leftmost bit (the sign bit) is replicated to fill the vacated . If the number is positive, are shifted in from the left. If the number is negative, are shifted in from the left. Arithmetic right shifts are commonly used for 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 . The leftmost bit is (shifted out) and zeros are shifted in from the right. Arithmetic left shifts are commonly used for by powers of two in signed integer arithmetic.
For example, consider the original binary number 1101 (decimal -3). After an arithmetic right shift by 1, it becomes (decimal -2). Conversely, if we perform an arithmetic left shift on 1101 by 1, it results in (decimal -6).