9 Negative values

How does two's-complement has anything to do with negative values?

We'll use two's-complement as the negation operator in the limited scope of fixed-width binary operations. For a fixed width of 4 bits, this is what it means:

So far, so good. You should work out the cases for 3, 4, 5 and 6, just to get some practice.

How about 8? This is tricky, because $c_2(1000_2) = 1000_2$. In other words, if we choose $1000_2$ to represent positive 8, -8 has exactly the same representation. Each bit pattern can only represent one value. How should we choose, then?

Looking at the table, all the negative values (-1 to -7) has a most significant (leftmost) bit of 1. Using this convension, $1000_2$ should represent -8, and not 8.

In general, given $n$ bits, in signed interpretation, the most positive value is $2^{n-1}-1$, whereas the most negative value is $-2^{n-1}$.

Copyright © 2006-08-21 by Tak Auyeung