How to Find Complements Of Other Bases

 



Complements are used in digital computers to simplify the subtraction operation and for logical manipulation. There are two types of complements for each base‐r system: the radix complement and the diminished radix complement. The first is referred to as the (r - 1)’s complement and the second as the r’s complement. 

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


So for a 6-digit decimal number( base 10) N, Diminished Radix Complement or (r-1)=9’s complement is (10^6 - 1) - N = 999999 - N
 
For, a 6-digit binary number N, (2-1)= 1’s complement is (2^6 - 1) - N = 111111 - N

So, 1’s complement of 101100 is (111111 - 101100) =010011

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



Let us take another example with "Logic Kit" app this app is very easy and so good in these subjects of number systems.  Download This app from the app store for iOS  devices click here.


1- Open  the "Logic Kit" app 

2- Choose Find Complement

3- Select any base you need 

4- write a number that you need to find its complements


5- You see the solution then click on show steps to see the steps with an explanation with every step.












Previous Post Next Post

Contact Form