Shift Operations

Learn what shift operations are, and what they're used for.

Shift operations

Shift operations involve shifting the bits in a binary number to the left or right. Thus they are appropriately named right shift and left shift.

Left shift

Left shifting a binary number is equivalent to multiplying it with 22. A left shift is represented with <<.

To perform a left shift by 11 we:

  • Remove the most significant bit
  • Append a 00 as the least significant bit

For example:

00100010 << ...