29
Computer Engineering Rabie A. Ramadan Lecture 2

Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Embed Size (px)

DESCRIPTION

Architecture Development and Styles Performance is the main goal of any architecture Complex instructions Reduces the number of instructions to be used Small number of instructions to perform a job. Using different addressing modes that fits the required task Examples : Complex Instructions Set Computers (CISCs) such as : Intel PentiumTM, Motorola, MC68000TM, and the IBM & Macintosh PowerPCTM.

Citation preview

Page 1: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Computer Engineering

Rabie A. Ramadan

Lecture 2

Page 2: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Table of Contents

2

Architecture Development and Styles

Performance Measures

Amdahl’s Law

Page 3: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Architecture Development and Styles Performance is the main goal of any architecture

• Complex instructions • Reduces the number of instructions to be used

• Small number of instructions to perform a job.

• Using different addressing modes that fits the required task

• Examples: • Complex Instructions Set Computers (CISCs) such as :

• Intel PentiumTM, • Motorola, • MC68000TM, • and the IBM & Macintosh PowerPCTM.

Page 4: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Architecture Development and Styles (Cont.)

Speeding up some of the effective instructions• More than 80% of the instructions executed are those using:

• Assignment statements, conditional branching and procedure calls.

• Simple assignment statements constitute almost 50% of those operations.

• Optimizing such instructions enhances the performance

• Example: • Reduced Instructions Set Computers (RISCs) such as: • Sun SPARCTM and MIPS machines.

Page 5: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Amdahl’s Law and Performance Measure

Speedup : • a measure of how a machine performs after some enhancement

relative to its original performance.

Page 6: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Amdahl’s Law and Performance Measure (Cont.)

Not all program instructions execution time can be enhanced• May be part of it

• speedup due to the enhancement for a fraction of time

• For more than

Page 7: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Group Activity A machine for which a speedup of 30 is possible

after applying an enhancement. If under certain conditions the enhancement was only possible for 30% of the time, what is the speedup due to this partial application of the enhancement?

Page 8: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Answer

Page 9: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Performance Measures

Page 10: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Performance Measures

Performance analysis: • How fast can a program be executed using a given computer?

User Point of View • Time taken to execute a given job (program)

Lab Engineer• Total amount of work done in a given time.

Page 11: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Performance Measures (Cont.)

Definitions • Clock Cycle Time

• The time between two consecutive rising (trailing) edges of a periodic clock signal

• Cycle Count (CC)• The number of CPU clock cycles for executing a job

Page 12: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Performance Measures (Cont.)

Cycle Time (CT)• A mount of time taken by a cycle

Clock Frequency (f) / Clock Rate • f= 1/ CT

Page 13: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

First Performance Measure

The CPU time to execute a job is : • CPU time = Clock Count x Clock Time

Page 14: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Performance Measures (Cont.) The average number of Clock Cycles Per Instruction (CPI):

In case of the CPI per instruction is known :

Ii is the repetition time in the given job

Not All instructions take the same number of clock cycles

Page 15: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Performance Measures (Cont.)

The relation between the CPI and CPU Time:

Page 16: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Performance Measures (Cont.)

Another Measure is the rate of instruction execution per unit time: • Millions Instructions Per Second (MIPS)

Page 17: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Group Activity

Drive CPU Time and MIPS in terms of “Clock Rate”?

Page 18: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Group Activity Consider computing the overall CPI for a machine A for which the

following performance measures were recorded when executing a set of benchmark programs. Assume that the clock rate of the CPU is 200 MHz.

Page 19: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Answer Assuming the execution of 100 instructions, the overall

CPI can be computed as:

Page 20: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Group Activity Suppose that the same set of benchmark programs considered above

were executed on another machine, call it machine B, for which the following measures were recorded. What is the MIPS rating for the machine considered in the previous slide (machine A) and machine B assuming a clock rate of 200 MHz?

Page 21: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Answer

Page 22: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Group Activity Given the following benchmarks, compute the CPU time and

MIPS?

Page 23: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Solution

Be Carful using it as a performance measure. It does not consider the

execution time.

Page 24: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

More Performance Measures

Page 25: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Performance Measure Rate of floating-point instruction execution per unit

time• Million floating-point instructions per second (MFLOPS)• Defined only for subset of instructions where floating point is

used

Page 26: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Performance Measure (Cont.) Arithmetic Mean

• Gives a clear picture of the expected behavior of the system• Used to compare different systems based on Benchmarks

i is the execution time for the ith program n is the total number of programs in the set of benchmarks.

Page 27: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Performance Measure (Cont.) Example

Note: We could not decide on which system to use due to no great deal of variability

Program System A Execution Time

System B Execution Time

System C Execution Time

v 50 100 500

w 200 400 600

x 250 500 500

y 400 800 800

z 5000 4100 3500

Average 1180 1180 1180

Page 28: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Performance Measure (Cont.) Geometric Mean

• Gives a consistent measure with which to perform comparisons regardless of the distribution of the data.

i is the execution time for the ith program n is the total number of programs in the set of benchmarks.

Page 29: Computer Engineering Rabie A. Ramadan Lecture 2. Table of Contents 2 Architecture Development and Styles Performance Measures Amdahls Law

Performance Measure (Cont.) Example

Program System A Execution

Time

System B Execution Time

System C Execution Time

v 50 100 500

w 200 400 600

x 250 500 500

y 400 800 800

z 5000 4100 3500

Geometric mean

346.6 580 840.7