Week 10 Part 02 - Processor Performance (Answers)
Week 10 Part 02 - Processor Performance (Answers)
Week 10
Processor Performance
Defining Performance
Airplane Passenger capacity Cruising range Cruising Speed Passenger
(miles) (m.p.h.) throughput
(passengers x
m.p.h.)
Boeing 777 375 4630 610
Boeing 747 470 4150 610
BAC/Sud Concorde 132 4000 1350
Douglas CD-8-50 146 8720 544
Defining Performance
Airplane Passenger capacity Cruising range Cruising Speed Passenger
(miles) (m.p.h.) throughput
(passengers x
m.p.h.)
Boeing 777 375 4630 610 228 750
Boeing 747 470 4150 610 286 700
BAC/Sud Concorde 132 4000 1350 178 200
Douglas CD-8-50 146 8720 544 79 424
! !
>
"#$%&'()* +(,$. "#$%&'()* +(,$-
Relative Performance
• Performance for a program on a particular machine
!.#⨉#4⨉!4!(,()-.
6 seconds = %)*(+ 012-3
!.#⨉#4⨉!4!(,()-. 8⨉!4!(,()-.
Clock rateB = 5 .-(*67.
= .-(*67
= 4GHz
• To run the program in 6 seconds, B must have twice the clock rate of A.
Instruction Performance
• The execution time must depend on the number of instructions in a
program.
• Clock cycles per instruction (CPI) is the average number of clock cycles
each instruction takes to execute.
Example
• Suppose we have two implementations of the same instruction set
architecture.
• Computer A has a clock cycle time of 250 ps and a CPI of 2.0 for some
program, and computer B has a clock cycle time of 500 ps and a CPI of
1.2 for the same program.
• Which computer is faster for this program and by how much?
Example
• Suppose we have two implementations of the same instruction set
architecture.
• Computer A has a clock cycle time of 250 ps and a CPI of 2.0 for some
program, and computer B has a clock cycle time of 500 ps and a CPI of
1.2 for the same program.
• Which computer is faster for this program and by how much?
Average clock cycles per
CPU clock cycles = Instructions for a program ⨉
instruction
CPU Execution
Time for a program = CPU Clock Cycles for a program ⨉ Clock cycle time
CPU clock cycles = Instructions for a program ⨉ Average clock cycles per instruction
Answer
CPU Execution Time = CPU Clock Cycles for a program ⨉ Clock cycle time
for a program
Computer A has a clock cycle time of 250 ps and a CPI of 2.0 for
some program, and computer B has a clock cycle time of 500 ps
and a CPI of 1.2 for the same program.
• For a particular high-level language statement, the compiler writer is considering two code
sequences that require the following instruction counts:
• Which code sequence executes the most instructions? Which will be faster? What is the CPI
for each sequence?
CPI for each instruction class
A B C
Answer CPI 1 2 3
Code from A B C
Compiler 1 5 1 1
Compiler 2 10 1 1
A. Which processor has the highest performance expressed in instructions per second?
• The clock rate is the reciprocal of clock cycle - a frequency, how many cycles per sec (e.g., 100MHz).
• Clock cycles per instruction (CPI) is the average number of clock cycles each instruction takes to execute.
Answer
Clock rate
(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?