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

a) Consider a processor implemented as a six stage pipeline. Suppose that the pi

ID: 3594289 • Letter: A

Question

a) Consider a processor implemented as a six stage pipeline. Suppose that the pipeline is initially empty, what is the number of cycles required to perform a sequence of 40 instructions that do not include any branching instructions? Also, what is the average cycles per instruction (CPI) for this given scenario?

b) Reconsider part a. Suppose that instead, one in 10 of the instructions is a branch instruction and that each branch introduces a penalty of four cycles. For this new scenario calculate the number of cycles required to perform the instructions and the average cycles per instruction (CPI) for this given scenario.

c) Reconsider the part a & b. Suppose the pipeline handles a dependency between calculations by stalling the pipeline for one cycle. Suppose on average one instruction in twenty has a data dependency. For this new scenario calculate the number of cycles required to perform the instructions along with the branches from exercise 2 as well as data dependencies, then calculate the average cycles per instruction (CPI) for this given scenario.

Explanation / Answer

A k-segment pipelining system to execute n-tasks requires

K+(n-1) clock cycles.

So four six stage pipeline system,

a)for a sequence of 40 instructions, number of cycles

6+40-1= 45

CPI(average number of clock cycles per instruction)= 1 (without any branching) ideally!!

b) For a sequence of 40 instructions with one out of 10 is a branch instruction where each branch instruction introduces penalty of 4 clock cycles, number of cycles can be calculated as:

6+40-1+4*4= 61

if branch instruction does not take one cycle excluding its penalty then number of clock cycles

6+40-4+4*4=57

CPI can be calculated as: (36*1+4*4)/40= 1.3

c)

As the pipeline handles a dependency between calculations by stalling the pipeline for one cycle, which are no-op instructions that merely delay the pipeline execution until the dependencies are no longer problematic with respect to pipeline timing.

number of cycles= 6+40-1+4*4+ 2(for one out of 20 extra cycle per stall)=63

CPI:

2 out of 20 means 1/20 means 5% of time, CPI= 1.3+1=2.3 (1 for 1 extra cycle)

95% of time, CPI= 1.3

New average CPI= 2.3*0.05+ 1.3*0.95=1.35

Thank you

Waiting for feedback..