Right Logical Shift Calculator

Written by:
PK

Here is a right logical shift calculator or zero fill right 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 logical shift.

With a logical shift, the shift will leave leading zeroes and results are always positive, see the right arithmetic shift calculator to shift all digits and maintain sign.

Right Logical Shift Calculator

Using the Right Logical Shift Calculator

To use the right logical 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 Logical Shift" button.

The result will show up in the "Shifted Number" field, already shifted and converted to integer:

Right logical shift of 4 by 2 digits
Right logical shift of 2 digits for the number 4

Right Logical Shift Example

Behind the scenes, the tool is using a 32-bit binary number representation of your input. It then shifts it the number of spaces you'd like to move, adding a '0' to the front of the number (which will not preserve negative numbers - all results are positive).

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 a logical shift, you don't preserve the first binary digit, instead adding a 0. That is, if you have a negative number, you will now have a positive number because the leading '1' rolled off. Use the right arithmetic shift calculator to preserve sign.

Other Binary Calculator

Try our other binary math calculators:

      

PK

PK started DQYDJ in 2009 to research and discuss finance and investing and help answer financial questions. He's expanded DQYDJ to build visualizations, calculators, and interactive tools.

PK lives in New Hampshire with his wife, kids, and dog.

Don't Quit Your Day Job...

DQYDJ may be compensated by our partners if you make purchases through links. See our disclosures page. As an Amazon Associate we earn from qualifying purchases.
Sign Up For Emails
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram