Two's Complement: Signed vs Unsigned
The same bits mean 200 unsigned and -56 signed. Toggle them, walk the number wheel where 127 wraps to -128, and negate a value by flipping every bit and adding one.
Two's Complement: Signed vs Unsigned
A register holds nothing but bits. Whether a pattern means a small positive number or a large negative one depends entirely on how you decide to read it. Two's complement is the convention that lets the same adder serve both readings, gives zero a single encoding, and turns the top bit into a negative place value.
All 256 patterns laid out in a ring, counting up clockwise from 0 at the top. The pointer sits at the current pattern. Increment past the bottom and the unsigned reading wraps from 255 back to 0 while the signed reading wraps from 127 to -128. Both wraps happen at the same physical place: that is arithmetic modulo 28.
To negate a two's complement number you invert every bit, then add one. This works because a number plus its bitwise complement is all ones, which is -1 in signed terms, so adding one lands on exactly -1 times the original. Watch it on the current value.
The processor adds the bit patterns and keeps the low 8 bits. If the true signed sum falls outside [-128, 127] the result wraps and the sign flips the wrong way. That is signed overflow.
One zero, and addition that just works. Sign-magnitude and ones' complement both waste a pattern on negative zero. Two's complement has a single zero, and the same binary adder gives the right answer for signed and unsigned alike, because it is really addition modulo 28.
The sign bit is a negative place value. Reading signed, the top bit is not a flag bolted on the side, it contributes -2⁷. Set it alone and you get the most negative number; the lower bits then only ever add back toward zero.
One more negative than positive. The range is [-128, 127], asymmetric by one. There is a pattern for -128 but none for 128, which is why negating the most negative value lands back on itself and is the classic overflow trap.
The bit math: masking to 8 bits, sign extension from the top bit, and addition modulo 28 = 256.