Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 ( 3 0 points ) . A MIPS assembly code is shown below. The assembly code is executed using a 5 - stage

Question 3(30 points). A MIPS assembly code is shown below. The assembly code is executed
using a 5-stage MIPS processor and we can actually decide the branch a little earlier, in ID instead
of EX. Answer the following questions:
Loop: sub $19,$19,$20
addi $9,$20,5
sw $9,0($21)
addi $10,$19,2
sll $10,$10,$3
add $10,$10,$21
addi $11,$20,1
sll $11,$11,3
add $11,$11,$21
Iw $11,0($11)
sub $9,$9,$11
sw $9,0($10)
beq $9,$0, Loop
addi $9,$12,2
a). How many clock cycles are needed to execute the code above? Assume there is no forwarding, no
branch prediction.
b). How many clock cycles are needed to execute the code above? Assume there is forwarding, no
branch prediction.
c). Reorder the above code to reduce the stalls (get the smallest number of stalls) without changing the
functionality. Assume there is forwarding and no branch prediction. How many clock cycles are needed
to execute the code above?
image text in transcribed

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

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

What kind of problem is this? How do I know?

Answered: 1 week ago

Question

e. What difficulties did they encounter?

Answered: 1 week ago