edited by
612 views
0 votes
0 votes
In a pipelined architecture Static branch prediction is used with branch taken assumption. Assume that 30% of the instructions executed for a program are branch instructions. Each stage has 2 nsec delay. Average Execution time(in nsec) if 80 % of the instructions are taken?
edited by

1 Answer

3 votes
3 votes
It is given $30$% of the instruction are branch instruction.

It is using static branch prediction which always assume branch is taken.

branch was taken =$80$% of the time

So,20% of the time branch was not taken but due to static branch prediction it assume branch was taken but it doesn’t .So this much time contribute to branch penalty.

Now Assuming branch is taken in EX-stage and the target branch instruction will be fetched in the next IF stage – so $2$ stall cycles per conditional branch taken.

So,Branch penalty=$2$ .

So, average CPI=$1+0.3*0.2*2$=$1.12 $cycle.

Now as it is using an uniform pipeline where each stage delay=2 ns.

So ,average instruction execution time$=1.12*2=2.24$ ns

Related questions

5 votes
5 votes
2 answers
1
Arjun asked Aug 27, 2015
2,347 views
Assume that 20 of the dynamic count of the total 100 instructions executed for a program are branch instructions. Delayed branching is used, with one delay slot. Assume t...