Thanks to visit codestin.com
Credit goes to www.scribd.com

50% found this document useful (2 votes)
14K views6 pages

Number Complements Explained

The document discusses r's and (r-1)'s complements of numbers in different number systems. It defines r's and (r-1)'s complements, provides examples of calculating them in binary, decimal, octal and hexadecimal systems, and explains how to use complements for subtraction.

Uploaded by

Mohit Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
14K views6 pages

Number Complements Explained

The document discusses r's and (r-1)'s complements of numbers in different number systems. It defines r's and (r-1)'s complements, provides examples of calculating them in binary, decimal, octal and hexadecimal systems, and explains how to use complements for subtraction.

Uploaded by

Mohit Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

r's and (r-1)'s Complement of Numbers

The mostly used complements are 1's, 2's, 9's, and 10's complement. Apart from these
complements, there are many more complements from which mostly peoples are not
familiar. For finding the subtraction of the number base system, the complements are
used. If r is the base of the number system, then there are two types of complements
that are possible, i.e., r's and (r-1)'s. We can find the r's complement, and (r-1)'s
complement of the number, here r is the radix. The r's complement is also known
as Radix complement (r-1)'s complement, is known as Diminished Radix
complement.

If the base of the number is 2, then we can find 1's and 2's complement of the number.
Similarly, if the number is the octal number, then we can find 7's and 8's complement of
the number.

There is the following formula for finding the r's and (r-1)'s complement:

r's complement= (rn)10-N


(r-1)' s complement={(rn)10-1}-N

where r=Base, N= given number, n=number of bits in a given Number

1) (r-1)'s complement
The (r-1)'s complement of a number in any number system with base r can be found
out by subtracting every single digit of a number by r-1.

For Example: In the binary number system, the base is 2. Hence, its (r-1)'s i.e., (2-1
=1)'s complement can be obtained by subtracting each bit from 1, i.e., 1's complement
for 001 can also be calculated by subtracting 001 from 111 which will be (111-001) =
(110)2.

Similarly, in the octal number system, the base is 8 so its 7's complement can be
calculated by subtracting each bit by 7, i.e., 7's complement for 347 in octal number
system can be calculated by subtracting 347 from 777 which will yield (777 – 347) =
(430)8.

2) r's complement
The r's complement of a non-zero number in any number system with base r can be
calculated by adding 1 to the LSB of its (r-1)'s complement.

For Example: In binary number system, 2's complement of 001 can be calculated by


adding 1 to the LSB of its 1'complement (i.e., 110 + 1) = (111)2.

Similarly, in octal number system, 8's complement of 347 can be calculated by adding 1


to the LSB of its

7'complement (i.e., 430 + 1) = (431)8.

9's and 10's complement in Decimal Number System


We already know that the decimal number system has its base as 10, As we have already
discussed above, 9's complement of decimal number can be found out by subtracting
its each by 9.

Example 1: Calculate 9's complement of (2457)10

Solution: 9999 – 2457 = (7542)10

Now, 10's complement of a decimal number can be calculated by adding 1 to the LSB of
the 9's complement.

Example 2: Calculate 10's complement of (2457)10

Solution: 10's complement for (2457)10 is calculated by adding 1 to (7542)10 which is the


9's complement. Therefore, 10's complement of (2457)10 is (7543)10.
Subtraction using 9's complement
Case 1: When the subtrahend is smaller than the minuend.

Subtraction using 10's complement


Case 1: When the subtrahend is smaller than the minuend.
Case 2: When the subtrahend is greater than the minuend.

Some examples to understand how we can calculate the r's and (r-1)'s
complement of binary, decimal, octal, and hexadecimal numbers using
formula.

r's complement= (rn)10-N


(r-1)' s complement={(rn)10-1}-N

Example: (1011000)2

This number has a base of 2, which means it is a binary number. So, for the binary
numbers, the value of r is 2, and r-1 is 2-1=1. So, we can calculate the 1's and 2's
complement of the number.

1's complement of the number 1011000 is calculated as:

={(27)10-1}-(1011000)2
={(128)10-1}-(1011000)2
={(127)10}-(1011000)2
=11111112-10110002
=0100111
2's complement of the number 1011000 is calculated as:

=(27)10-(1011000)2
=(128)10-(1011000)2
=100000002-10110002
=01010002

Example 2: (155)10

This number has a base of 10, which means it is a decimal number. So, for the decimal
numbers, the value of r is 10, and r-1 is 10-1=9. So, we can calculate the 10's and 9's
complement of the number.

9's complement of the number 155 is calculated as:

={(103)10-1}-(155)10
=(1000-1)-155
=999-155
=(844)10

10's complement of the number 1011000 is calculated as:

=(103)10-(15510
=1000-155
=(845)10

Example 3: (172)8

This number has a base of 8, which means it is an octal number. So, for the octal
numbers, the value of r is 8, and r-1 is 8-1=7. So, we can calculate the 8's and 7's
complement of the number.

7's complement of the number 172 is calculated as:

={(83)10-1}-(172)8
=((512)10-1)-(132)8
=(511)10-(122)10
=(389)10
=(605)8

8's complement of the number 172 is calculated as:


=(83)10-(172)8
=(512)10-1728
=51210-12210
=39010
=6068

Example 4: (F9)16

This number has a base of 16, which means it is a hexadecimal number. So, for the
hexadecimal numbers, the value of r is 16, and r-1 is 16-1=15. So, we can calculate the
16's and 15's complement of the number.

15's complement of the number F9 is calculated as:

{(162)10-1}-(F9)16
(256-1)10-F916
25510-24910
(6)10
(6)16

16's complement of the number F9 is calculated as:

{(162)10}-(F9)16
25610-24910
(7)10
(7)16

You might also like