Pipelining and Branch Prediction

The single stage CPU has 10 layers of circuitry and 1 layer of latches

A multi-stage pipeline has to execute the same 10 layers of
circuitry and will have a latch for each stage.

What is the time required to execute one instruction on the single stage CPU?

What is the time required to execute one stage on a 10-stage CPU?

What is the time required to execute one instruction on a 10-stage CPU?

What is the time required to execute one instruction on a 5-stage CPU?

What is the speedup for 1000 instructions using a 5-stage CPU?

What is the speedup for 1000 instructions using a 10-stage CPU?

Assume that the CPU uses branch prediction to estimate which
instruction to fetch next in the case of a conditional branch. When
answering the following problems, assume that 20% of the instructions
are conditional branches.

What is the probability there are no conditional branches currently
being executed in a 5-stage pipeline?

What is the probability there are no conditional branches currently
being executed in a 10-stage pipeline?

Assume that it is known whether branch prediction failed during the
last stage of the pipeline. Further assume that there is zero time
cost to fetching the right instruction and start it executing.

What is the time delay between the discovery of the failed branch
and the proper next instruction completing execution for a 5-stage
pipeline?

What is the time delay between the discovery of the failed branch
and the proper next instruction completing execution for a 10-stage
pipeline?