A CPU has a 3-stage pipeline. If branch instructions are 20% of total, what is the average CPI?
Q1. A CPU has a 3-stage pipeline. If branch instructions are 20% of total, what is the average CPI?
Answer: 1.4
Explanation: Assuming 2-cycle penalty for branch instructions, average CPI = (1 * 0.8) + (2 * 0.2) = 0.8 + 0.4 = 1.2, but since the pipeline has 3 stages, the branch penalty is 2 (or more) cycles, so the average CPI = 1 + (2 * 0.2) = 1.4.