You are currently viewing Complements of Numbers
Complements of Numbers - Digital Electronics

Complements of Numbers

Complements of numbers is a term used in mathematics to refer to the difference between a number and its complement. This article will explore the concept of complements of numbers, their applications, and how to find them.

What are Complements of Numbers?
Types of Complements
How to Find Complements?
Applications of Complements

What are Complements of Numbers?

In mathematics, a complement of a number is the difference between the number and the base of the numeral system used to represent the number. For instance, in the decimal system, the base is 10. Therefore, the complement of a number is the difference between the number and 10. The complement of a number is also known as its radix complement.

Complements of numbers are useful in many applications, including computer science and digital electronics. In these fields, complements of numbers are used to represent negative numbers and perform arithmetic operations.

Types of Complements

There are two types of complements of numbers: one’s complement and two’s complement.

One’s Complement:

The one’s complement of a number is obtained by inverting all the bits in its binary representation. For instance, the one’s complement of 10110 is 01001. One’s complement is used to represent negative numbers in digital circuits.

Two’s Complement:

The two’s complement of a number is obtained by adding 1 to the one’s complement of the number. For instance, the two’s complement of 10110 is 01010 (one’s complement of 10110 is 01001, and adding 1 gives 01010). Two’s complement represents negative numbers in computers and performs arithmetic operations.

How to Find Complements?

Finding the complement of a number depends on the numeral system used to represent the number. Here are the steps to find the complements of numbers in different numeral systems:

1. Decimal System:

The complement of a decimal number is the difference between the number and the base (10). For instance, the complement of 27 is 73 (100-27).

2. Binary System:

The complement of a binary number is obtained by inverting all its bits. For instance, the complement of 10110 is 01001.

One’s Complement in Binary System:

The one’s complement of a binary number is obtained by inverting all its bits. For instance, the one’s complement of 10110 is 01001.

Two’s Complement in Binary System:

The two’s complement of a binary number is obtained by adding 1 to the one’s complement of the number. For instance, the two’s complement of 10110 is 01010 (one’s complement of 10110 is 01001, and adding 1 gives 01010).

Examples of Finding Complements of Numbers:

Let’s take some examples to understand how to find complements of numbers:

1. Decimal System:

Find the complement of the decimal number 75.

Solution:

The base of the decimal system is 10.

Complement of 75 = 100 – 75 = 25.

Therefore, the complement of 75 is 25.

2. Binary System:

Find the one’s complement and two’s complement of the binary number 101001.

Solution:

One’s complement:

Invert all the bits in the binary number.

101001 becomes 010110.

Therefore, the one’s complement of 101001 is 010110.

Two’s complement:

Add 1 to the one’s complement of the binary number.

010110 + 1 = 010111.

Therefore, the two’s complement of 101001 is 010111.

Applications of Complements

Complements of numbers have several applications in different fields, including computer science, digital electronics, and cryptography. Some of the most significant applications of complements of numbers are as follows:

1. Representation of Negative Numbers:

Complements of numbers are used to represent negative numbers in digital circuits and computers. In the two’s complement system, the leftmost bit represents the sign of the number. If the leftmost bit is 1, the number is negative; if it is 0, it is positive.

2. Arithmetic Operations:

Complements of numbers are used to perform arithmetic operations on negative numbers in digital circuits and computers. The two’s complement system simplifies the addition and subtraction of negative numbers. In the two’s complement system, the addition of two negative numbers is the same as the addition of their complements, and the result is the complement of the sum of the complements.

3. Error Detection and Correction:

Complements of numbers are used in error detection and correction techniques in digital circuits and computers. For instance, checksums are used to detect errors in transmitted data. A checksum is the complement of the sum of the data in a message.

4. Cryptography:

Complements of numbers are used in cryptography to encrypt and decrypt messages. In the RSA algorithm, a public key is created by multiplying two large prime numbers. The private key is the complement of the public key.

For complete list of topics in Digital Electronics course, CLICK HERE

For Analog Electronics course CLICK HERE

For Embedded System Design course CLICK HERE

If you have any suggestions, comment below or contact us at admin@chandrashaker.com

If you found this article interesting and helpful, don’t forget to share it with your friends.