CS-320 Computer Organization and Architecture
Homework #7
Due: 04/15/2019
1. (25 points total) Consider the following loop.
LOOP:
ld x10, 0(x13)
ld x11, 8(x13)
add x12, x10, x11
subi x13, x13, 16
bnez x12, LOOP
Assume that perfect branch prediction is used (no stalls due to control hazards),
that there are no delay slots, that the pipeline has full forwarding support, and
that branches are resolved in the EX (as opposed to the ID) stage.
a. (20 points) Show a pipeline execution diagram for the first two iterations of
this loop.
Instr./cc
1
2
b. (5 points) Mark pipeline stages that do not perform useful work (you may
mark them on the above table, such as ME!).