GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A decimal code is self-complementing if inverting all four bits of the code for digit d gives the code for 9 − d. Which of the following codes are self-complementing? I. 8421 (BCD) II. 2421 (0-4 as 0000 to 0100, 5-9 as 1011 to 1111) III. 84-2-1 IV. 5421 V. Excess-3

  1. A. I, II and V only
  2. B. II, IV and V only
  3. C. II and V only
  4. D. II, III and V only

Correct answer: D. II, III and V only

A weighted code is self-complementing when its weights add up to 9: 2+4+2+1 = 9 and 8+4−2−1 = 9, while 8+4+2+1 = 15 and 5+4+2+1 = 12. Excess-3 is self-complementing as 3 + d complemented is 3 + (9 − d).

More Digital Logic questions

Exams that ask this topic