Tags: #◇Computer Science #◇CSARCH1 #◇Computer Architecture #◇Data Representation #◇Complements
Complements
◇Overview
This module discusses how to represent different types of complements for any number system and how to perform subtraction using addition and complements. Complements are used in digital computers for logic manipulation and to simplify subtraction operations.
◇Types of Complements
For each base- system, there are two types of complements:
- Diminished Radix Complement: 's complement.
- Binary (): 1's complement.
- Decimal (): 9's complement.
- Radix Complement: 's complement.
- Binary (): 2's complement.
- Decimal (): 10's complement.
◇Important Formulas
Diminished Radix Complement ('s complement)
Given a number in base having digits:
- Example: 9's complement of ():
- Example: 1's complement of ():
Radix Complement ('s complement)
Given a number in base having digits:
- Practically, this is equivalent to: 's complement + 1.
- Example: 10's complement of :
- 9's complement is 8769, plus 1 = .
- Example: 2's complement of :
- 1's complement is 1001, plus 1 = .
◇Subtraction with Complements
Subtraction of two -digit unsigned numbers () in base :
- Add the minuend to the 's complement of the subtrahend .
- If : The sum will produce an end carry. Discard the carry. The remaining result is .
- If : The sum produces no end carry. The result is the 's complement of . To view the answer in a familiar format, take the 's complement of the sum and place a negative sign in front (though negative numbers technically don't exist for strictly unsigned formats).
Worked Examples
Example 1: Using 10's complement, perform
- Pad to match the number of digits in : .
- 10's complement of
- Discard end carry ->
Example 2: Using 10's complement, perform
- 10's complement of
- No carry -> Take 10's complement of and add negative sign:
Example 3: Using 2's complement, perform
- 2's complement of
- Discard end carry ->
◇References & Navigation
- Previous Topic: ◇Binary Codes for Decimal Digits
- Next Topic: ◇Number System Base Conversion
ACTIVE RECALL VERIFICATION
Select an answer to verify conceptual comprehension and reveal the technical rationale.
What is the 9's complement of the decimal number 1230?
The radix complement of a number in base r is equivalent to:
What is the 1's complement of the binary number 0110?
What is the 2's complement of the binary number 1111?
What is the 10's complement of the decimal number 725?
When performing subtraction M - N using r's complement, what indicates that M is less than N?
What is the 2's complement of the binary number 0110?
What is the primary purpose of using complements in digital computers?
What is the (r-1)'s complement of 1100 in base 8 (octal)?
If M = 15 and N = 14, what is the result of adding M to the 10's complement of N (using 2 digits)?