ITPEC FE Morning April 2021 Question 12

Which of the following is the performance of a CPU in MIPS when the instruction mix of the CPU is as listed in the table below? Here, the CPU does not use a pipeline architecture.

Instruction typeInstruction execution time in µsAppearance ratio
Register to register operation0.140%
Register from memory operation0.350%
Unconditional branch operation0.610%

Explanation

4 MIPS — weight each execution time by its appearance ratio, then take the reciprocal.

  • •Average time per instruction: 0.1 × 0.4 + 0.3 × 0.5 + 0.6 × 0.1 = 0.04 + 0.15 + 0.06 = 0.25 µs
  • •Instructions per second: 1 ÷ 0.25 = 4 per µs = 4 million per second

Answer (c)

Why not others:

  • •(a) 0.04 — the reciprocal of 25, the result in (d); it is also only the first term of the weighted sum
  • •(b) 0.25 — the average execution time in µs, before taking the reciprocal
  • •(d) 25 — the weighted sum with the percentages left as 40, 50 and 10, 0.1 × 40 + 0.3 × 50 + 0.6 × 10 = 25, which is 100 times the real average time, not a rate

Key rule: MIPS is the reciprocal of the average instruction time in µs; convert percentages to fractions before weighting.

Computer Component · AI-written, may contain errors

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.