CSCI-242 Homework # 1, Fall 2021
1.Is a computer with a 4GHz clock always more efficient than a computer with a 3GHz clock? Explain why in your own words.
2.Suppose we have 10 tasks for CPU1 to perform, and CPU1 takes 3 units of time to perform a task.
○What is the throughput per unit of time?
○Suppose we add 3 processors to our system which are identical to CPU1 so we have a total of 4. What would the new throughput per unit of time be for the same 10 tasks? What is the new response time?
3.Consider two different implementations of the same instruction set architecture. The instructions from this set can be placed into four classes: A, B, C, and D. Suppose we have two processors: P1 and P2. P1 has a clock rate of 2.5 GHz and CPIs of 1, 2, 3, and 4 for each of the four classes. P2 has a clock rate of 3 GHz and CPIs of 2, 2, 2, and 3 for each of the four classes.
We want to test a particular program on each processor. This program has an instruction count of 1,000,000, 10% of which are class A, 20% class B, 50% class C, and 20% class D.
a.Find the global CPI for each implementation.
b.Find the number of clock cycles required to run the program on each processor
4.Suppose we have two different compilers, A and B, which each compile the same Java program to a particular computer’s machine language.
○Compiler A results in a program with 2.0 x 10 9 instructions and a CPU time of 1.1s.
○Compiler B results in a program with 2.4 x 109 instructions and a CPU time of 1.5s.
a.What is the average CPI for each compiler’s program if the computer’s processor has a clock cycle time of 1ns?
b.Suppose a new compiler C is developed which results in a program with 9.2 x 108 instructions and a CPI of 1.1. What is the speedup of using compiler C instead of compiler A? Instead of compiler B?
c.Suppose we run the programs compiled by compilers A and B on two separate computers. Suppose also that the CPU time for each is exactly the same. How much faster is the clock running compiler A’s code versus the clock running compiler B’s code? (Hint: the first step is to calculate the total cycles each program requires)