Steps to find (r-1)’s complement:
To find (r-1)’s complement,
- Subtract each digit of the number from the largest number in the number system with the base.
- For example, if the number is a three-digit number in base 9, then subtract the number from 888 as 8 is the largest number in the base 9 number system.
- The obtained result is the (r-1)’s (8’s complement) compliment.
Example
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.
Steps to find r’s complement:
To find r’s complement, just add 1 to the calculated (r-1)’s complement. Now, this holds true for any base in the number system that exists. It can be tested with familiar bases that is the 1’s and 2’s complement.
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
Example:
Let the number be 10111 base 2 (b=2)
Then, 1's complement will be 01000 (b-1)
2's complement will be 01001 (b)
Taking a number with an Octal base:
Let the number be -456.
Then 7's complement will be 321
and 8's complement will be 322
Q1. What is 9’s complement?
The 9’s complement of a decimal digit is the number that must be added to it to generate 9 i.e., the complement of 6 is 3 while the complement of 4 is 5, etc.
Q2. State shortcut method of computing 9’s complement for an n-digit number.
A quick technique to find the 9’s complement of a larger (n-digit) number is to replace each digit in the number with its 9’s complement.
9's complement of 345
= 999 - 345
= 654
4- write a number that you need to find its complements