Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem 1: Given the following code: w St1, 0($s1) add $to, ?to, St1 1. ldentify

ID: 3700663 • Letter: P

Question

Problem 1: Given the following code: w St1, 0($s1) add $to, ?to, St1 1. ldentify al the dns in the code. 2. Execute the code on a pipelined computer by filling in the slots of a table similar to the following one, where each row represents an instruction and each column represents a clock cycle. Assuming forwarding is available, insert stalls where they are necessary and calculate the total clock cycles Instruction 1 23 4 5 6 7 8 lw Sto, O(Ss0) lw St1, 0 (Ss1) IF | ID | EX | MEM | WB IF | ID | EX | MEM |WB

Explanation / Answer

(1) Ans :

lw $t0, 0($s0) # this loads a word from data from memory address of $s0.

lw $t1, 0($s1) # this loads a word from data from memory address of $s1.

sw $t0, 0($s0) # this stores register value $t0 in data in memory address given by $s0.