Encoding - Data types
Two's complement
Source: Wikipedia | Two's complement
Representing negative values in binary
| Binary value | Two's complement interpretation | Unsigned interpretation |
|---|---|---|
| 00000000 | 0 | 0 |
| 00000001 | 1 | 1 |
| ⋮ | ⋮ | ⋮ |
| 01111110 | 126 | 126 |
| 01111111 | 127 | 127 |
| 10000000 | −128 | 128 |
| 10000001 | −127 | 129 |
| 10000010 | −126 | 130 |
| ⋮ | ⋮ | ⋮ |
| 11111110 | −2 | 254 |
| 11111111 | −1 | 255 |