Representing a signed number with 2's complement is done by adding 1 to the 1's complement representation of the number. To illustrate, let's look at the same example we used for 1's complement. How can we represent the number -510 in 2's complement using 4-bits?

  1. First, we write the positive value of the number in binary.
 0101 (+5)
  1. Next, we reverse each bit to get the 1's complement.
 1010
  1. Last, we add 1 to the number.
 1011 (-5)



To the right is a table of 4-bit binary numbers in 2's complement notation. Comparing these values with our 1's complement table, we see that both representations use the most significant bit to represent the sign. We also notice that we only have one way to represent 0 in 2's complement. This is an advantage because it simplifies representation of signed numbers. As with 1's complement, only negative values need to be complemented in 2's complement. The positive values are the same as the normal binary numbers. You should verify for yourself that the negative values are correct by using the steps below to produce this table.

Binary

0111
0110
0101
0100
0011
0010
0001
0000
1111
1110
1101
1100
1011
1010
1001
1000

Decimal

+7
+6
+5
+4
+3
+2
+1
+0
-1
-2
-3
-4
-5
-6
-7
-8


Here is a quick summary of how to find the 2's complement representation of any decimal number x. Notice the first three steps are the same as 1's complement.

  1. If x is positive, simply convert x to binary.
  2. If x is negative, write the positive value of x in binary
  3. Reverse each bit.
  4. Add 1 to the complemented number.