Now let's consider how we would solve our problem of subtracting 110 from 710 using 2's complement.
  1. First, we need to convert 00012 to its negative equivalent in 2's complement.
    0111    (7)
  - 0001  - (1)
  1. To do this we change all the 1's to 0's and 0's to 1's and add one to the number. Notice that the most-significant digit is now 1 since the number is negative.
  0001 -> 1110
             1
          1111
  1. Next, we add the negative value we computed to 01112. This gives us a result of 101102.
    0111    (7)
  + 1111  +(-1)
   10110    (?)
  1. Notice that our addition caused an overflow bit. Whenever we have an overflow bit in 2's complement, we discard the extra bit. This gives us a final answer of 01102 (or 610).
    0111    (7)
  - 0001  - (1)
    0110    (6)

The animation below demonstrates how to subtract the 5-bit binary numbers 011012 and 010012 using 2's complement representation. Click on the "Start Tutorial" button to view the animation.


Text-only version

Let's review the steps for subtracting x from y with an n-bit 2's complement representation.

  1. Negate x using 2's complement.
    1. Reverse all the bits in x.
    2. Add 1 to form -x.
  2. Add -x and y.
  3. Discard any bits greater than n.

Now go back and compare these steps with the steps for 1's complement subtraction. Notice that with 1's complement, you must check for an overflow bit each time you perform a subtraction. If the result has an overflow, you need to add the extra bit to your result to obtain the correct answer. However, with 2's complement, we only need to ignore this extra bit. No other computations are required to find the correct answer. This makes 2's complement a more efficient way of representing signed numbers and performing binary subtraction.