Practice Problems (Solution)

# Practice Problems (Solution) - Fall 2004 NAME 1 Execution...

This preview shows pages 1–4. Sign up to view the full content.

1 Fall 2004 NAME ___________________________________ 1. Execution Time (15 points): You are asked to choose between two approaches to reducing the impact of loads on processor performance on the multicycle datapath . For this problem, assume that R-type instructions ( add , sub , and , or , and slt ) account for 45% of all executed instructions, stores account for 15%, loads account for 20%, and branches account for 20%. Further assume that the application we are considering executes one million instructions and that the processor uses a 4 GHz clock. a. What is the execution time for the application we are considering on the machine described above? ET a is _____ 1.0e-3 s _________ CPI = .20 * 5 + (.45+.15) * 4 + .20 * 3 = 4 Cycle time = 0.25e-9 IC = 1.0e6 ET = CPI x cycle time x IC = 1.0e-3 b. One architect proposes a technique that increases load execution to 6 cycles (from 5 in the original datapath). However, this technique increases the clock rate of the processor by 15%. Calculate the execution time for the given workload with this change. ET b is ____ 0.91e-3 s ____________ CPI = .20 * 6 + (.45+.15) * 4 + .20 * 3 = 4.2 Clock rate = 4GHz * 1.15 = 4.6 GHz Cycle time = 0.217e-9 IC = 1.0e6 ET = 0.91e-3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Fall 2004 NAME ___________________________________ c. Another architect observes that many load instructions do not use their offset field (i.e. the offset is zero) and are closely followed by an add instruction that increments the result of the load by some other register. For example: lw r5, 0 (r8) add r5, r5, r7 This architect proposes to replace such instances with a single new instruction, law , that will perform the load and add together: law r5, r8, r7 This instruction will have the following functionality: R[r5] = M[R[r8]] + R[r7] The law instruction takes 5 cycles, and has no impact on the cycle time of the processor. Assume that 50% of loads can make use of this optimization. Calculate the execution time when using this approach. ET c is _____ .9e-3 s ___________ 50% of loads use this optimization – so 50% of the 20% of instructions that are loads means that 10% of all instructions will be law. Each law instruction replaces an lw and an add. A law takes the same number of cycles as a lw – so the 5 cycle instructions will stay the same. But the 4 cycle instructions will be reduced. CPI = .20 * 5 + .20 * 3 + .50 * 4 = 4 ------------------------------- .9 you could also have intuitively seen that this optimization only removes 4 cycle instructions (the law and lw effectively contribute the same amount to CPI) – and no matter how many 4 cycle instructions are removed, the CPI will still remain 4 unless the balance of 3 and 5 cycle instructions change. IC = .9e6 <- IC does drop by 10% Cycle time = .25e-9 ET = .9e-3
3 Fall 2004 NAME ___________________________________ 2. Impacting Performance (12 points): For the following, circle how the proposed change will impact CPI, # of instructions executed, and cycle time (i.e. an answer might be that CPI will increase, # of instructions executed will remain the same, and cycle time MAY decrease). Consider the multicycle datapath . Provide a brief justification of each answer and make sure you address each of the three components by clearly circling ONE option from each group.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern