Vous êtes sur la page 1sur 19

Complements are used in the digital computers in order to simplify the subtraction operation and for the logical

manipulations. For each radix-r system (radix r represent base of number system) there are two types of
complements

S.N. Complement Description

1 Radix Complement The radix complement is referred to as the r's complement

Diminished Radix The diminished radix complement is referred to as the (r-1)'s


1
Complement complement

Binary system complements


As the binary system has base r = 2. So the two types of complements for the binary system are 2's complement and
1's complement.

1's complement
The 1's complement of a number is found by changing all 1's to 0's and all 0's to 1's. This is called as taking
complement or 1's complement. Example of 1's Complement is as follows.

2's complement
The 2's complement of binary number is obtained by adding 1 to the Least Significant Bit (LSB) of 1's complement of
the number.

2's complement = 1's complement + 1

Example of 2's Complement is as follows.


Finding the r's and (r-1)'s complement
Here we are going to learn how to convert a number to its r's and (r-1)'s complement.

Method:

Let 'N' is a number and r is its base where r>1 and in N, 'n' is the number of digits before its decimal
point then we can write

r's complement of number = r^n-N

EX.

N = (23)10

here r = 10

n = 2 and N = 23

hence we can write the 10's complement of this number as 10^2 - 23 = 77.

hence we can say that 10's comp of 23 is 77.

Although this method is good enough to solve any problem regarding to this concept, but we will
follow different method for finding r's and r-1's complement.

Easy Method:

Let we have to find again the 10's comp of 23 then this method tells us to divide 3 from 10 and 2
from 9 (i.e 10-9). which gives us a result of 77.

9 10

- 2 3

7 7

i.e the generalized form of writing a r's comp of a number 'abc' which is in r base, we can write.

(r-1) (r-1) r
- a b c

this difference gives us the r's comp of that number.

i.e we can find r's complement of a number by subtracting its right most digit by r and all digits by r-1.

Finding (r-1)'s complement:


We can do this easily by subtracting all the digits of that number from (r-1) where r is the base of that
number.

EXAMPLES:

Find the 10's and 9's complement of (348)10.

ans: 9 9 10

-3 4 8

6 5 2 here 652 is 10's comp of 348

9's comp 9 9 9

- 3 4 8

6 5 1 here 651 is 9's comp of 348

from this method you can find the r's and (r-1)'s complement of any number with base r.

if any questions DO COMMENTS..


Rs AND (R-1)s COMPLEMENT OF NUMBER BASE
SYSTEM
Labels: NUMBER SYSTEM Posted by Abhishek Gupta

In digital system complement is used to find subtraction of number base system and for digital
manipulation. If R be the base of a number system then that number system can have two
complements respectively Rs and (R-1)s complement. The base of
binary number system is 2 so there can be 2s complement and 1s complement of this
system. Similarly in hexadecimal number system there are 15s complement and 16s
complement. Now the general formula for find Rs complement and (R-1)s are given below:

Rs complement of any number system = (Rn)10-N and

(R-1)s complement of any number system = {(Rn)10-1)}-N

Where R = Radix or base of that number system

n = Number of digits in the number and

N = The given number

Let us start finding complement of each number system. Here we will start with binary number
system.

Rs AND (R-1)s COMPLEMENT OF BINARY NUMBER SYSTEM

The base of binary number system is 2 so for binary number R=2 and R-1 = 1 thus 1s
complement for binary numbers is {(2n)10-1)}-N and 2s complement is (2n)10-N.

Example: Find 1s complement and 2s complement of the binary number 10110012?

Solution: 1s complement and 2s complement is found as:

1s complement of 1011001

= {(27)10-1)} - 10110012

= 12710 10110012

= 11111112 10110012

= 01001102

2s complement of 1011001
= (27)10-N

= 12810 10110012

= 100000002 10110012

= 01001112

There is a short cut method for finding 1s complement and 2s complement of binary numbers.
We just need to alter 0s by 1s and 1s by 0s for 1s complement and for 2s complement find
1s complement from this method then add 1 to LSB(least significant bit). So the above problem
can be solved as:

1s complement of 10110012

= 01001102

2s complement of 10110012

= 1s complement of the binary number + 1

= 01001102 + 1

= 01001112

Rs AND (R-1)s COMPLEMENT OF BASE 3 NUMBER SYSTEM

Here the base is 3 so R = 3 and R-1 = 2 thus 3s complement of base 3 number system = (3n)10-
N and 2s complement of base 3 number system = {(3n)10-1)}-N.

Example: Find 3s complement and 2s complement of 1213?

Solution: 3s complement and 2s complement is found as:

2s complement of 1213

= {(33)10-1)} - 1213

= 2610 1610

= 1010

= 1013

3s complement of 1213

= (3n)10-N

= 2710 - 163

= 1110
= 1023

There is a shortcut method for finding 2s and 3s complement of this number base system.
Subtract each digit of the given number from 2 and take them together. Thus the value obtained
is the 2s complement of the given number. And for 3s complement just add 1 to the LSB.

Example: Find 3s complement and 2s complement of 1213?

Solution: The solution is as follows:

2s complement of 1213

= 222 121

= 1013

And 3s complement of 1213

= 2s complement + 1

= 1013 + 1

= 1023

Rs AND (R-1)s COMPLEMENT OF BASE 4 NUMBER SYSTEM

In this system base is 4 so R = 4 and R-1 = 3 thus 4s complement in this number system is
(4n)10-N and 3s complement in this system is {(4n)10-1)}-N.

Example: Find the 3s complement and 4s complement of 1304?

Solution: 3s complement and 4s complement is found as:

3s complement of 1304

= {(43)10-1)} - 1304

= 6310 - 1304

= 6310 2810

= 3510

= 2034

4s complement of 1304

= (43)10 - 1304

= 6410 - 1304

= 6410 - 2810
= 3610

= 2044

The shortcut method for this system is as follows: first subtract each bit of number from 3 and
then take them together for 3s complement and for 4s complement add 1 to the LSB.

Example: Find the 3s complement and 4s complement of 1304?

Solution: The solution is as follows:

3s complement of 1304

= 333 130

= 2034

4s complement of 1304

= 3s complement of 1304 + 1

= 2034 + 1

= 2044

Rs AND (R-1)s COMPLEMENT OF BASE 5 NUMBER SYSTEM

This number system has 4s and 5s complement so 4s complement for this number system is
{(5n)10-1)}-N and 5s complement is (5n)10-N.

Example: Find the 4s complement and 5s complement of 2245?

Solution: The solution is as follows:

4s complement of 2245

= {(53)10-1)} - 2245

= 12410 - 2245

= 12410 - 6410

= 6010

= 2205

5s complement of 2245

= (53)10 - 2245

= 12510 - 2245
= 12510 - 6410

= 6110

=2215

The shortcut method for 4s complement is as: we have to subtract each digit of the given
number from 4. And for 5s complement just add 1 to the 4s complement. So lets solve the
above problem by this method.

4s complement of 2245

= 444 224

= 2205

5s complement of 2245

= 4s complement of 2245 + 1

= 2205 + 1

= 2215

Rs AND (R-1)s COMPLEMENT OF BASE 6 NUMBER SYSTEM

6 is the base of this system so R = 6 and R-1 = 5 thus 6s complement is equal to (6n)10-N and
5s complement is equal to {(6n)10-1)}-N.

Example: Find 5s complement and 6s complement of 5306?

Solution: 5s and 6s complement of 5306 is found as:

5s complement of 5306

= {(63)10-1)} - 5306

= 21510 - 5306

= 21510 - 19810

= 1710

= 256

6s complement of 5306

= (63)10 - 5306

= 21610 - 5306

= 21610 - 19810
= 1810

= 266

By shortcut method we can solve it as we have solved the above problems of base 3, 4 or 5. In
this system the starting digit is 0 and the last digit is 5 so repeat the above method.

5s complement of 5306

= 555 530

= 256

6s complement of 5306

= 5s complement of 5306 + 1

= 256 + 1

= 266

Rs AND (R-1)s COMPLEMENT OF BASE 7 NUMBER SYSTEM

The base 7 number system has 6s and 7s complement so R = 7 and R-1 = 6 thus 6s
complement is {(7n)10-1)} - N and 7s complement is (7n)10 - N.

Example: Find the 6s complement and 7s complement of 6537?

Solution: The solution is as follows:

6s complement of 6537

= {(73)10-1)} - 6537

= 34210 - 6537

= 34210 - 33210

= 1010

= 137

7s complement of 6537

