Related Concepts: 01 BCD & Weighted Digital Codes | 03 Gray Code & Code Conversions | 04 Error Control, Parity Generators & Checkers

2.02 Excess-3 Code & Self-Complementing Logic

What is a Self-Complementing Code?

A 4-bit binary code is defined as Self-Complementing if the 1’s complement {bitwise inversion: } of any decimal digit’s code word yields the exact code word of its 9’s decimal complement ().

graph LR
    subgraph Self-Complementing Symmetry
        D2[Decimal Digit 2: 0101] -->|Bitwise Inversion| InvD2[1's Comp: 1010]
        InvD2 -->|Equals| D7[Decimal Digit 7 = 9 - 2: 1010]
    end


1. What is Excess-3 Code?

[concept] Concept: Excess-3 Definition Excess-3 (XS-3) is a non-weighted binary code. Each decimal digit (0 through 9) is represented by the 4-bit binary value of .

  • Decimal:
  • Excess-3 representation:

Why do we use Excess-3?

  1. Simplified Subtraction (Self-Complementing): The primary advantage of Excess-3 is that the 1’s complement of an Excess-3 digit is the Excess-3 representation of its 9’s complement (e.g. 1’s complement of 0100 [1] is 1011 [8]). This makes subtraction circuits in early decimal calculators incredibly simple to design.
  2. Transmission Reliability: Unlike standard BCD where is represented by 0000 (which is indistinguishable from a line disconnection or fault), the smallest valid Excess-3 code word is 0011 (decimal 0). This prevents signal transmission line faults from being misread as valid data.

2. Excess-3 Addition Mechanics

Because Excess-3 values always have an extra offset of built-in, adding two Excess-3 digits yields:

To restore the correct Excess-3 bias of :

  • Case A: A carry is generated (Sum ) Add 0011 () to correct the sum nibble.
  • Case B: No carry is generated (Sum ) Subtract 0011 () (or add 1101) to correct the sum nibble.

Step-by-Step Addition Examples:

Example 1: Excess-3 Addition with Sum (No Carry)

Add and in Excess-3:

0101 & (2 + 3 = 5) \\ +0110 & (3 + 3 = 6) \\ \hline 1011 & (\text{Raw Binary Sum} = 11_{10} \to \text{No Carry}) \\ -0011 & (\text{No Carry} \implies \text{Subtract } 3) \\ \hline \mathbf{1000} & (\text{Corrected Sum} = 8_{10} \implies 5_{\text{decimal}} \text{ in XS-3}) \end{array}$$ **Final Answer:** **$1000_{\text{XS-3}}$** (corresponds to $5_{10}$).

Example 2: Excess-3 Addition with Sum (Carry Generated)

Add and in Excess-3:

1001 & (6 + 3 = 9) \\ +1000 & (5 + 3 = 8) \\ \hline \mathbf{1} \ 0001 & (\text{Raw Binary Sum} \to \text{Carry generated!}) \\ +0011 & (\text{Carry generated} \implies \text{Add } 3 \text{ to sum nibble}) \\ \hline \mathbf{1} \ 0100 & (\text{Carry is pushed to next nibble}) \end{array}$$ Grouped into 4-bit nibbles: $\mathbf{0100\ 0100_{\text{XS-3}}}$ (corresponds to $11_{10}$ in decimal).

3. Mathematical Proof: Excess-3 is a Self-Complementing Code

Major Exam Proof (2021, 2023, 2025 - 8 to 10 Marks)

Question: Prove mathematically that Excess-3 (XS-3) code is a self-complementing code.

Step-by-Step Proof:

  1. Definition of Excess-3 Code: The Excess-3 code word for any decimal digit () is constructed by adding to its standard 4-bit binary equivalent:

  2. Evaluating the 9’s Complement of (): The Excess-3 code word for the 9’s complement of is:

  3. Evaluating the 1’s Complement of : Taking the bitwise 1’s complement of a 4-bit number is mathematically equivalent to subtracting it from (): Substituting :

  4. Comparing Results:


4. Complete 9’s Complement Symmetry Table

Decimal Digit ()BCD (8421)Excess-3 Code ()1’s Comp of XS-39’s Comp Digit ()XS-3 Code of ()
000000011110091100
100010100101181011
200100101101071010
300110110100161001
401000111100051000
501011000011140111
601101001011030110
701111010010120101
810001011010010100
910011100001100011

5. Design: BCD to Excess-3 Code Converter

Major Exam Design Problem (2018 - 10 Marks)

Question: Design a combinational logic circuit to convert a 4-bit BCD input () to a 4-bit Excess-3 code output ().

Boolean Function Derivation (K-Map Simplification):

  • Inputs: (Don’t care conditions ).
  • Outputs: .
  1. Output (LSB):
  2. Output :
  3. Output :
  4. Output (MSB):

Past Year Questions (PYQs)

  • [PYQ 2017, 2021, 2023, 2025]: Define self-complementary code. (04 Marks)
  • [PYQ 2021, 2023, 2025]: Prove mathematically that Excess-3 code is a self-complementary code. (08-10 Marks)
  • [PYQ 2018]: Design a BCD to Excess-3 code converter circuit. (10 Marks)