Practical guide and verification
Bit width is part of the value
Two’s-complement interpretation depends on a fixed bit width. The same hex or binary pattern can represent a different signed number when interpreted with a different number of bits.
Positive and negative ranges
An n-bit signed two’s-complement integer ranges from −2^(n−1) through 2^(n−1)−1. The asymmetry means the most negative value has no positive counterpart in the same width.
Common mistake
Do not invert bits and add one without first fixing the width. Leading zeros or ones are significant when you are representing a finite-width signed integer.