## Two’s complement and negative numbers

Two’s complement is a mathematical operation on binary numbers, and is an example of a radix complement. It is used in computing as a method of signed number representation.

The two’s complement of an N-bit number is defined as its complement with respect to 2N. For instance, for the three-bit number 010, the two’s complement is 110, because 010 + 110 = 1000. The two’s complement is calculated by inverting the digits and adding one.

Two’s complement is the most common method of representing signed integers on computers, and more generally, fixed point binary values. The two’s complement is a method for representing positive and negative integer values in binary. The useful part of two’s complement is that it automatically includes the sign bit.

The next example shows how use Two’s complement