next up previous
Next: Problem 3 Up: work3-ans Previous: Problem 1

Problem 2

Now, we have a branch penalty of 2 clock cycles. That will not affect neither the execution profile nor the $CPI$ of any one iteration of the loop since no extra stalls will appear within any iteration caused by the new treatment of branches. The stalls will appear between the iterations of the loop. Starting from the second iteration, the fetching of the first instruction will be delayed by 2 clock cycles because of the branch penalty. Then, we get the same table as in Problem 1 and the same $CPI$ for one iteration of the loop. For the entire loop we get


\begin{displaymath}CPI_{Entire Loop} = \frac{21 + (21 - \mathbf{2})\times 99}{800} = 2.3775\end{displaymath}



MM Hugue 2002-11-05

Web Accessibility