Determine the total branch penalty for a branch-target buffer assuming the penalty cycles for individual misprediction from table below. Among the branches which are not in buffer, only 60% are taken. The prediction accuracy is 90% and hit rate in the buffer is 90%
(A) 0.3 clock cycles
(B) 0.18 clock cycles
(C) 0.12 clock cycles
While calculating the penalty, we will consider the probability of two events.
The branch is predicted as 'taken' but actually 'not taken' and the branch is taken but is not found in the buffer. Both carry a penalty of two cycles here.
Probability(branch in buffer but actually not taken) = buffer hit rate × incorrect prediction = 90% × 10% = 0.09
Probability(branch not in buffer but actually taken) = 10% × 60% = 0.06
Hence, branch penalty = (0.09 + 0.06) × 2 = 0.3 clock cycles