Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please briefly explain your answer. thanks Problem 1: Given the following code: LOOP: w $5, 100($1) lw $6, 800($1) add $5, $5, $6 sw $5,

Please briefly explain your answer. thanks

image text in transcribed

image text in transcribed

Problem 1: Given the following code: LOOP: w $5, 100($1) lw $6, 800($1) add $5, $5, $6 sw $5, 100($1) addi $1, $1,-4 bne $1, ?Zero, LOOP Assume the initial value in $1 equals 400, such that the loop executes 100 iterations. 1. Execute the code on a pipelined computer based on the following assumptions: i) Forwarding is not available; ii) The branch decision is made during the EX phase, and if the branch is taken, the new PC is available by the end of the MEM phase (Fig. 4.51); iii)iii) Do not alter the code sequence a) Filling in the slots of the following table. Insert stalls where they are necessary b) How many cycles does the whole loop take to execute? Show your calculation. 1 2 3 4 5 6 7 8 9 1011 12 13 14 15 16 Instruction lw $5, 100 ($1 lw $6, 800($1 add $5, $5, $6 sw $5, 100($1 addi $1, $1, -4 bne $1, $Zero, LOOP **lw $5, 100($1 **This is the lw in the next iteration. Problem 1: Given the following code: LOOP: w $5, 100($1) lw $6, 800($1) add $5, $5, $6 sw $5, 100($1) addi $1, $1,-4 bne $1, ?Zero, LOOP Assume the initial value in $1 equals 400, such that the loop executes 100 iterations. 1. Execute the code on a pipelined computer based on the following assumptions: i) Forwarding is not available; ii) The branch decision is made during the EX phase, and if the branch is taken, the new PC is available by the end of the MEM phase (Fig. 4.51); iii)iii) Do not alter the code sequence a) Filling in the slots of the following table. Insert stalls where they are necessary b) How many cycles does the whole loop take to execute? Show your calculation. 1 2 3 4 5 6 7 8 9 1011 12 13 14 15 16 Instruction lw $5, 100 ($1 lw $6, 800($1 add $5, $5, $6 sw $5, 100($1 addi $1, $1, -4 bne $1, $Zero, LOOP **lw $5, 100($1 **This is the lw in the next iteration

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

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions