Problems in this exercise refer to the following sequence of instructions, and assume that it is executed

Question:

Problems in this exercise refer to the following sequence of instructions, and assume that it is executed on a five-stage pipelined datapath:

add $s3, $s1, $s0

lw $s2, 4($s3)

lw $s1, 0($s4)

or $s2, $s3, $s2

sw $s2, 0($s3)

1. If there is no forwarding or hazard detection, insert NOPs to ensure correct execution.

2. Now, change and/or rearrange the code to minimize the number of NOPs needed. You can assume register $t0 can be used to hold temporary values in your modified code.

3. If the processor has forwarding, but we forgot to implement the hazard detection unit, what happens when the original code executes?

4. If there is forwarding, for the first seven cycles during the execution of this code, specify which signals are asserted in each cycle by hazard detection and forwarding units in Figure 4.59.

5. If there is no forwarding, what new input and output signals do we need for the hazard detection unit in Figure 4.59? Using this instruction sequence as an example, explain why each signal is needed.

6. For the new hazard detection unit from 4.26.5, specify which output signals it asserts in each of the first five cycles during the execution of this code.

Figure 4.59

Program execution order (in instructions) lw $2, 20($1) and becomes nop and $4, $2, $5 or $8, $2, $6 add $9,

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: