Section 6.4: Converting 2's complement numbers (Frame 1)                     [     ][home][next]
The 2's complement form of a signed integer is one plus the 1's complement. That is, first get the 1's complement by flipping all the bits (changing 1s to 0s and 0s to 1s) and then add 1, using binary addition with carries.

Remember the following mantra:

Flip all the bits and add 1.

Like 1's complement, the number of bits must be fixed and you must pad out the number if it is too short. If the number is too long for your fixed size, then you can't represent it using 2's complement of that bit-width.