Question: Problem 1 Consider the following MIPS code. I 0 : lw $s 1 , 0 ( $s 2 ) I 1 : add $s 5

Problem 1
Consider the following MIPS code.
I0: lw $s1,0($s2)
I1: add $s5,$s1,$s3 # $s5 := $s1+ $s3
I2: beq $s5,$s7, L1 # if ($s5= $s7) goto L1
I3: lw $s3,12($s4)
I4: sw $s5,0($s3)
I5: L1: sw $s5,12($s4)
A) Suppose a MIPS processor uses the simple 5-stage pipeline, where the stages are instruction fetch (IF), instruction decode and operand fetch (ID), execute and calculate address (EX), memory access (M), and write back (WB). In addition, suppose that:
The instruction and data cache are unified and can only support one read or write or instruction fetch operation each cycle.
The pipeline does not have forwarding hardware. Thus, if an instruction (i +1) relies on a value written into a register by an instruction (i), then the execute stage for (i +1) cannot proceed until the register write stage for (i) has completed.
In the absence of hazards, a new instruction can be fed to the pipeline every cycle.
Assume the branch is not taken.C) Suppose now that the Execution stage of the pipeline is split into two stages E1 and E2 and that instruction (i +1) cannot use E1 until instruction (i) has released E2, or more general E1 cannot be used again until E2 is finished processing. Using the assumptions from part B), how many cycles does this code take to complete? Use the table below.
T0
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
T17
T18
T19
I0
I1
I2
I3
I4
I5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!