Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Consider the following code segment: Listing 1 1. sll St0, $s3, 2 2. add $t0, $t0, $s6 3.1w $to , oSt0) 4. S11 $t1,

image text in transcribed
1. Consider the following code segment: Listing 1 1. sll St0, $s3, 2 2. add $t0, $t0, $s6 3.1w $to , oSt0) 4. S11 $t1, $s4, 2 5. add St1, Stl, Ss6 6. 1w St1, 0(St1) 7. add St0, St1, St0 8. addi St3, $s7, 32 a. Identify all hazards (structure, data, and control) that exist in this code. Identify the instruction with the line number. State whether or not the hazard can be resolved (e.g using forwarding), and whether or not a stall is required. How many cycles does this code take to execute on a 5 stage MIPS pipeline? Example: line X, control hazard, forwarding required, 1 stall cycle b. Optimize the code by rescheduling the instructions to avoid stalls. How many cycles c. Assume a single cycle processor has a cycle time of 10 ns. How many cycles will the d. Assume each stage of a 5 stage MIPS pipeline takes 3 ns. How many cycles would it take e. Compute the speedup factor for the optimized code in the multicycle implementation vs does your optimized code require to execute in a 5 stage MIPS pipeline? unoptimized code (Listing 1) take? How long would your optimized code take? to execute the unoptimized code? What about the optimized code? the single cycle implementation. 1. Consider the following code segment: Listing 1 1. sll St0, $s3, 2 2. add $t0, $t0, $s6 3.1w $to , oSt0) 4. S11 $t1, $s4, 2 5. add St1, Stl, Ss6 6. 1w St1, 0(St1) 7. add St0, St1, St0 8. addi St3, $s7, 32 a. Identify all hazards (structure, data, and control) that exist in this code. Identify the instruction with the line number. State whether or not the hazard can be resolved (e.g using forwarding), and whether or not a stall is required. How many cycles does this code take to execute on a 5 stage MIPS pipeline? Example: line X, control hazard, forwarding required, 1 stall cycle b. Optimize the code by rescheduling the instructions to avoid stalls. How many cycles c. Assume a single cycle processor has a cycle time of 10 ns. How many cycles will the d. Assume each stage of a 5 stage MIPS pipeline takes 3 ns. How many cycles would it take e. Compute the speedup factor for the optimized code in the multicycle implementation vs does your optimized code require to execute in a 5 stage MIPS pipeline? unoptimized code (Listing 1) take? How long would your optimized code take? to execute the unoptimized code? What about the optimized code? the single cycle implementation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions

Question

Recommend the key methods to improve service productivity.

Answered: 1 week ago