Related Concepts: 04 BCD and Weighted Digital Codes | 06 Gray Code & Code Conversions

05 Excess-3 Code & Self-Complementing Logic

What is Excess-3 Code?

Excess-3 Code (abbreviated XS-3) is a 4-bit non-weighted, self-complementing binary-coded decimal system.

To obtain the Excess-3 code representation for any decimal digit ( through ), add {binary 0011} to the decimal digit and convert the resulting sum to its 4-bit binary equivalent:


1. Characteristics of Excess-3 Code

Advantages (Merits)

  • Self-Complementing Property: Taking the 1’s complement of an Excess-3 code word directly yields the Excess-3 code word for the 9’s complement of the corresponding decimal digit.
  • Simplifies Decimal Subtraction: Simplifies hardware subtraction in BCD ALUs using 9’s complement arithmetic without needing special correction logic.
  • Fault Detection (No All-Zero or All-One Words): The code words 0000 (decimal ) and 1111 (decimal ) are invalid Excess-3 code words for single decimal digits, aiding in wire fault detection.
  • Unique 4-Bit Representation: Every decimal digit (0 to 9) maps uniquely to a distinct 4-bit code word.

Disadvantages (Demerits)

  • Non-Weighted Code: Bit positions do not correspond to fixed numerical weights.
  • Complex Pure Binary Arithmetic: Standard binary addition rules cannot be directly executed without post-addition correction steps.
  • Interface Hardware Overhead: Requires dedicated code converter logic circuits when interfacing with standard 8421 BCD or binary buses.

2. The Self-Complementing Property (Formal Proof)

Formal Definition: Self-Complementing Code

A binary code for decimal digits is called self-complementing if taking the 1’s complement {flipping all bits 0 1} of the code word for digit yields the exact code word for its 9’s complement .

graph LR
    subgraph Decimal Domain
        N[Decimal Digit N = 2] -->|9's Complement: 9 - 2| N9[Decimal Digit 9 - N = 7]
    end
    
    subgraph XS-3 Binary Domain
        XS2[XS-3 of 2: 0101] -->|1's Complement Bit Flip| XS7[XS-3 of 7: 1010]
    end
    
    N -->|Add 3| XS2
    N9 -->|Add 3| XS7

Mathematical Proof (Using Decimal Digit 2)

This proof from class notes is frequently tested in term final examinations:

  1. Select a decimal digit, .
  2. Compute the Excess-3 code for 2:
  3. Take the 1’s complement of :
  4. Compute the 9’s complement of the decimal digit 2:
  5. Compute the Excess-3 code for 7:
  6. Conclusion: Since the 1’s complement of the Excess-3 code for 2 (0101) equals 1010—which is identically the Excess-3 code for 7—Excess-3 code is proven to be self-complementing.

3. Combinational Circuit Design: BCD to Excess-3 Code Converter

Designing a BCD to Excess-3 code converter is a classic 10-mark combinational logic problem.

  • Inputs: 4-bit BCD number (, where is MSB).
  • Outputs: 4-bit Excess-3 number (, where is MSB).

Truth Table & Don’t Care States:

DecimalBCD Inputs ()XS-3 Outputs ()
00 0 0 00 0 1 1
10 0 0 10 1 0 0
20 0 1 00 1 0 1
30 0 1 10 1 1 0
40 1 0 00 1 1 1
50 1 0 11 0 0 0
60 1 1 01 0 0 1
70 1 1 11 0 1 0
81 0 0 01 0 1 1
91 0 0 11 1 0 0
10–15Invalid BCD StatesDon’t Cares (X)

Minimized Output Boolean Equations (via K-Maps):

By mapping minterms and treating minterms as Don’t Care conditions:

  1. Output (LSB):
  2. Output :
  3. Output :
  4. Output (MSB):

Past Year Questions (PYQs)

1. Theoretical Proof (2021, 2023, 2025 - 8 to 10 Marks)

Question: Define self-complementary code. “Excess-3 code is a self-complementary code”—justify the statement.

  • Solution: State the formal definition and write the complete step-by-step mathematical proof for digit 2 shown in Section 2.

2. Combinational Circuit Design (2018 - 10 Marks)

Question: Design a combinational circuit that accepts a 4-bit BCD number and generates an output binary number representing the Excess-3 code of the corresponding BCD number.

  • Solution: Construct the truth table above, set states 10–15 as Don’t Cares (), plot four 4-variable K-maps, derive the minimized equations (), and draw the logic gate schematic.

3. Decoding Register Content (2022 - 12 Marks Partial)

Question: A 12-bit register holds 1000 1001 0111. What decimal value does it represent in Excess-3 code?

  • Solution: Break into 4-bit groups: 1000 (), 1001 (), 0111 (). Subtract 3 from each group: , , .