Subtraction using r's Complement

In the usual method of subtraction when we subtract a number we may have to borrow from the other. But this conventional method is not a success with digital computer. The 2’s complement method does away with borrowing and hence is easy to evaluate subtraction this way. The 2’s complement method is described as follows: (suppose we have to perform S-T).

  1. Add the r’s complement of T to S.
  2. If an end carry occurs  (in the result of step 1), discard it, otherwise take the r’s complement of the number obtained in step 1 and place a negative sign before it.

Example

Using 10’s complement subtract 5432 from 7345.

Here S = 7342 and T = 5432

10’s complement of T=

7345 + 4568=11913

discard the end carry

Hence S-T=1913