edited by
22,028 views
53 votes
53 votes
An instruction pipeline has five stages, namely, instruction fetch (IF), instruction decode and register fetch (ID/RF), instruction execution (EX), memory access (MEM), and register writeback (WB) with stage latencies $1$ ns, $2.2 $ ns, $2$ ns, $1$ ns, and $0.75$ ns, respectively (ns stands for nanoseconds). To gain in terms of frequency, the designers have decided to split the ID/RF stage into three stages (ID, RF1, RF2) each of latency $2.2/3$ ns. Also, the EX stage is split into two stages (EX1, EX2) each of latency $1$ ns. The new design has a total of eight pipeline stages. A program has $20\%$ branch instructions which execute in the EX stage and produce the next instruction pointer at the end of the EX stage in the old design and at the end of the EX2 stage in the new design. The IF stage stalls after fetching a branch instruction until the next instruction pointer is computed. All instructions other than the branch instruction have an average CPI of one in both the designs. The execution times of this program on the old and the new design are $P$ and $Q$ nanoseconds, respectively. The value of $P/Q$ is __________.
edited by

7 Answers

1 votes
1 votes

Old case :

stage latencies 1 ns, 2.2 ns, 2 ns, 1 ns, and 0.75 ns .

take MAX( 1 ns, 2.2 ns, 2 ns, 1 ns, and 0.75 ns) = 2.2 ns

P= Tavg(old) = (0.2*3*2.2)+(0.8*1*2.2)= 3.08 ns.  // here 0.2(for brach instn..) , 3(CPI) , 2.2(MAX time delay) , 0.8(non branch) ,   1(CPI),2.2(MAX time delay)

 

New Case :

Time taken in stages ={1 ns, 0.73ns, 0.73ns, 0.73ns , 1ns,1ns, 1 ns, and 0.75 ns}

MAX( 1 ns, 0.73ns, 0.73ns, 0.73ns , 1ns,1ns, 1 ns, and 0.75 ns) =1 ns

Q= Tavg(New) = (0.2*6*1)+(0.8*1*1) = 2 ns   // here 0.2(for brach instn..) , 6(CPI) , 1(MAX time delay) , 0.8(non branch) , 1(CPI), 1(MAX time delay)

P/Q=3.08/2 = 1.54 

 

 

0 votes
0 votes

$T_{avg}$ for old design,

$\text{P = (cycles for unbranched inst + cycles for branched inst ) ×cycle time = (0.8*1+0.2*3)*2.2 ns = 3.08 ns}$

and

$T_{avg}$ for new design,

$\text{Q = (cycles for unbranched inst + cycles for branched inst ) ×cycle time = (0.8*1+0.2*6)*1 ns = 2 ns}$

 

$\therefore \ \frac{P}{Q} = \frac{3.08}{2} = 1.54$

Answer:

Related questions