Docsity

Electrical Engineering & Computer Science: Homework # 3 | EECS 645, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
EECS 645
Spring 2009
Homework Assignment # 3
due: March 3, 2009
1. Use the following code fragment:
Loop: LD R1, 0(R2)
DADDI R1, R1, #1
SD 0(R2), R1
DADDI R2, R2, #4
DSUB R4, R3, R2
BNEZ R4, Loop
Assume that the initial value of R3 is R2 + 396. Assume that a memory
location contains 2B.
25 pts. a. Show the timing of this instruction sequence for the MIPS64 pipeline
without any forwarding or bypassing hardware but assuming a register read and
a write in the same clock cycle. Assume that the branch is handled by flushing
the pipeline and that the branch is resolved in the stage MEM. How many clock
cycles does this loop take to execute?
25 pts. b. Show the timing of this instruction sequence with normal forwarding and
bypassing hardware. Assume that the branch is handled by predicting it as not
taken and that the branch is resolved in the stage ID. How many clock cycles
does this loop take to execute?
25 pts. c. Show the timing of this instruction sequence with normal forwarding and
bypassing hardware. Assume a single instruction delayed branch and that the
branch is resolved in the stage ID. Reschedule the instructions to increase
efficiency. You may modify the individual instruction operands. How many
clock cycles does this loop take to execute?
25 pts. 2. Suppose the control instruction frequencies (as percentages of all
instructions) are as follows:
branches 15%
jumps and calls 1%
Assume that 60% branches are taken. Assume four-deep pipeline where the
branch is resolved at the end of the second stage for jumps and calls and at the
end of the third stage for branches. Assuming that only the first pipeline stage
can always be done independently of whether the branch is taken or not and
ignoring other pipeline stalls, how much faster would the machine be without
any control instruction hazards?
Show your work.

Partial preview of the text

Download Electrical Engineering & Computer Science: Homework # 3 | EECS 645 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

EECS 645

Spring 2009

Homework Assignment # 3

due: March 3, 2009

  1. Use the following code fragment:

Loop: LD R1, 0(R2) DADDI R1, R1, # SD 0(R2), R DADDI R2, R2, # DSUB R4, R3, R BNEZ R4, Loop

Assume that the initial value of R3 is R2 + 396. Assume that a memory location contains 2B. 25 pts. a. Show the timing of this instruction sequence for the MIPS64 pipeline without any forwarding or bypassing hardware but assuming a register read and a write in the same clock cycle. Assume that the branch is handled by flushing the pipeline and that the branch is resolved in the stage MEM. How many clock cycles does this loop take to execute? 25 pts. b. Show the timing of this instruction sequence with normal forwarding and bypassing hardware. Assume that the branch is handled by predicting it as not taken and that the branch is resolved in the stage ID. How many clock cycles does this loop take to execute? 25 pts. c. Show the timing of this instruction sequence with normal forwarding and bypassing hardware. Assume a single instruction delayed branch and that the branch is resolved in the stage ID. Reschedule the instructions to increase efficiency. You may modify the individual instruction operands. How many clock cycles does this loop take to execute?

25 pts. 2. Suppose the control instruction frequencies (as percentages of all instructions) are as follows: branches 15% jumps and calls 1% Assume that 60% branches are taken. Assume four-deep pipeline where the branch is resolved at the end of the second stage for jumps and calls and at the end of the third stage for branches. Assuming that only the first pipeline stage can always be done independently of whether the branch is taken or not and ignoring other pipeline stalls, how much faster would the machine be without any control instruction hazards?

Show your work.