= (73)10 - 6537

= 34310 - 6537

= 34310 - 33210

= 1110
= 147

The above problem can also be solved by a shortcut method as: subtract each digit of the given
number from 6 and then take them as a whole number. For 7s complement add one to the 6s
complement of the given number. Thus the above problem is solved as:

6s complement of 6537

= 666 653

= 137

7s complement of 6537

= 6s complement of 6537 + 1

= 137 + 1

= 147

Rs AND (R-1)s COMPLEMENT OF OCTAL NUMBER SYSTEM

In octal number system there is 7s complement and 8s complement because here R = 8 and
R-1 = 7. Now 7s complement of octal number is {(8n)10-1)} - N and 8s complement of octal
number is (8n)10 N.

Example: Find 7s complement and 8s complement of the octal number 1728?

Solution: The 7s and 8s complement of 1728 is found as:

7s complement of 1728

= {(83)10-1)} - 1728

= 51110 - 1728

= 51110 - 12210

= 38910

= 6058

8s complement of 1728

= (83)10 1728

= 51210 - 1728

= 51210 - 12210

= 39010
= 6068

In short the above problem can be solved by subtracting each digit from 7 for 7s complement
and add 1 to the 7s complement to find 8s complement of given octal number.

7s complement of 1728

= 777 172

= 6058

8s complement of 1728

= 7s complement of 1728 + 1

= 6058 + 1

= 6068

Rs AND (R-1)s COMPLEMENT OF BASE 9 NUMBER SYSTEM

The base 9 number system has R = 9 and R-1 = 8 so 8s complement and 9s complement of
base 9 number system are {(9n)10-1)} N and (9n)10 N respectively.

Example: Find 8s complement and 9s complement of 8079?

Solution: The solution is as follows:

8s complement of 8079

= {(93)10-1)} 8079

= 72810 - 8079

= 72810 - 65510

= 7310

= 819

9s complement of 8079

= (93)10 8079

= 72910 - 8079

= 72910 - 65510

= 7410

= 829
The shortcut method for this problem is shown below:

8s complement of 8079

= 888 - 807

= 819

9s complement of 8079

= 8s complement of 8079 + 1

= 819 + 1

= 829

Rs AND (R-1)s COMPLEMENT OF DECIMAL NUMBER SYSTEM

The base of decimal number system is 10 since there are 10 distinguish digits in this system
starting from 0 to 9. In this system R = 10 and R-1 = 9 thus 9s complement of decimal number
is {(10n)10-1)} - N and 10s complement is (10n)10 N.

Example: Find 9s and 10s complement of the decimal number 40010?

9s complement 40010

= {(103)10-1)} - 40010

= 99910 40010

= 59910

10s complement 40010

= (103)10 40010

= 1000 - 40010

= 60010

The shortcut method for 9s complement and 10s complement of decimal number is shown
below:

9s complement 40010

= 999 400

= 59910

10s complement 40010

= 9s complement 40010 + 1
= 59910 + 1

= 60010

Rs AND (R-1)s COMPLEMENT OF BASE 11 NUMBER SYSTEM

In this system there are 11 digits. The last digit of this system is represented by the English
alphabet A which is equivalent to 10 in decimal number system. Here R = 11 and R-1 = 10.
Thus 10s complement of this number system is {(11n)10-1)} N and 11s complement of this
system is (11n)10 N.

Example: Find 10s complement and 11s complement of 1A111?

Solution: 10s complement and 11s complement of 1A111 is found as:

10s complement of 1A111

= {(113)10-1)} 1A111

= 133010 - 1A111

= 133010 - 23210

= 109810

= 90911

11s complement of 1A111

= (113)10 1A111

= 133110 - 1A111

= 133110 - 23210

= 109910

= 90A11

To find 10s complement of 1A111 by shortcut method we subtract each digit of the given
number from A which is equal to 10. And for 11s complement add 1 to the value of 10s
complement of 1A111. So the given problem is solved as:

10s complement of 1A111

= AAA 1A1

= 90911

11s complement of 1A111


= 10s complement of 1A111 + 1

= 90911 + 1

= 90A11

Rs AND (R-1)s COMPLEMENT OF BASE 12 NUMBER SYSTEM

