retagged by
1,090 views
2 votes
2 votes
A CPU has five-stage pipeline where each stage takes $1\hspace{0.1cm}ns$, $2\hspace{0.1cm}ns$, $1.5\hspace{0.1cm} ns$, $3\hspace{0.1cm}ns$, $2.5\hspace{0.1cm} ns$. Instruction fetch happens in the first stage of the pipeline. A conditional branch instruction computes the target address and evaluates the condition in the third stage of the pipeline. Assume that each stage requires one clock cycle. $30\%$ of the instructions are conditional branches. Find the average execution time of the program for $1200$ instructions is ________.
retagged by

2 Answers

Best answer
1 votes
1 votes

total instructions =1200

Time period of clk=max{1,2,1.5,3,2.5}=3ns

30% of the instructions are conditional branches.So total clk cycles required to execute (1200*$\frac{30}{100}$)=360 instructions=(3*360)=1080.Because a conditional branch instruction computes the target address and evaluates the condition in the third stage of the pipeline(leads to take 3 clk cycles for completing single instruction).

For remaining 70%,i.e (1200-360)=840 non branch instructions one required 5 clk cycle and others 839 required 1 clk cycle each.so total (5+839*1)=844 clks required.

so total (844+1080)=1924 clk cycles needed

Therefore average execution time of the program for 1200 instructions is =(1924*3)ns=5772ns

selected by
2 votes
2 votes

........

edited by

Related questions

0 votes
0 votes
1 answer
1