Sign-magnitude, 1’s & 2’s complement
Enter an integer to see the three encodings
Representable ranges
| Encoding | Range | Negatives | Positives | Encoding of 0 |
|---|---|---|---|---|
| Sign-magnitude / One’s complement | -127 ~ +127 | 127 | 127 | +0 0000 0000−0 1000 0000 / 1111 1111 |
| Two’s complement | -128 ~ +127 | 128 | 127 | 0000 0000 |
| Excess / offset code | -128 ~ +127 | 128 | 127 | 1000 0000 |
| Unsigned | 0 ~ 255 | — | — | 0000 0000 |