Given the following code I1 lw $t1, 8($s0) I2 bne $s0, $s1, LABEL I3 sub $s1, $t
ID: 645535 • Letter: G
Question
Given the following code
I1 lw $t1, 8($s0)
I2 bne $s0, $s1, LABEL
I3 sub $s1, $t1, $t0
...
LABEL: I100 add $t2, $t1, $s2
Assume that (a) forwarding is NOT implemented, (b)values in $s0 and $s1 are equal, and (c) no prediction strategy is used for bne.
4.1 Are there any data hazards in the pipeline? If yes, between which pairs of instructions do they happen. Are there any control hazards in the pipeline?
4.2 Show the status of the instruction pipeline, by inserting instructions, stages, and bubbles into appropriate cycle slots.
Instruction
Cycle 1
Cycle 2
Cycle 3
Cycle 4
Cycle 5
Cycle 5
Cycle 6
Cycle 7
Cycle 8
Instruction
Cycle 1
Cycle 2
Cycle 3
Cycle 4
Cycle 5
Cycle 5
Cycle 6
Cycle 7
Cycle 8
Explanation / Answer
Only 4.1
1. Yes, data hazards are there:
Between I1 and I3
Ref: http://www.cs.utexas.edu/users/mckinley/352/lectures/12.pdf
2. Yes, control hazards are also there:
Between I1 and I2
For 4.2
Please refer the below:
http://www.cs.utexas.edu/users/mckinley/352/lectures/12.pdf
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.