Quiz 1 Review
ECE 252, Fall 2019
Quiz Notes
• Quiz 1: Tuesday October 8th 2019
• 6:00 PM → 8:00 PM; 2.0 Hours,
• Closed Book, Closed Notes,
... [Show More] No devices with
internet connectivity allowed
• One single sided cheat sheet only
• Calculators allowed
• Topics covered in class (and in HW assignments)
on Chapter 1, 2, 3 of text
Today
•Sample Problems from Chapters 1,2 & 3
•Tick-Tock procedure:
•Problem solution by Instructor
•Student solution on next
Ch 1, Problem 1
• Consider three different processors P1, P2, and P3 executing the
same instruction set. P1 has a 3 GHz clock rate and a CPI of 1.5. P2
has a 2.5 GHz clock rate and a CPI of 1.0. P3 has a 4.0 GHz clock rate
and has a CPI of 2.2.
a. Which processor has the highest performance expressed in instructions per
second?
b. If the processors each execute a program in 10 seconds, find the number of
cycles and the number of instructions.
c. We are trying to reduce the execution time by 30%, but this leads to an
increase of 20% in the CPI. What clock rate should we have to get this time
reduction?
1a
IPS = Cycles per Second/Cycles per Instruction
A measure of throughput – or rate of doing work
• Performance of P1: 3GHz/1.5 = 2 x 109 Inst/sec
• Performance of P2: 2.5GHz/1.0 = 2.5 x 109 Inst/sec
• Performance of P3: 4GHz/2.2 = 1.8 x 109 Inst/sec
• CPI can be as relevant to processor performance as clock frequency
• Faster clocks may not always be a good thing – higher power
dissipation, worse reliability, worse coupling noise… and not the best
rate of processing instructions!
1b
• # of cycles = Cycles per second x time (in seconds)
• Cycles of P1: 3 GHz x 10 s = 30 B cycles
• Cycles of P2: 2.5GHz x 10 s = 25 B cycles
• Cycles of P3: 4 GHz x 10s = 40 B cycles
Assuming a metric of wall clock time to execute a given
benchmark program,
P3 consumed more clock cycles – more power to do the same
work
P2 consumed the least number of clock cycles to do the same
work
Lower CPI translates into higher productivity and higher
energy efficiency as a result
1b contd..
• # of Instructions = Cycles / CPI
• # of Instructions of P1: 30 B cycles/1.5 Cycles per Instruction = 20B
• # of Instructions of P2: 25 B cycles/1 Cycles per Instruction = 25B
• # of Instructions of P3: 40 B cycles/2.2 Cycles per Instruction = 18.18B
1c
• Lower execution time trades off with higher CPI & higher FCLK
• Assuming 30% reduction in execution time requires 20% higher
CPI
# Instructions x CPI_new / ET_new = Fclk_new
Fclk_new P1 = 20 B x 1.8 / 7s = 5.14 GHz
Fclk_new P2 = 25 B x 1.2 / 7s = 4.28 GHz
Fclk_new P1 = 18.18 B x 2.6 / 7s = 6.75 GHz
High CPI processors require even higher Clock rates to get
the same % improvement in execution time
Ch 1, Problem 2
Compilers can have a profound impact on the performance of an
application. Assume that for a program, compiler A results in a dynamic
instruction count of 1.0E9 and has an execution time of 1.1 s, while
compiler B results in a dynamic instruction count of 1.2E9 and an
execution time of 1.5 s.
a. Find the average CPI for each program given that the processor has a clock
cycle time of 1 ns.
b. Assume the compiled programs run on two different processors. If the
execution times on the two processors are the same, how much faster is the
clock of the processor running compiler A’s code versus the clock of the
processor running compiler B’s code?
c. A new compiler is developed that uses only 6.0E8 instructions and has an
average CPI of 1.1. What is the speedup of using this new compiler versus using
compiler A or B on the original processor?
2a
• CPI = ETime x Fclk / Instr Count
• Compiler A CPI = 1.1s x 1GHz / 1 B = 1.1
• Compiler B CPI = 1.5s x 1GHz / 1.2 B = 1.25
On a given machine with a given clock frequency, different
compilers that generate machine instructions using the same
instruction set architecture can differentiate in achieving lower
CPI and higher performance as a result
2b
• Assume the processors are different and Execution times
are now the same
• How much faster is clock running B’s code Vs clock running A’s
code? [Show Less]