๐ Radix and Diminished Radix Complements
Complement systems are mathematical techniques for representing negative numbers in positional number systems. They come in two fundamental forms that exist across all radix systems.
โ Diminished Radix Complement
For a number system with radix r, the diminished radix complement is formed by:
- Complementing each digit with respect to (r-1)
- Also called (r-1)’s complement
Examples:
- Binary (r=2): 1’s complement - flip each bit (complement w.r.t. 1)
- Decimal (r=10): 9’s complement - subtract each digit from 9
- Octal (r=8): 7’s complement - subtract each digit from 7
โ Radix Complement
The radix complement is:
- Diminished radix complement + 1
- Also called r’s complement
Examples:
- Binary: 2’s complement = 1’s complement + 1
- Decimal: 10’s complement = 9’s complement + 1
- Octal: 8’s complement = 7’s complement + 1
โ ๏ธ Diminished Radix Complement Issues
All (r-1)’s complement systems suffer from:
- Dual zero representation: Both 000…0 and (r-1)(r-1)(r-1)…represent zero
- End-around carry: Addition requires adding final carry back to LSB
- Suboptimal range: Wastes one bit pattern on redundant zero
โ Radix Complement Advantages
All r’s complement systems provide:
- Single zero: Only 000…0 represents zero
- Clean arithmetic: Discard final carry, no special handling needed
- Optimal range: Maximum utilization of available bit patterns
- Asymmetric range: One extra negative value (e.g., -8 to +7 in 4-bit)
๐ป Binary (Radix 2)
Number: 5 = 0101
1's complement: 1010 (flip all bits) 2's complement: 1011 (1010 + 1)
Range (4-bit):
- 1's complement: -7 to +7 (with two zeros)
- 2's complement: -8 to +7 (single zero)๐ Decimal (Radix 10)
Number: 542
9's complement: 457 (9-5=4, 9-4=5, 9-2=7) 10's complement: 458 (457 + 1)
Range (3-digit):
- 9's complement: -499 to +499 (with 000 and 999 both = 0)
- 10's complement: -500 to +499 (single zero)8๏ธโฃ Octal (Radix 8)
Number: 25โ = 025
7's complement: 752 (7-0=7, 7-2=5, 7-5=2) 8's complement: 753 (752 + 1)๐งฎ Mathematical Relationship
For any radix r and n-digit number N:
- Diminished radix complement: (rโฟ - 1) - N
- Radix complement: rโฟ - N = ((rโฟ - 1) - N) + 1
This shows the universal relationship: r’s complement = (r-1)’s complement + 1
๐ Why Binary Dominates
While these mathematical properties are universal, binary systems have unique advantages:
โ๏ธ Hardware Simplicity
- 1’s complement: Single XOR operation (bitwise NOT)
- 2’s complement: Leverages simple binary arithmetic units
- Other radix systems require more complex digit-by-digit operations
๐ฏ Perfect Boolean Alignment
- Every bit pattern represents exactly one value
- Arithmetic operations map directly to digital logic gates
- No special cases or complex digit handling
๐ Optimal for Digital Systems
- Boolean algebra naturally supports binary complement operations
- Transistor-based circuits excel at binary operations
- Memory addressing aligns perfectly with binary arithmetic
๐ Historical Usage
- UNIVAC 1: Used 1’s complement in decimal
- CDC 6600: Used 1’s complement in binary
- IBM 7090: Used sign-magnitude representation
- Modern systems: Virtually all use 2’s complement
๐ก Key Insight
The mathematical elegance of complement systems is universal across all radix systems, but the practical advantages are amplified in binary due to the perfect alignment between:
- Mathematical properties of radix complements
- Simplicity of binary operations
- Hardware implementation efficiency
This is why 2’s complement became the dominant standard in digital computing, despite the universal applicability of complement arithmetic principles.