Beruflich Dokumente
Kultur Dokumente
manipulations. For each radix-r system (radix r represent base of number system) there are two types of
complements
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.
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
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.
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
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.
EXAMPLES:
ans: 9 9 10
-3 4 8
9's comp 9 9 9
- 3 4 8
from this method you can find the r's and (r-1)'s complement of any number with base r.
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:
Let us start finding complement of each number system. Here we will start with 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.
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
= 01001102 + 1
= 01001112
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.
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.
2s complement of 1213
= 222 121
= 1013
= 2s complement + 1
= 1013 + 1
= 1023
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.
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.
3s complement of 1304
= 333 130
= 2034
4s complement of 1304
= 3s complement of 1304 + 1
= 2034 + 1
= 2044
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.
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
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.
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
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.
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
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.
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
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.
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
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.
9s complement 40010
= {(103)10-1)} - 40010
= 99910 40010
= 59910
= (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
= 9s complement 40010 + 1
= 59910 + 1
= 60010
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.
= {(113)10-1)} 1A111
= 133010 - 1A111
= 133010 - 23210
= 109810
= 90911
= (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:
= AAA 1A1
= 90911
= 90911 + 1
= 90A11
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.
= {(123)10-1)} AB012
= 172710 - AB012
= 172710 - 157210
= 15510
= 10B12
= (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.
= BBB AB0
= 10B12
= 10B12 + 1
= 11012
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.
= {(133)10-1)} ABC13
= 219610 - ABC13
= 219610 - 184510
= 35110
= 21013
= (133)10 ABC13
= = 219710 - ABC13
= 219710 - 184510
= 35210
= 21113
By shortcut method:
= CCC ABC
= 21013
= 21113
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.
Solution: Here base is 14 so lets use above two formulas to find 14s and 13s complement of
D1514.
= (143)10 D1514
= 274410 - D1514
= 274410 - 256710
= 17710
= C914
= {(143)10-1)} D1514
= 274310 - D1514
= 274310 - 256710
= 17610
= C814
= DDD - D15
= C814
= C814 + 1
= C914
Base 15 number system has 15s complement and 14s complement which are as follows:
Solution: The solution of the above problem using the above two formulas:
= {(153)10-1)} AE015
= 337410 - AE015
= 337410 - 246010
= 91410
= 40E14
= (153)10 - AE015
= 337510 - AE015
= 337510 - 246010
= 91510
= 41015
Shortcut method:
= EEE AE0
= 40E15
= 40E15 + 1
= 41015
Hexadecimal number system has 15s complement and 16s complement. Here R = 16 and R-1
= 15 thus we can write:
Example: Find 15s complement and 16s complement of the hexadecimal number F916?
= {(162)10-1)} F916
= 25510 - F916
= 25510 - 24910
= 610
= 616
= (162)10 F916
= 25610 - F916
= 25610 - 24910
= 710
= 716
Shortcut method:
= FF F9
= 616
= 616 + 1
= 716