A CPU has a 3-stage pipeline. If branch prediction accuracy is 80%, what is the average instruction execution time if branch penalty is 2 cycles?
Q1. A CPU has a 3-stage pipeline. If branch prediction accuracy is 80%, what is the average instruction execution time if branch penalty is 2 cycles?
Answer: 1.4 cycles
Explanation: Average instruction execution time = 1 + branch penalty * (1 - branch prediction accuracy) = 1 + 2 * 0.2 = 1.4