Quiz 2 - Sol
Quiz 2 - Sol
Question1: Suppose we want to execute the following program on a computer with two execution units
that have the following latencies. (10+10+5) marks
Adder 2 cycles
Multiplier 3 cycles
You have to show the execution of two iterations of this loop. You can move an instruction from one
stage of the processor to the other as soon as a slot is available in the next stage. Instruction wait in the
decode stage in case there is any dependency. Forwarding is implemented. After branch we need a
cycle to avoid wrong fetching of next instruction.
a. In-order issue and out-of-order execution rules are applied. For each cycle, show which
instructions in at which stage by filling the following table. You don't need to write complete
instructions. Just write the instruction numbers from the code above. Remember you cannot re-
arrange the instructions for this part of the question.
b. Now unroll the loop for level-2 (2 iterations only) and reschedule (rearrange) the instructions to
get best execution time with the specifications described above.
c. Show the execution of this sequence of instruction for In-order issue and out-of-order execution
and completion.