Work out two complement instantly with clear inputs, formula shown and shareable results.
Two's complement stores a negative value as 2^w + v, so subtraction becomes ordinary addition and there is a single representation of zero. The top bit acts as the sign bit.
Two's complement
for v < 0 the stored pattern is 2^w + v; range is −2^(w−1) to 2^(w−1) − 1
256 − 42 = 214, which is 11010110.
It avoids a negative zero and lets the same adder circuit handle both signed and unsigned arithmetic.