The following code adds integers in two arrays (whose address is $s0 and $s1) an
ID: 3771253 • Letter: T
Question
The following code adds integers in two arrays (whose address is $s0 and $s1) and stores the results in the first array. $s2 is initialized to 0. $s3 is 100. I1 : lw $t0 , 0( $s0 ) I2 : lw $t1 , 0( $s1 ) I3 : addu $t0 , $t0 , $t1 I4 : sw $t0 , 0( $s0 ) I5 : addi $s0 , $s0 , 4 I6 : addi $s1 , $s1 , 4 I7 : addi $s2 , $s2 , 1 I8 : bne $s2 , $s3 , I1 I9 : sll $0 , $0 , 0 Assume MIPS processors with a 5-stage pipeline. Assume the processor has all the forwarding paths needed. The conditional branch is resolved in the ID stage. show the pipeline diagram from the IF stage of I1 to the IF stage of I1 in the next iteration and compute the number of cycles needed for the loop. Scheduling instructions can remove some hazards that cannot be handled by hardware without pipeline stalls. Schedule the instructions in the above problem to reduce pipeline stalls. How many cycles do you need for your scheduled code?
Explanation / Answer
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.