For a number system with base r (with r > 1), there are two types of compliments:

- r’s compliment
- (r-1) ‘s compliment

**r’s Compliment: **If we have a positive number N with integer part of n digits then we define r’s compliment as

10’s compliment of number (5432)_{ 10} is 10^{4}– 5432 = 10000 – 5432 = (4568)_{ 10}

[value of n is 4]

10’s compliment of number (0.5432)_{ 10} is 10^{0}– 0.5432 = 1 – 0.5432 = (0.4568)_{ 10}

[value of n is 0 as there is no integer part in this number]

10’s compliment of number (54.32)_{ 10} is 10^{2}– 54.32 = 100 – 54.32 = (45.68)_{ 10} [value of n is 2]

2’s compliment of number (110.01)_{ 2} is (2^{3})_{2}– 110.01_{2}= 1000 – 110.01 = 001.11 [value of n is 3]

Eg. Find 2’s compliment of (110.01)_{ 2} (value from above example)

Ans: Following the rule we get the answer as 000.1110

**(r-1) ‘s compliment: **If we have a positive number N with base r and integer part with digits n and fractional part of m digits, we define (r-1) ‘s compliment as **r ^{n }– r^{-m}– N**

9’s compliment of number (5432)_{ 10} is 10^{4}– 10^{0} – 5432 = 10000 – 1 – 5432 = (4567)_{ 10}

[Value of n is 4 and of m is 0]

9’s compliment of number (0.5432)_{ 10} is 10^{0}– 10^{-4} – 0.5432 = 1 – 0.0001 – 0.5432 = (0.4567)_{ 10}

[Value of n is 0 as there is no integer part in this number and of m is 4]

9’s compliment of number (54.32)_{ 10} is 10^{2 }– 10^{-2} – 54.32 = 100 – 0.01 – 54.32 = (45.67)_{ 10} [Value of n is 2 and of m is 2]

1’s compliment of number (110.01)_{ 2} is (2^{3})_{10}– (2^{-2})_{10 }– 110.01_{2}= 1000 – 0.01 – 110.01 = 001.10 [Value of n is 3 and of m is 2]

Applying the rule to above example we get the answer as 001.10, the sameJ

**Relation between the r’s Compliment and (r-1) ‘s compliment: **We can get **r’s Compliment** from** (r-1) ‘s compliment **by just adding **r ^{-m}** and vice-versa by subtracting

**r**

^{-m}**Compliment of compliment:** If we take r’s compliment of r’s compliment we get the original number as

Let the original number be N

So r’s compliment is r^{n }– N and compliment of compliment is r^{n }– (r^{n }– N) = N which is the original number

and the same is for (r-1) ‘s compliment.

Let the original number be N

So r’s compliment is **r ^{n }– r^{-m} – N** and compliment of compliment is

**r**– (

^{n }– r^{-m}**r**) = N which is the original number

^{n }– r^{-m}– N**1’s compliment and 2’s compliment: **Following table would show the representation of decimal -7 to +8 in 1’s and 2’s compliment. In the signed number , we take the 4^{th} bit as signed bit and make this bit one(‘1’) when ever we have negative number & make it zero(‘0’) when we have a positive number and rest of the 3 bits are used to represent magnitude.

**Comparison of 1’s compliment and 2’s compliment:**

- 1’s compliment is easier to implement than 2’s compliment
- While for the subtraction, 2’s compliment is better because for 2’s compliment we need only 1 arithmetic operation while 2 arithmetic operations are needed for 1’s compliment.
- 2’s compliment has only one representation for zero while 1’s compliment has two representation for zero as shown above