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
. In other
words, if we choose
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,
should represent -8, and not 8.
In general, given bits, in signed interpretation, the
most positive value is
, whereas the most negative
value is
.