How to Take 9’s and 10’s Complement in Decimal Number System?
- For 9’s Complement:
- Subtract each digit from 9.
- This gives the 9โs complement.
- For 10’s Complement:
- Compute the 9’s complement.
- Add 1 to it to get the 10’s complement.
Available Space for the 9’s and 10’s Complement in Decimal Number System
In the decimal number system, with a base of 10, the 9’s and 10’s complement methods are key for representing a number’s complement, which is crucial for operations like subtraction in digital arithmetic. For a number with \(\mathsf{n}\) digits, the 9’s complement is calculated using the maximum value in that digit space, which is \(\mathsf{10^n-1}\) (e.g., 999 for three digits). The 10’s complement uses \(\mathsf{10^n}\), representing the full space for n digits (e.g., 1000 for three digits). These values serve as the modulus or “available space” for computing complements. The way these values change with different numbers of digits (n) can be shown in a table, making it easier to understand how complement-based arithmetic works in the decimal system.
Complement of a Complement Returns the Original Number
If you take the radix complement (rโs complement) of a number, then apply the diminished radix complement ((rโฏโโฏ1)โs complement) to the result, and finally take the same type of complement again, you will recover the original number.
This works because:
- The rโs complement of a number, A, is defined as: \(\mathsf{r^n-A}\) and the r’s complement of the complement returns \(\mathsf{r^n-(r^n-A)=A}\).
- The (rโฏโโฏ1)โs complement is \(\mathsf{r^n-1-A}\) and the (r-1)’s complement of this complement returns \(\mathsf{r^n-1-(r^n-1-A)=A}\).
So when you apply these operations in sequence, the transformations effectively cancel each other out, returning you to the original value.
Example: Decimal System (Base 10)
Letโs take the number 1234:
- 10โs complement of 1234: \(\mathsf{10^4-1234=8766}\).
- 10โs complement of 8766: \(\mathsf{10^4-8766=1234\rightarrow{}}\)original number restored.
- 9โs complement of 1234: \(\mathsf{10^4-1-1234=8765}\).
- 9โs complement of 8765: \(\mathsf{10^4-1-8765=1234\rightarrow{}}\)original number restored.
Mathematical Shortcut for Finding 10’s Complement
Thereโs also a direct method to compute the 10โs complement without explicitly adding 1:
- Start from the Least Significant Bit (LSB) and move leftward.
- Leave all zeroes unchanged until you encounter the first non-zero digit. Subtract it from 10.
- From that point onward (toward the Most Significant Bit), subtract all remaining bits from 9.
Example 1: Find 9’s and 10’s complement of 0.
For a single-digit number like 0 in the decimal system, the available space for the 9’s complement is 9 (equivalent to \(\mathsf{10^1-1}\)), and for the 10’s complement, it is 10 (\(\mathsf{10^1}\)). Since the number 0 occupies no space, the remaining space directly provides the complements: 9 for the 9’s complement and 10 for the 10’s complement. However, since we are typically dealing with fixed-width systems, which means that the number of output bits remain same as the input bits, we drop the carry and keep the least significant bits. In this case, we drop the 1 and the 10’s complement of 0 is 0. These calculations are illustrated in the accompanying figure.
Example 2: Find 9’s and 10’s complement of 4.
For a single-digit number like 4 in the decimal system, the available space for the 9’s complement is 9 (equivalent to \(\mathsf{10^1-1}\)), and for the 10’s complement, it is 10 (\(\mathsf{10^1}\)). To find the complements, subtract 4 from these values: the 9’s complement is 9 – 4 = 5, and the 10’s complement is 10 – 4 = 6. These calculations are illustrated in the accompanying figure.
Example 3: Find 9’s and 10’s complement of 9.
For a single-digit number like 9 in the decimal system, the available space for the 9’s complement is 9 (equivalent to \(\mathsf{10^1-1}\)), and for the 10’s complement, it is 10 (\(\mathsf{10^1}\)). To find the complements, subtract 9 from these values: the 9’s complement is 9 – 9 = 0, and the 10’s complement is 10 – 9 = 1. These calculations are illustrated in the accompanying figure.
Example 4: Find 9’s and 10’s complement of 27.
For a two-digit number like 27 in the decimal system, the available space for the 9’s complement is 99 (equivalent to \(\mathsf{10^2-1}\)), and for the 10’s complement, it is 100 (\(\mathsf{10^2}\)). To find the complements, subtract 27 from these values: the 9’s complement is 99 – 27 = 72, and the 10’s complement is 100 – 27 = 73. These calculations are illustrated in the accompanying figure.
Example 5: Find 9’s and 10’s complement of 418.
For a three-digit number like 0 in the decimal system, the available space for the 9’s complement is 999 (equivalent to \(\mathsf{10^3-1}\)), and for the 10’s complement, it is 1000 (\(\mathsf{10^3}\)). To find the complements, subtract 418 from these values: the 9’s complement is 999 – 418 = 581, and the 10’s complement is 1000 – 418 = 582. These calculations are illustrated in the accompanying figure.