Lecture 02
Lecture 02
performance measures
Assoc. Prof. Dr. Ezgi Deniz Ülker
European University of Lefke
Department of Computer Engineering
COMP333- Computer Organization and Architecture
Outline
1. The fetch-execute cycle
2. Performance measures
The Fetch-Execute Cycle
The address is sent from the MAR along the address bus to the
Main Memory. The instruction at that address is found and
returned along the data bus to the Memory Buffer Register. At
the same time the contents of the Program Counter is increased
by 1, to reference the next instruction to be executed.
Detailed description of Fetch-Decode-Execute Cycle
1 1
• >
Execution time𝑋 Execution time𝑌
CPU execution time for a program = CPU clock cycles for a program X Clock cycle time
CPU execution time for a program = CPU clock cycles for a program / Clock rate
This formula makes it clear that the HW designer can improve performance by
reducing the number of clock cycles required for a program or the length of the clock
cycle.
Performance Measures-Computer Clock
Performance Measures-Computer Clock
• How many cycles are required for a program?
Performance Measures-Computer Clock
• Different number of cycles for different instructions.
Performance Measures- Units of period and
frequency
1 Hz = 1 Cycles / Second
e.g. 1000 (kHz) cycles in a second
Performance Measures- Improving
Performance Example
• Question: A program runs in 10 seconds on computer A, which has a 2GHz clock. We
are trying to help a computer designer build a computer B, which will run this
program in 6 seconds. The designer has determined that a substantial increase in the
clock rate is possible, but this increase will affect the rest of the CPU design, causing
computer B to require 1.2 times as many clock cycles as computer A for this program.
What clock rate should we tell the designer to target?
• Solution: first, find the number of cycles required for the program on computer A:
CPU time(A)= CPU clock cycles (A)/Clock rate (A)
10 seconds=CPU clock cycles (A)/2x10^9cycles/sec
CPU clock cycles(A)= 10secondsx2x10^9cycles/sec
CPU clock cycles (A) = 20x10^9 cycles (cont.)
Performance Measures- Improving
Performance Example
• CPU time for B can be found using this equation:
CPU time(B)= (1.2xCPU clock cycles(A)) / Clock rate (B)
6 seconds = (1.2x20x10^9cycles)/ Clock rate(B)
Clock rate (B)= (4x10^9cycles) cycles/second
= (4x10^9cycles)/second= 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.
100
CPI example
MIPS as a Performance Metric
• MIPS (millions of instructions per second) : MIPS is the
approximate number of instructions a CPU can execute in one
second. For example, the Intel 80386 (386) computer processor
was capable of performing more than five million instructions
every second, or 5 MIPS.
MIPS example
MIPS example
Summary of Performance Measures
End of the chapter.
Thank you all.
Assoc. Prof. Dr. Ezgi Deniz Ülker