Here is a right arithmetic shift calculator. Enter a number to convert to 32 bit binary, plus the number of spaces to shift to the right, and the tool will return the result after the arithmetic shift.
With an arithmetic shift, the sign of the number is preserved, see the right logical shift calculator to shift all digits and add leading zeroes.
Right Arithmetic Shift Calculator
Using the Right Arithmetic Shift Calculator
To use the right arithmetic shift calculator, enter a number to shift right in the "Number to Shift" field in the tool. Then, in the "Steps" field, enter how many digits to shift the number to the right.
Once happy with the inputs, click the "Calculate Right Arithmetic Shift" button.
The result of the shift will show up in the "Shifted Number" field, already converted to integer:
Right Arithmetic Shift Example
Behind the scenes, the tool converts the number to a 32-bit binary number, then shifts it right the number of spaces you'd like to move. Let's walk through the screenshotted example a step at a time to see how it works:
4 >> 2 = 1\\(steps)\\ 100\ (4) >>2=\\ 010\ (2)>>1=\\ 001\ (1)
In an arithmetic shift, you preserve the first binary digit. That is, if you have a negative number, you will maintain a negative because the shift preserves the 1 at the front of the number's two's complement representation. With a right logical shift, you will have 0s substituted up front so all numbers will become positive (or stay positive).
Other Binary Calculator
Try our other binary math calculators: