CS计算机代考程序代写 Quiz11

Quiz11
Due No due date Points 10
Questions 4 Available until Mar 17 at 4:20pm Time Limit 60 Minutes
Instructions
You can take this quiz only once.
Once you start the quiz, you will need to complete it.
This quiz was locked Mar 17 at 4:20pm.
Attempt History
Attempt Time Score
LATEST Attempt 1 5 minutes 4 out of 10
Score for this quiz: 4 out of 10 Submitted Mar 17 at 4:03pm This attempt took 5 minutes.
Question 1
0 / 2 pts
For the code sequence below, state whether it must stall (and forward), can avoid stalls using only forwarding, or can execute without stalling or forwarding.

lw $t0, 0($t1) add $t2, $t3, $t0
it must stall (and forward)
it can avoid stalls using only forwarding
orrect Answer
ou Answered
it can execute without stalling or forwarding
The data at 0+$t0 from the memory needs to be used for ALU of add
Question 2
2 / 2 pts
For the code sequence below, state whether it must stall (and forward), can avoid stalls using only forwarding, or can execute without stalling or forwarding.
add $t1, $t0, $t0 add $t2, $t0, $t5 add $t4, $t6, $t0
Y

it must stall (and forward)
it can avoid stalls using only forwarding
it can execute without stalling or forwarding
There is no data dependency
Correct!
Question 3
2 / 2 pts
For the code sequence below, state whether it must stall (and forward), can avoid stalls using only forwarding, or can execute without stalling or forwarding
add $t1, $t0, $t4 add $t2, $t1, $t4 add $t8, $t7, $t4 add $t3, $t6, $t4 add $t5, $t3, $t4

it must stall (and forward)
it can avoid stalls using only forwarding
it can execute without stalling or forwarding
The result $t1 from ALU of the first add needs to be used for ALU of the second add.
Also the result of $t3 from ALU of the 4th add needs to be used for ALU of the 5th add.
Correct!
Question 4
0 / 4 pts
Consider executing the following code on the pipelined datapath we discussed in class:
lw $t4, 100($t2) sub $t6, $t4, $t3 add $t2, $t3, $t5

How many cycles will it take to execute this code? Identify the data dependencies that need to be resolved, and check if they can be resolved by forwarding or need any stall.
8 (with margin: 0)
ou Answered
orrect Answers
3
There will be a bubble of 1 cycle due to the dependency between the lw and sub instructions, in addition to other cycles to execute them.
Quiz Score: 4 out of 10
Y