How to Subtract Unsigned Numbers Using (r-1)'s Complement

What is an Unsigned Number?

An unsigned number is a number that does not inherently store information about its sign (positivity or negativity). Instead, external symbols like “\(\mathsf{+}\)” or “\(\mathsf{-}\)” are used to indicate the sign. If no symbol is provided, the number is assumed to be positive by default.

How to Subtract Unsigned Numbers Using the Diminished Radix Complement Method

The diminished radix complement method converts subtraction into addition, simplifying the process, especially in digital systems. The general approach is to add the complement of the subtrahend to the minuend. Here’s a step-by-step guide for a number system with radix (base) r:

  1. Make sure that the minuend and the subtrahend have the same number of digits; if not, pad 0s to the left to make them equal.
  2. Compute the diminished radix (r-1)‘s complement of the subtrahend.
    • The (r-1)’s complement is obtained by subtracting each digit of the subtrahend from (r-1).
  3. Add this complement to the minuend. The result may or may not produce an end-carry (overflow) bit.
    • If there is an end-carry, discard it. Add 1 to the result to get the positive difference.
    • If there is no end-carry, the result is negative. Compute the diminished radix complement of this sum again to find the magnitude, and prefix it with a “\(\mathsf{-}\)” symbol. This occurs when the minuend is smaller than the subtrahend.

Examples of Subtraction Using Diminished Radix Complement in Different Number Systems

In the following subsections, we explore diminished radix complement subtraction in the decimal (10’s complement) and binary (2’s complement) number systems. We’ll outline the general steps for each base and provide multiple worked examples.