Question

A 5­stage single pipeline computer uses the pipeline mentioned in the lecture (not the book). It resolves the direction and target of a conditional branch instruction at the end of its third pipeline stage. When a branch is detected, the pipeline quashes the subsequent instructions already in the pipeline and stalls until the branch is resolved. After that, execution resumes at the target or the fall-through instruction, based on the branch condition. How many cycles does the pipeline stall upon a branch? (i.e, how many cycles are lost?)