arithmetic and logical shifts
A shift slides all the bits of a number sideways by some number of positions, like nudging a row of beads on an abacus left or right. New empty positions open up at one end and bits fall off the other. Shifting is cheap for the hardware and has a neat arithmetic meaning: shifting left by one position multiplies an unsigned number by 2, and shifting right by one divides it (roughly) by 2 — because every bit's place value either doubles or halves.
Left shifts are simple: bits move left, zeros fill in from the right, and a 0b0011 (3) shifted left by 1 becomes 0b0110 (6). Right shifts split into two flavours, and this is the crux. A logical shift right always fills the vacated top bits with 0; this is correct for unsigned numbers. An arithmetic shift right instead copies the sign bit into the top (the same idea as sign extension), so negative numbers stay negative; this is correct for signed numbers. For example, the 8-bit signed value -8 is 1111 1000; an arithmetic right shift by 1 gives 1111 1100 (-4, correct), whereas a logical right shift would give 0111 1100 (124, wrong for a signed value).
Shifts are used everywhere: to multiply or divide by powers of two quickly, to extract or pack fields of bits, and to build up the tag/index/offset slicing of an address. Two honest cautions: first, using shifts as fast multiply or divide only works for powers of two, and signed division by shifting rounds toward negative infinity, not toward zero, so -7 shifted right by 1 gives -4, not -3 as integer division would — a subtle correctness trap. Second, shifting by an amount as large as the word width or larger is undefined or unpredictable in many languages, so do not assume shifting a 32-bit value by 32 yields zero.
Logical vs arithmetic right shift of the 8-bit pattern 1111 1000: logical >> 1 = 0111 1100, but arithmetic >> 1 = 1111 1100. Read as signed, 1111 1000 is -8, and only the arithmetic shift gives the correct -4 (the logical one gives 124).
Right shift: logical fills with 0 (for unsigned), arithmetic copies the sign bit (for signed).
Shift-as-divide rounds toward negative infinity, not zero: -7 >> 1 gives -4, unlike integer division giving -3. Also, shifting by the word width or more is undefined in many languages.