edited by
2,252 views
1 votes
1 votes

We need to calculate average instruction execution time here. Actually I don't get the meaning of branch need not be taken, branch is taken. Kindly help me to solve this please! Thank You

edited by

5 Answers

4 votes
4 votes

As , question is saying , for branches we have to complete the instruction and then move to a target address so it will take 2 * 5 =10 ns 

Hence, if branching happens (branch is taken), it will take 10 ns and 

if branch is not taken, which means sequential flow will be there , hence it will take 2ns ,as 1 instruction completes in 1 cycle for an ideal pipeline.

Hence,average instruction execution time is ===> 

(unconditional branch * time)  +  (conditional branch(branch taken * time + branch not taken * time)))

= 0.2 × 2 + 0.8 ( 0.5 * 10 + 0.5 * 2)

= 5.2 ns

edited by
3 votes
3 votes

To find the AVG lets take there is 100 instruction

Total time taken by 100 instruction is =   40*5 + 40*1 +20*1 ==>260 clock cycle

AVG=260 clock cycle/100 =2.6 clock cycle

1 clock cycle is 2ns

AVG time= 2.6*2 ns  ===> 5.2 ns

1 votes
1 votes

Lets assume that there are 100 instructions.

Now, given that 80% are conditional branch instructions. Thus, 80 instructions are conditional branch.

1. Now, 50% of 80 instructions take the branch. That amounts to 40 instructions.

    Lets assume this amount equal to CBT(conditional branch taken).

2. Also, 50% of 80 instructions dont take the branch. That amounts to 40 instructions.

    Lets assume this amount equal to CBNT(conditional branch not taken).

3. Other instructions( OI ) = 20

Now, given that CBT instructions dont overlap i.e. they execute sequentially.

So, total time taken for CBT is = 40ins * 5stages * (2ns/cycle) = 400ns

Remaining instructions i.e.( CBNT + OI ) execute as per the normal pipeline procedure.

So, total time for (CBT + OI) = (60 + 4)stages * (2ns/cycle) = 128ns

So, total time required to execute 100 ins = 400 + 128 = 528ns

Thus, avg time required for 1 ins = ${528}/{100}$ = 5.28ns

0 votes
0 votes
Ans==5.2ns

   100% in which 80%(Conditional) and 20%NC

in 80% ,50%BT and 50%BNT

Tavg=08(0.5*2*5+0.5*2)+0.2*2=5.2ns

Related questions

3 votes
3 votes
3 answers
1
Jaspreet Singh asked Jun 22, 2016
3,733 views
Below is the screenshot of the question. I found that answer of the Q.10 is 7 and I unable to understand Q.11. Please correct me in Q.10 and Please explain Q.11 meaning a...
2 votes
2 votes
1 answer
2
Avir Singh asked Nov 20, 2018
2,385 views
Consider a device of 1MBPS is operating in a cycle stealing mode of DMA .Whenever 16 B word is available it is transferred into memory in 4 microseconds. What is the % of...