GATE Computer ScienceHardGATE CS (PYQ pattern)

A one-digit BCD adder adds digits a, b (0-9) and a carry-in c (0 or 1). Its 4-bit binary adder gives a carry K and sum Z8Z4Z2Z1, and the correction (+6) is applied when K + Z8Z4 + Z8Z2 = 1. Over all 200 valid inputs, in how many cases is the correction triggered by K = 1, and in how many by Z8Z4 + Z8Z2 with K = 0?

  1. A. 16 and 84
  2. B. 84 and 16
  3. C. 18 and 84
  4. D. 50 and 50

Correct answer: A. 16 and 84

Let s = a + b + c (0-19). The number of (a, b) pairs with a + b = t is t + 1 for t ≤ 9 and 19 − t for t ≥ 9. K = 1 means s ≥ 16: c = 0 needs a + b ≥ 16 (3 + 2 + 1 = 6), c = 1 needs a + b ≥ 15 (10): 16. s from 10 to 15 with K = 0: 100 − 16 = 84 (the total number of corrections is 100).

More Digital Logic questions

Exams that ask this topic