GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A ROM converts an 8-bit unsigned binary number (0-255) into three BCD digits. The hundreds digit is stored in only 2 bits (it never exceeds 2), and any output bit that simply equals an input bit is wired directly instead of being stored. What is the minimum ROM size in bits?

  1. A. 256 × 10 = 2560
  2. B. 256 × 9 = 2304
  3. C. 128 × 10 = 1280
  4. D. 128 × 9 = 1152

Correct answer: D. 128 × 9 = 1152

The units digit has the same LSB as the binary number (10 is even), so that bit is wired straight through. The rest depends only on x >> 1: tens and hundreds are ⌊(x>>1)/5⌋ split into digits and the remaining units bits are (x>>1) mod 5. So the ROM needs 2⁷ = 128 words of 2 + 4 + 3 = 9 bits = 1152 bits.

More Digital Logic questions

Exams that ask this topic