## Introduction

Complements are used in digital computers for simplifying the manipulation of logical operations. Subtraction operation in binary can be simplified by using complements as signed binary numbers can be expressed using the complement.

Here, we will describe basic concepts of complements and its types.

Recommended Topic, __Microinstruction in Computer Architecture____ __and __Difference Between Jfet and Mosfet__

## Complements

There are two types of complements for each r-based number system. These are the radix complement and diminished radix complement.

Letâ€™s discuss each type of complement with examples.

**Diminished Radix Complement or (r-1)â€™s complement**

This complement is defined as if there is a number N in base r having n digits, the

Diminished Radix Complement or (r-1)â€™s complement of N is (r^n - 1) - N .

**Example**

So for a 6-digit decimal number( base 10) N, Diminished Radix Complement or (r-1)=9â€™s complement is (10^6 - 1) - N = 999999 - N

For, a 6-digit binary number N, (2-1)= 1â€™s complement is (2^6 - 1) - N = 111111 - N

So, 1â€™s complement of 101100 is (111111 - 101100) =010011

Also Read - __Shift Registers in Digital Electronics__

**Characteristic**

- While computing the Diminished Radix Complement, subtraction from (r^n - 1) will never require a borrow.

- This complement can be computed digit by digit.

**Radix Complement or râ€™s complement**

Radix complement of an n-digit number N in base r is defined as (r^n - N) for N â‰ 0 and as 0 for N = 0.

**Example**

So for a 6-digit decimal number( base 10) N, Radix Complement or r =10â€™s complement is (10^6 - N ).

For a 6-digit binary number N, 2â€™s complement is (2^6 - N)

So, 2â€™s complement of 1101100 is 0010100.

**Characteristic**

**râ€™s complement can be obtained by adding 1 to the (r-1)â€™s complement as **

(r^n - N) =[ (r^n - 1) - N ] +1