GATE Computer ScienceHardGATE CS (PYQ pattern)

A 16-bit instruction set has 4-bit address fields and expanding opcodes: three-address instructions use a 4-bit opcode, two-address instructions take unused 4-bit prefixes and extend into one address field, and one-address instructions extend further in the same way. The design needs exactly 30 two-address instructions and at least 250 one-address instructions. What is the largest number of three-address instructions possible?

  1. A. 14
  2. B. 13
  3. C. 15
  4. D. 12

Correct answer: B. 13

With x three-address codes, (16 − x) × 16 two-address codes exist; after 30 are used, ((16 − x) × 16 − 30) × 16 one-address codes remain. Need ≥ 250 → (16 − x) × 16 ≥ 46 → 16 − x ≥ 3 → x ≤ 13. Check x = 14: (32 − 30) × 16 = 32 < 250.

More Computer Organization and Architecture questions

Exams that ask this topic