retagged by
1,243 views
0 votes
0 votes
A pipeline system has $4$ stages and each stage takes $10ns$.

$30\%$ instructions are branch-instructions and branch-instruction introduce a delay of $3$ stall cycles. The speed-up factor compared to same non-pipelined environment if there are $100000$ instructions to be executed is ___________.
retagged by

1 Answer

Best answer
8 votes
8 votes

Speedup factor = Time to execute 100000 inst on non pipeline machine/ Time to execute 100000 inst on pipelined machine

Time to execute 100000 inst on non pipeline machine = No of inst * No of stages of pipeline * time for each stage

100000 * 4 * 10                       - (A)

Time to execute 100000 inst on pipelined machine:

Clock cycles per inst = 1 + %Branch inst * No of Stall cycles due to branch

= 1 + 0.3 * 3 = 1.9

-> Time to execute 100000 inst = No of instructions * Clock cycles per inst *  time for 1 clock cycle(which is same as time taken by pipeline stage having maximum delay. Here each stage takes 10 ns).

= 100000 * 1.9 * 10.                     - (B)

Now, just divide (A) & (B) to get 2.105 as the answer.

Another method:

Speedup = No of pipeline stages/ 1 + %branch * no of stall cycles due to branch (This formula is derived by using argument similar to what is given above).

= 4/(1+0.3*3)

=2.105

edited by
Answer:

Related questions