A processor has a 5-stage pipeline. If it has a branch prediction accuracy of 90%, what is the average instruction execution time if branch penalty is 2 cycles?
Q1. A processor has a 5-stage pipeline. If it has a branch prediction accuracy of 90%, what is the average instruction execution time if branch penalty is 2 cycles?
Answer: 1.1 cycles
Explanation: Average instruction execution time = 1 + branch penalty * (1 - branch prediction accuracy) = 1 + 2 * 0.1 = 1.2, but since the branch is resolved in the 5-stage pipeline, the effective penalty will be considered, hence for 2 cycles penalty, it will be 1.