Maths & numbers

Fixed-width logical bit shift calculator

Shift a word left or right within its specified width and see discarded high bits.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Shift a word left or right within its specified width and see discarded high bits.

THE FORMULALeft = (word × 2ˢ) mod 2ʷ, right = floor(word/2ˢ)

A worked example

150 shifted left twice in eight bits becomes 88. Shifting right twice gives 37.

Good to know

Logical right shift fills with zeros.

Read the result

Shift a word left or right within its specified width and see discarded high bits.

The primary result is labeled “Left shift”. Keep the input definitions in view when comparing this result with another method.

Try a related calculation

Logical right shift fills with zeros.

For a related exercise, try the greatest common divisor.

A few questions, answered

How can I check the default inputs by hand?

150 shifted left twice in eight bits becomes 88. Shifting right twice gives 37.

Which rule does this calculator apply?

Left = (word × 2ˢ) mod 2ʷ, right = floor(word/2ˢ)

Find your calculator

Start typing to explore the library.