Sign extension makes a twos complement number wider without changing its value: copy the MSB into every new bit on the left.
- 4-bit
0101(+5) → 8-bit00000101(+5) - 4-bit
1101(−3) → 8-bit11111101(−3)
Why it works: in 4 bits the MSB of 1101 is worth −8. In 8 bits the new MSB is worth −128, and the copied 1s below it add 64 + 32 + 16 + 8 = 120. Together they make −128 + 120 = −8, exactly the old MSB's weight. The other bits are untouched, so the value is unchanged.
On the counter picture, −3 is "three steps back from zero" at any width: 1101 in 4 bits, 11111101 in 8 bits.
In hex, look at the top digit. If it's 8–F (MSB 1), pad with F's. If it's 0–7, pad with 0's. So 8-bit 9E₁₆ becomes FF9E₁₆, and 5A₁₆ becomes 005A₁₆.
Where it shows up: loading a signed byte into a 32-bit register, or adding numbers of different widths. Unsigned values are widened with zeros instead (zero extension), so processors usually have a signed and an unsigned version of each narrow load.