Assignment 2 Solution
Assignment 2 Solution
Assignment 2 - Solution
Due April 15, 2014
delay. Show the timing of this instruction sequence for the 10-stage RISC pipeline
with full forwarding and bypassing hardware. Use a pipeline timing chart like that
shown in Figure C.5. Assume that the branch is handled by predicting it as taken.
If all memory references take 1 cycle, how many cycles does this loop take to
execute?
f. Assume that in the 5-stage pipeline the longest stage requires 0.8 ns, and the
pipeline register delay is 0.1 ns. What is the clock cycle time of the 5-stage
pipeline? If the 10-stage pipeline splits all stages in half, what is the cycle time of
the 10-stage machine?
g. Using you answers from parts (d) and (e), determine the cycles per instruction
(CPI) for the loop on a 5-stage pipeline and a 10-stage pipeline. Make sure you
count only from when the first instruction reaches the write-back stage to the end.
Do not count the start-up of the first instruction. Using the clock cycle time
calculated in part (f), calculate the average instruction execute time for each
machine.
Solution
1586
2. [30 = 10 + 20] In this problem, we will explore how deepening the pipeline affects
performance in two ways: faster clock cycle and increased stalls due to data and
control hazards. Assume that the original machine is a 5-stage pipeline with a 1 ns
clock cycle. The second machine is a 12-stage pipeline with a 0.6 ns clock cycle. The
5-stage pipeline experiences a stall due to a data hazard every 5 instructions, whereas
the 12-stage pipeline experiences 3 stalls every 8 instructions. In addition, branches
constitute 20% of the instructions, and the misprediction rate for both machines is 5%.
a. What is the speed up of the 12-stage pipeline over the 5-stage pipeline, taking into
account only data hazards?
b. If the branch mispredict penalty for the first machine is 2 cycles but the second
machine is 5 cycles, what are the CPIs of each, taking into account the stalls due
to branch mispredictions?
Solution