Skip to content
Question Bank (3 marks) · Q3

Q.Write the table of 2-4-2-1 code and show that it is a self complimenting code.

Karnataka PUCTextbookLong· 3mImportance★★★★★est
9% · 14/160 Questions
✓ Free question

[!TLDR]

The 2-4-2-1 code is a weighted BCD code whose bit-by-bit complement of any digit equals the code of its 9's complement, so it is self-complementing.

2-4-2-1 code table (weights 2, 4, 2, 1):

Decimal2 4 2 1 code
00 0 0 0
10 0 0 1
20 0 1 0
30 0 1 1
40 1 0 0
51 0 1 1
61 1 0 0
71 1 0 1
81 1 1 0
91 1 1 1

(For example 5 = 1011 → 2+0+2+1 = 5 and 6 = 1100 → 2+4+0+0 = 6, confirming the weights.)

Self-complementing property: A code is self-complementing if the 1's complement (bit-by-bit inversion) of the code of a digit DD equals the code of (9−D)(9-D), its 9's complement.

Digit DCodeComplement of codeDigit of complement
0000011119
1000111108
2001011017
3001111006
4010010115

In every pair the two digits add up to 9 and their codes are exact bit complements of each other. Hence the 2-4-2-1 code is a self-complementing code.

[!ANSWER]

The 2-4-2-1 code is listed above; inverting every bit of any digit's code yields the code of its 9's complement (0↔9, 1↔8, 2↔7, 3↔6, 4↔5), which proves it is a self-complementing code.

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.