Ask Question
28 July, 18:20

Identify ALL of the data dependencies in the following code. Which dependencies are data hazards that can be resolved by forwarding? For each irresolvable data hazard, how many pipeline stalls will occur and in which instruction? Draw pipeline stages in the form of "IF ID EX MEM WB" to show stalls.

a. add $12, $15, $14b. lw $15, 100 ($12) c. sub $13, $15, $12d. add $12, $15, $13

+2
Answers (1)
  1. 28 July, 22:14
    0
    See the explanation for the answer.

    Explanation:

    add $12, $15, $14 IF ID EX MEM WB

    lw $15, 100 ($12) IF ID EX MEM1 MEM2 WB

    sub $13, $15, $12 IF ID EX MEM1 WB

    add $12, $15, $13 IF ID EX MEM WB

    sub $13,$15,$12 - dependencies-$15,$12

    hazards-$12-read before write data hazard - can be solved through forwarding

    $15-structural hazard-stalled by 3 clock cycle (if no forwarding)

    -stalled by 1 clock cycle (if forwarding is present)

    add $12,$15,$13 - dependencies $15,13

    hazards-$12,$15-read before write data hazard - can be solved through forwarding
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Identify ALL of the data dependencies in the following code. Which dependencies are data hazards that can be resolved by forwarding? For ...” in 📘 Business if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers