Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider a MIPS machine with a 5-stage pipeline with a cycle time of 4 ns. Assum

ID: 3680818 • Letter: C

Question

Consider a MIPS machine with a 5-stage pipeline with a cycle time of 4 ns. Assume that you are executing a program where a fraction f of all instructions immediately follow a load upon which they are dependent.

(a) With forwarding enabled what is the total execution time for N instructions, in terms of f?

(b) Consider a scenario where the MEM stage, along with its pipeline registers, needs 5 ns. There are now two options: (1) add another MEM stage so that there are MEM1 and MEM2 stages; (2) increase the cycle time to 5 ns so that the MEM stage fits within the new cycle time and the number of pipeline stages remain unaffected. For a program mix with the above characteristics, when is the first option better than the second. Your answer should be based on the value of f.

(c) Embedded processors have two different memory regions – a faster scratchpad memory and a slower normal memory. Assume that in the 6 stage machine (with MEM1 and MEM2 stages), there is a region of memory that is faster and for which the correct value is obtained at the end of the MEM1 stage itself while the rest of the memory needs both MEM1 and MEM2 stages. For the sake of simplicity assume that there are two load instructions load.fast and load.slow that indicate which memory region is accessed. If 30% of the fraction f mentioned above get their value from the fast memory, how does the answer to part (b) change?

Explanation / Answer

a)When pipeline is filled,

(1 – f)*N instructions take 1 cycle
f*N instructions take 2 cycles (including 1 cycle for load-use stall)
Total cycles = (1-f)*N + 2*f*N + 4 (then number of cycles to fill the pipeline)
Total time = 5*(N*(1+f) + 4)

b) Case 1:

Option 1 : Time = ((1-f)*N + 3*f*N) * 10 = (1 + 2*f)*10*N

Option 2: Time = ((1-f)*N + 2*f*N)*12 = (1 + f)* 12*N

Option 1 is better when (1+2*f+5)*10*x < (1+f+4)*12*x = f < ¼

c)

Option 1 : Time = ((1-f)*N + 0.4*2*f*N + 0.6*3*f*N)*10
= (1 + 1.6*f)*10*N
Option 1 is better when
(1 + 1.6*f)*10*N < (1 + f)*12*N = f < ½

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote