# how long will it take to execute a ten-stage pipeline

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

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$.