Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following code sequence that might be used to compute the product of the elements of a small, 5 element vector that has already

Consider the following code sequence that might be used to compute the product of the elements of a small, 5 element vector that has already been loaded into registers $1 through $5:

mul $1, $1, $2

mul $1, $1, $3

mul $1, $1, $4

mul $1, $1, $5

Consider the dependences induced in this code segment and the corresponding data hazards created. Carefully think about the forwarding required to correctly resolve the hazards and, using a data path diagram showing the forwarding paths needed, explain what needs to be forwarded, from where and to where. Modify the equations given in class for MEM data hazards to handle this special case. Briefly explain why your equations make sense. Referring to the text book will be helpful for this question.

Given in class:

EX Hazards:

if(EX/MEM.RegWrite and (EX/MEM.RegisterRd != 0) and

(EX/MEM.RegisterRd = ID/EX.RegisterRs))then

Forward ALU result to 1st ALU input

if(EX/MEM.RegWrite and (EX/MEM.RegisterRd != 0) and

(EX/MEM.RegisterRd = ID/EX.RegisterRt))then

Forward ALU result to 2nd ALU input

MEM hazards:

if(MEM/WB.RegWrite and (MEM/WB.RegisterRd != 0) and

(MEM/WB.RegisterRd = ID/EX.RegisterRs))then

Forward ALU result to 1st ALU input

if(MEM/WB.RegWrite and (MEM/WB.RegisterRd != 0) and

(MEM/WB.RegisterRd = ID/EX.RegisterRt))then

Forward ALU result to 2nd ALU input

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_2

Step: 3

blur-text-image_3

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 Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

3. Explain the forces that influence how people handle conflict

Answered: 1 week ago