The two's-complement scheme allows both positive and negative integers to be represented. The most significant bit of a two's-complement number is its sign bit. The sign bit is one for negative numbers and zero for positive numbers and for the number zero. The number of unique values that can be represented by the two's-complement scheme is two raised to the power of the total number of bits. Zero is 0x0000.
Positive numbers are intuitive in that they are merely the base two representation of the number.
Negative numbers can be calculated by adding the negative number to two raised to the power of the total number of bits. Addition is performed on two's-complement signed numbers in the same way it would be performed on unsigned binary numbers. The two numbers are added, overflow is ignored, and the result is interpreted as a signed two's-complement number. This will work as long as the result is actually within the range of valid values for the type. The result is actually 0x10002, but because there are only 16 bits in a short, the overflow is ignored and the result becomes 0x0002.