Question: Problem 6 Consider the following segment of a program. Assume all registers were initialized to 0 before execution. ADD R 1 , R 1 ,

Problem 6
Consider the following segment of a program. Assume all registers were initialized to 0 before
execution.
ADD R1, R1, #3
MUL R2, R1, #4
DIV R2, R2, #6
ADD R3, R3, #9
SUB R2, R3, R1
This code is run on a pipelined, out-of-order machine with 4 functional units (add, subtract,
multiply, divide). The add and subtract functional units take 1 cycle to execute. The multiply
functional unit takes 4 cycles to execute, and the divide functional unit takes 5 cycles to
execute.
Depict a data-flow diagram of the program segment.
How many cycles would this program segment take to run, if the machine were utilizing
the original Tomasulo algorithm, i.e. no Reorder Buffer.
How many cycles would this program segment take to run, if the machine were utilizing
the improved Tomasulo algorithm, i.e. there is a Reorder Buffer.
Compare your answers to questions 2 and 3. Is the original version faster? Is it closer in
execution to your data-flow diagram from question 1? If so, why do we prefer the
improved version? Is the problem of the original algorithm showcased in this program
segment?
Problem 6 Consider the following segment of a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!