Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider a 5-stage IF, ID, EX, MEM and WB pipeline as specified in Figure 4.46. Assume perfect branch prediction (no stalls due to control hazard).

Consider a 5-stage IF, ID, EX, MEM and WB pipeline as specified in Figure 4.46. Assume perfect branch prediction (no stalls due to control hazard). Data forward is used. In the case of data hazards, we need to stall the execution.

a) Draw the pipeline execution diagram. Make sure to indicate stalls and show data forwarding from a source stage to a destination stage.

b) How many clock cycles are needed to execute these instructions? [Hint: the instructions do terminate.]

I1: addi $s0, $zero, 2

I2: add $s1, $a0, $zero

I3: loop: lw $t0, 0($s1)

I4: lw $t1, 10($t0)

I5: add $s1, $t0, $t1

I6: addi $s0, $s0, -1

I7: bne $s0, $zero, loop

I8: add $v0, $s1, $zero

Figure 4.46:

image text in transcribed

An example of a Pipline Execution Diagram:

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_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

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions