engineering computer science MCQ #182

A CPU has a 5-stage pipeline. If it takes 2 cycles to resolve a branch, what is the average instruction execution time if 20% instructions are branches?

engineering computer science MCQ #182

  1. Question 1

    Q1. A CPU has a 5-stage pipeline. If it takes 2 cycles to resolve a branch, what is the average instruction execution time if 20% instructions are branches?

    • A) 1.2 cycles
    • B) 1.4 cycles
    • C) 1.6 cycles
    • D) 1.8 cycles

    Answer: 1.4 cycles

    Explanation: Average instruction execution time = 1 + (branch penalty * branch frequency) = 1 + (2-1) * 0.2 = 1.2, but since branch is resolved in 2nd stage, effective penalty is considered from the next instruction, hence 1 + 0.2 * 2 = 1.4