When a register is shifted right, the bits that fall off the end are simply thrown away. The effect on the value is rounding down, toward −∞ (also called the floor).
For non-negative numbers, rounding down and rounding toward zero agree:
- 7 → 3 (7 ÷ 2 = 3.5, rounded down).
- 13 → 6.
For negative numbers they differ. An arithmetic shift right rounds toward −∞, so negative odd numbers go further from zero:
- −7 → −4, not −3 (−3.5 rounded down).
- −5 → −3, not −2.
- −1 → −1, not 0. Shifting
1111arithmetically gives1111again.
Why: in two's complement, discarding the low bits always subtracts their (non-negative) contribution, so the value can only move down.
This matters in practice. Many programming languages define integer division as rounding toward zero, so a compiler cannot always replace x / 2 by an arithmetic shift for signed x; it adds a correction for negative values first.
The safe method: do the shift on the bits, then decode the result. Don't guess it from decimal division.