| Integers: excess/bias | |||||||||||
| One disadvantage of 2C: | |||||||||||
| Can't sort values just using the bit representation. | |||||||||||
| Would look like negative numbers were greater than positive numbers. | |||||||||||
| Another idea: | |||||||||||
| Consider the unsigned values for a 3-bit representation | |||||||||||
| representation | value | ||||||||||
| 000 | 0 | ||||||||||
| 001 | 1 | ||||||||||
| 010 | 2 | ||||||||||
| 011 | 3 | ||||||||||
| 100 | 4 | ||||||||||
| 101 | 5 | ||||||||||
| 110 | 6 | ||||||||||
| 111 | 7 | ||||||||||
| Represent negative values, but keep the values in representation order | |||||||||||
| First half of the representations for negative, second half for positive | |||||||||||
| This is called excess, or biased, representation. | |||||||||||