-1
$\begingroup$

Suppose you design a computer with a ten-stage Pipeline to execute one instruction, with each stage taking 5nsec

A)how long will it take to execute a program that has 30 sequential instructions. Answer: 195nsec

B) how long will it take to execute a program that has 30 sequential instructions in a non-pipeline computer Answer: 1500nsec

can some one please help me to understand how was the answer achieved.

$\endgroup$
  • 1
    $\begingroup$ I suggest that you read up on how pipelines work. These are very simple calculations once you understand that. $\endgroup$ – David Richerby May 31 '17 at 9:52
1
$\begingroup$

Suppose the first instruction enters the pipeline at time $0$. Each successive instruction enters $5$ ns after the previous one. The first instruction exits the pipeline at time $10\cdot 5$ ns and each of the other $29$ instructions exits $5$ ns after the previous one. In sum, $10 \cdot 5 + 29 \cdot 5 = 195$ ns.

For the non-pipelined processor, the somewhat pessimistic assumption is made that each instruction takes $10\cdot 5$ ns to execute; then, $30 \cdot 50 = 1500$.

$\endgroup$
1
$\begingroup$

An instruction needs 10 times 5 nsec to execute. With pipelining, the next instruction can start when the previous one is in the next pipeline stage, that is 5 nsecs after the previous one started. Without pipelining, the next instruction starts only when the previous one has finished, that is after 10 times 5 sec. The rest is basic arithmetic.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.