retagged by
430 views
0 votes
0 votes

Answer 1.03

retagged by

1 Answer

Best answer
2 votes
2 votes

Given,

$25$% of the instruction is conditional branch instruction.

$75$% of the time branch is taken .

$25$% of the time branch is not taken .

branch address calculated at $ID2$ stage .So branch penalty for it $(4-1)=3$ cycle

Condition evaluated at $EX2$ stage.So branch penalty for it $(4-1)=6$ cycle

Case 1: Predicted the branch is taken .

in predicted branch scheme we assume branch is taken always and at the evaluation stage if found branch not taken then stall occurs.

So average CPI=$1+0.25*0.75*3+0.25*0.25*5=1.875$ 

[75% time branch taken and we assume branch always taken so we just need to spend time for address calculation which is 3 clock cycle . Now if branch not taken that we get to know in ex2 state for which we incurs 5 clock cycle]

 


Case 2: Predicted the branch is not taken

Here we assume branch will not taken always when  a conditional branch instruction occurs .

Here average CPI$=1+0.25*0.75*5=1.9375$

because 75% of the time out of 25% branch instruction branch is taken for which we have stalls .

So assuming clock cycle time is same for both the cases speed up=$\frac{1.9375}{1.875}=1.03$

selected by

Related questions

1 votes
1 votes
1 answer
1
1 votes
1 votes
1 answer
2
SKMAKM asked Oct 20, 2022
443 views
Answer a,b,c,d
0 votes
0 votes
2 answers
3
SKMAKM asked Oct 21, 2022
339 views
Answer 1.18
0 votes
0 votes
0 answers
4
SKMAKM asked Oct 21, 2022
281 views
Answer 1.125