Here the base of the number system is 12. In this system the last two digits are represented by
A and B which are equivalent to 10 and 11. The digits are as: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A and B.
Here R = 12 and R-1 = 11 thus 11s complement is equal to {(12n)10-1)} N and 12s
complement is equal to (12n)10 N.

Example: Find 11s complement and 12s complement of AB012?

Solution: 11s complement and 12s complement of AB012 is as follows:

11s complement of AB012

= {(123)10-1)} AB012

= 172710 - AB012

= 172710 - 157210

= 15510

= 10B12

12s complement of AB012

= (123)10 AB012

= 172810 - AB012

= 172810 - 157210

= 15610

= 11012

We can solve these problems by another method: for 11s complement subtract each digit from
B and for 12s complement add 1 to 11s complement of the given number.

11s complement of AB012

= BBB AB0

= 10B12

11s complement of AB012


= 11s complement of AB012 + 1

= 10B12 + 1

= 11012

Rs AND (R-1)s COMPLEMENT OF BASE 13 NUMBER SYSTEM

In this system R = 13 and R-1 = 12 so 12s complement and 13s complements are as
follows: 12s complement of base 13 number system = {(13n)10-1)} N and 13s complement of
base13 number system = (13n)10 N.

Example: Find 12s complement and 13s complement of ABC13?

Solution: 12s complement and 13s complement of ABC13 is as follow:

12s complement of ABC13

= {(133)10-1)} ABC13

= 219610 - ABC13

= 219610 - 184510

= 35110

= 21013

13s complement of ABC13

= (133)10 ABC13

= = 219710 - ABC13

= 219710 - 184510

= 35210

= 21113

By shortcut method:

12s complement of ABC13

= CCC ABC

= 21013

13s complement of ABC13

= 12s complement of ABC13 + 1


= 21013 + 1

= 21113

Rs AND (R-1)s COMPLEMENT OF BASE 14 NUMBER SYSTEM

For base 14 number system R = 14 and R-1 = 13 so 14s complement of base 14 number
system is (14n)10 N and 13s complement of this system is {(14n)10-1)} N.

Example: Find 14s complement and 13s complement of D1514?

Solution: Here base is 14 so lets use above two formulas to find 14s and 13s complement of
D1514.

14s complement of D1514

= (143)10 D1514

= 274410 - D1514

= 274410 - 256710

= 17710

= C914

13s complement of D1514

= {(143)10-1)} D1514

= 274310 - D1514

= 274310 - 256710

= 17610

= C814

Shortcut method for this problem is as follows: (D = 13)

13s complement of D1514

= DDD - D15

= C814

14s complement of D1514


= 13s complement of D1514 + 1

= C814 + 1

= C914

Rs AND (R-1)s COMPLEMENT OF BASE 15 NUMBER SYSTEM

Base 15 number system has 15s complement and 14s complement which are as follows:

15s complement of base 15 = (15n)10 - N

14s complement of base 15 = {(15n)10-1)} N

Example: Find 15 complement and 14s complement of AE015?

Solution: The solution of the above problem using the above two formulas:

14s complement of AE015

= {(153)10-1)} AE015

= 337410 - AE015

= 337410 - 246010

= 91410

= 40E14

15s complement of AE015

= (153)10 - AE015

= 337510 - AE015

= 337510 - 246010

= 91510

= 41015

Shortcut method:

14s complement of AE015

= EEE AE0

= 40E15

15s complement of AE015


= 14s complement of AE015 + 1

= 40E15 + 1

= 41015

Rs AND (R-1)s COMPLEMENT OF HEXADECIMAL NUMBER SYSTEM

Hexadecimal number system has 15s complement and 16s complement. Here R = 16 and R-1
= 15 thus we can write:

15s complement of hexadecimal number = {(16n)10-1)} N

16s complement of hexadecimal number = (16n)10 N

Example: Find 15s complement and 16s complement of the hexadecimal number F916?

Solution: The solution is as follows:

15s complement of hexadecimal number F916

= {(162)10-1)} F916

= 25510 - F916

= 25510 - 24910

= 610

= 616

16s complement of hexadecimal number F916

= (162)10 F916

= 25610 - F916

= 25610 - 24910

= 710

= 716

Shortcut method:

15s complement of hexadecimal number F916

= FF F9

= 616

16s complement of hexadecimal number F916


= 15s complement of hexadecimal number F916 + 1

= 616 + 1

= 716