in CO and Architecture edited by
100 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?
in CO and Architecture edited by
100 views

2 Comments

is the answer is 2.24 ns?
1
1
Yes, can you explain
0
0

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