[go: up one dir, main page]

0% found this document useful (0 votes)
148 views4 pages

Complements Notes

The document discusses different types of number complements used in computing, including 1's, 2's, 9's, and 10's complement. It provides examples of calculating diminished radix complement and radix complement for decimal, binary, and octal numbers.

Uploaded by

Shivam
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
0% found this document useful (0 votes)
148 views4 pages

Complements Notes

The document discusses different types of number complements used in computing, including 1's, 2's, 9's, and 10's complement. It provides examples of calculating diminished radix complement and radix complement for decimal, binary, and octal numbers.

Uploaded by

Shivam
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

COMPLEMENT

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.

Types of Complements

There are two types of complements.

1. Diminished Radix Complement or r-1’s complement.

2. Radix Complement or r’s complement.

Diminished Radix Complement [r-1’s complement]

Suppose a number N is given

N = Number

r = base of the number

n = Number of digits in the number.

The r-1’s complement of the number is given by the formula.

(rn – 1) – N

Radix Complement [r’s complement]

To find radix complement of a number N where

N = Number

r. = base of the number

n = Number of digits in the number.

The r’s complement of the number is given as

rn – N

or

r-1’s complement + 1 => [( rn -1) – N] + 1

Examples – Diminished Radix Complements

Problem1:

Find 9’s complement of 258.


Solution:

N = 258

r = 10

n=3

We use the formula for r-1’s complement.

(rn – 1) – N

(103 – 1) – 258

999 – 258

The 9’s complement of 258 is 741.

Problem2:

Find 1’s complement for 1101.

Solution:

In the given problem,

N = 1101

r=2

n=4

The formula for r-1’s complement where r = 2 is (rn – 1) – N.

(24 – 1) – 1101

Note: Binary equivalent for 24 = 10000.

(10000 – 1)1101

1111 – 1101

The 1’s complement for 1101 is 0010.

Method2

The second method to find the r-1’s complement is to subtract each digit in the number by r-1.

In our case, r = 2 so r – 1 = 1

Given that the 1’s complement of binary number is

1–1=0

1–1=0

1–0=1

1–1=0

Answer: 0010
Problem3:

Find 7’s complement of octal number 234.

Solution:

The range of digits for octal number is 0-to-7. Subtract each digit with 7 will give r-1’s complement
for octal.

7–2=5

7–3=4

7–4=3

The r-1’s complement is 543.

Examples – Radix Complements

There are two methods to find the r’s complement of a number.

Method 1: rn – N

Method 2: r-1’s complement + 1

Problem4:

Find 10’s complement for 432.

Solution:

Given that

N = 432

r = 10

n=3

Method 1:

First we will find the 10’s complement using rn – N.

rn – N = 1000 – 432 = 568

Therefore,

10’s complement of 432 is 568.

Method 2:

By using method 2, you need to find the 9’s complement and then add 1 to the result to get 10’s
complement.

Step1: Subtract each digit by 9 to get 9’s complement.

9–4=5

9–3=6

9–2=7
Step2: Add 1 to the result.

567 + 1

=568

568 is the 10’s complement of 432.

Problem5:

Find 2’s complement of the binary number 1001.

Solution:

Method 1:

To find 2’s complement using method 1 use the formula rn – N.

Given that

N = 1001

r=2

n=4

rn – N = 10000 – 1001

10000

– 1001

0111

The 2’s complement for 1001 is 0111.

Method 2:

To use second method, find the 1’s complement for 1001 and then add 1 to the result.

Step1: find the 1’s complement of 1001.

1001 -> 0110 (1’s complement)

Step2: Add 1 to result.

0110 + 1 => 0111

Therefore,

0111 is the 2’s complement of 0110.

You might also like