Menu

[Solved]1 60 Points Consider Following Code Sequence Loop Add Tl T2 Lw T3 10 Lw T4 14 Sub T5 T4 T3 Q37170768

1. (60 points) Consider the following code sequence loop: add $to, $tl, $t2 lw $t3, 10 ($to) lw $t4, 14 ($to) sub $t5, $t4, $

1. (60 points) Consider the following code sequence loop: add $to, $tl, $t2 lw $t3, 10 ($to) lw $t4, 14 ($to) sub $t5, $t4, $t3 sw $t5, 18 ($t0) addi $t2, $t2, 4 slti $t6, $t2, 200 bne $t6, $zero, loop Assume that each datapath stage requires the following minimum amount of time to complete Instruction fetch (IF): 30 ns Instruction decode (ID): 20 ns Execute /address calculation (EX): 25 ns Memory access (MEM): 30 ns Register write back (WB): 20 ns o o o o o a. (10 points) How long will one loop iteration take in a single-cycle datapath? b. (10 points) How long will one loop iteration take in a multi-cycle datapath? c. (15 points) If we assume ideal pipelining (ie., no hazards and therefore no stalls), how long will one loop iteration take in a pipelined datapath? What is the speedup over the single-cycle and multi-cycle datapaths? d. (15 points) If we now assume a more realistic pipelined datapath without forwarding, how long will one loop iteration take? Show a revised code sequence that includes all necessary no-ops to support your answer e. (10 points) Which of the data hazards in this code can be completely resolved using forwarding? For each hazard, list the register number and the two instructions involved. Show transcribed image text 1. (60 points) Consider the following code sequence loop: add $to, $tl, $t2 lw $t3, 10 ($to) lw $t4, 14 ($to) sub $t5, $t4, $t3 sw $t5, 18 ($t0) addi $t2, $t2, 4 slti $t6, $t2, 200 bne $t6, $zero, loop Assume that each datapath stage requires the following minimum amount of time to complete Instruction fetch (IF): 30 ns Instruction decode (ID): 20 ns Execute /address calculation (EX): 25 ns Memory access (MEM): 30 ns Register write back (WB): 20 ns o o o o o a. (10 points) How long will one loop iteration take in a single-cycle datapath? b. (10 points) How long will one loop iteration take in a multi-cycle datapath? c. (15 points) If we assume ideal pipelining (ie., no hazards and therefore no stalls), how long will one loop iteration take in a pipelined datapath? What is the speedup over the single-cycle and multi-cycle datapaths? d. (15 points) If we now assume a more realistic pipelined datapath without forwarding, how long will one loop iteration take? Show a revised code sequence that includes all necessary no-ops to support your answer e. (10 points) Which of the data hazards in this code can be completely resolved using forwarding? For each hazard, list the register number and the two instructions involved.

Expert Answer


Answer to 1. (60 points) Consider the following code sequence loop: add $to, $tl, $t2 lw $t3, 10 ($to) lw $t4, 14 ($to) sub $t5, $… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *