ITPEC FE Subject A April 2024 Question 8
There are two microprocessors: a 32-bit CPU capable of executing each of 32-bit, 16-bit, and 8-bit long instructions in 1 cycle, and a 16-bit CPU capable of executing each of 16-bit and 8-bit long instructions in 1 cycle. Additionally, the 16-bit CPU can execute a 32-bit long instruction in 2 cycles. When the appearance ratio of 32-bit long instructions is 40%, of 16-bit long instructions is 40%, and of 8-bit long instructions is 20% respectively, what is the percentage improvement in total execution time with the 32-bit CPU compared to the 16-bit CPU? Here, both the 32-bit and 16-bit CPU operate at the same clock speed and have the same performance except for the executable instruction length in 1 cycle.
Explanation
28.57% — compare the average cycles per instruction, and measure the saving against the slower 16-bit CPU.
Both CPUs run at the same clock, so execution time is proportional to cycles.
- •16-bit CPU: 0.4 × 2 + 0.4 × 1 + 0.2 × 1 = 1.4 cycles per instruction
- •32-bit CPU: 0.4 × 1 + 0.4 × 1 + 0.2 × 1 = 1.0 cycle per instruction
- •Improvement: (1.4 − 1.0) ÷ 1.4 ≈ 0.2857, about 28.57%
Answer (a)
Why not others:
- •(b) 40 — divides the saving by the new time, 0.4 ÷ 1.0; that is how much faster the 32-bit CPU is, not how much time is cut
- •(c) 50 — the saving on a single 32-bit instruction (2 cycles down to 1), ignoring that only 40% of instructions are 32-bit
- •(d) 71.43 — 1.0 ÷ 1.4, the new time as a share of the old one, not the reduction
Key rule: A percentage reduction in execution time is (old − new) ÷ old; dividing the same difference by the new time gives the speed-up instead.
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.