## Shifting bits: Microcontrollers have instructions to shift bits. All bits are simultaneously shifted either to the right or left.

## Instructions may rotate the bits through a condition code flag such as carry.

## A one-bit left shift doubles a value and a one-bit right shift halves a value.

The term arithmetic shift refers to a shift instruction that moves the sign bit into the vacated bit position on a right shift and moves a zero into the vacated bit position on a left shift. This instruction can maintain sign when using 2’s complement numbers.

The term rotate refers to rotating bits of a register, that is on a left rotate all bits shift left with the most significant bit rotating to the least significant bit position. On a right rotate the least significant bit would rotate to the most significant bit position. The rotated bits may also rotate through the a condition code flag such as carry.