The table below shows several alternative 4-bit binary representations for signed integers. Four bits can only represent 16 different numbers, so each encoding attempts to allocate approximately half of the bit patterns for positive and half for negative numbers. Depending on the encoding method chosen, one or both of plus and minus eight may not be representable in the encoding. Some encodings end up with two different encodings for the number zero.
In signed-magnitude representations, the sign bit indicates if the number is positive or negative and the remaining bits indicate the value, e.g. 0101 is +5 and 1101 is -5. This method produces both a plus and minus zero, and in four bits neither plus nor minus eight can be represented. Math only works for positive numbers. (Adding one to a negative number incorrectly makes it more negative!)
In ones-complement representations, all the bits are simply complemented to produce the number of the opposite sign. This method also produces both a plus and minus zero, and in four bits neither plus nor minus eight can be represented. Math works for both all-positive and all-negative numbers, but not if the result has to cross the zeroes. (For example, 6 minus 7 incorrectly gives a result of minus zero, not minus one.)
Twos complement is similar to ones-complement, except that the duplicate zeros have been eliminated by adding one after doing the ones-complement. If you consider zero as a positive number, then twos-complement has an equal number of positive and negative numbers, and you cannot represent the most negative number as a positive number since zero takes up one of the positive bit patterns. Math works for all numbers in the range. You cannot sort twos-complement numbers using an unsigned sort. (If you try, all the negative numbers sort greater than all the positive numbers!)
In biased or excess representations, the encoded value C = V + B, where C is the 4-bit encoded value, V is the signed value to be encoded, and B is the bias to be added to make the encoded value into a positive number that can be encoded using unsigned binary notation. To convert a biased number back to decimal, turn the encoded unsigned binary value into a positive decimal number and then subtract the bias: V = C - B The choice of bias determines where the split lies between positive and negative numbers; even asymmetric splits are possible, e.g. the +7 bias below generates nine positive numbers and only seven negative. Math doesn't work at all for bias/excess encodings, though you can add and subtract unsigned binary numbers from biased numbers correctly throughout their full range. You can sort biased/excess numbers using an unsigned integer sort routine, which is why you can sort IEEE floating-point numbers using an integer sort, since the exponent field uses biased format. References: Offset Binary, Excess-n
Only the twos-complement encoding works with binary addition and subtraction throughout the full range, where adding or subtracting one (or more) gives you the correct answer (as long as you stay in range). Ones-complement math works except around and across zero, and signed-magnitude math only works for positive numbers. As noted above, you can't do any math with biased/excess numbers, unless you stick to adding/subtracting unsigned binary numbers.