GATE Computer ScienceModerateGATE CS (PYQ pattern)

A 1 GHz machine has instruction classes A, B, C with CPI 1, 2 and 3. For the same program, compiler X produces 5×10⁹ class-A, 1×10⁹ class-B and 1×10⁹ class-C instructions; compiler Y produces 10×10⁹ class-A, 1×10⁹ class-B and 1×10⁹ class-C instructions. Which code runs faster, and which has the higher MIPS rating?

  1. A. Y runs faster; Y has the higher MIPS
  2. B. X runs faster; X has the higher MIPS
  3. C. X runs faster; Y has the higher MIPS
  4. D. Y runs faster; X has the higher MIPS

Correct answer: C. X runs faster; Y has the higher MIPS

Cycles: X = 5 + 2 + 3 = 10×10⁹ → 10 s; Y = 10 + 2 + 3 = 15×10⁹ → 15 s, so X is faster. MIPS = instructions / time: X = 7×10⁹/10 s = 700, Y = 12×10⁹/15 s = 800. The slower code has the higher MIPS, because it is padded with cheap instructions.

More Computer Organization and Architecture questions

Exams that ask this topic