[go: up one dir, main page]

0% found this document useful (0 votes)
44 views74 pages

Chapter 1introduction Comp Arch

Uploaded by

Babe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views74 pages

Chapter 1introduction Comp Arch

Uploaded by

Babe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 74

COMPUTER ARCHITECTURE &

ORGANIZATION

Introduction
1
CONTENTS

 Introduction to basic computer

 Computer Architecture and Organization

 Computer Evolution

 Performance evaluation

2
INTRODUCTION TO BASIC COMPUTER
What is Computer?
➢ A device that accepts input, processes data, stores
data, and produces output, all according to a series of
stored instructions.

➢ An electronic device that has the ability to store,


retrieve, and process data and can be programmed
with instructions that it remembers.
3
INTRODUCTION TO BASIC COMPUTER
What is Computer?
➢ Hardware
➢ The physical parts that make up a computer

➢ Includes CPU, Memory, I/O device…

➢ Software
➢ Programs that tell a computer what to do

➢ Includes Operating system and other application software


4
BIG PICTURE
 Since 1946 all computers have had 5 components

5
COMPUTER FUNCTIONAL UNITS

 Input Unit

 Output Unit

 Central processing Unit


 ALU and Control Units

 Memory

 Bus Structure

6
COMPUTER FUNCTIONAL UNITS

 INPUT UNIT
 Converts the external world data to a binary
format, which CUP can understand
 Mouse, Joystick , Keyboard etc

 OUTPUT UNIT
 Converts the binary format data to a format
that a common man can understand
7
 Monitor, Printer, LCD, LED etc
COMPUTER FUNCTIONAL UNITS..

 CPU (Central Processing Unit)


 The “brain” of the machine

 carrying out computational task

 ALU, Control unit, Registers


 Arithmetic and logical operations

 CU Provides control signals in accordance with some timings


which in turn controls the execution process

 Register stores data and result and speeds up the operation

8
COMPUTER FUNCTIONAL UNITS..
 MEMORY

 Stores data, results, Instruction


 Two class of storage
 (i) Primary (ii) Secondary

 Two types
 RAM or R/W memory and
 ROM read only memory

 ROM is used to store data and program which is not


going to change.
 Secondary storage is used for bulk storage or mass
storage
9
COMPUTER FUNCTIONS
 Data processing
 Data may take a wide variety of forms and the range of
processing requirements is broad
 Data storage
 Short-term or Long-term
 Data movement
 Input-output (I/O) via peripheral
 Data communications –over longer distances, or from a
remote device
 Control
10
 A control unit manages the computer’s resources
COMPUTER ARCHITECTURE AND ORGANIZATION

 Computer organization
 operational units and their interconnections that
realize the architectural specifications

 Computer architecture
 is the science of integrating those components to
achieve a level of functionality and performance.

11
COMPUTER ARCHITECTURE AND ORGANIZATION

•Attributes of a system •Instruction set, number


visible to the programmer of bits used to represent
•Have a direct impact on various data types, I/O
the logical execution of a mechanisms, techniques
program for addressing memory

Architectural
Computer
attributes
Architecture
include:

Organizational
Computer •The operational units
attributes
•Hardware details Organization and their
include:
transparent to the interconnections that
programmer, control realize the
signals, interfaces between architectural
the computer and specifications
peripherals, memory
technology used 12
INSTRUCTION SET ARCHITECTURE
 A term that is often used interchangeably with computer
architecture
 is the attributes of a computing system as seen by the
programmer
 It deals with
 The Instruction Set (what operations can be performed?)
 The Instruction Format (how are instructions
specified?)
 Data storage (where is data located?)
 Addressing Modes (how is data accessed?)
 Exceptional Conditions (what happens if something
13

goes wrong?)
MACHINE ORGANIZATION
 the view of the computer that is seen by the logic designer.

 It deals with

 Capabilities & performance characteristics of functional


units (e.g., registers, ALU, shifters, etc.).

 Ways of functional unit interconnection

 How information flows between components

 Logic and means by which information flow is controlled

 Coordination of functional units to realize the ISA

 Typically the machine organization is designed to meet a


14
given instruction set architecture.
GENERAL COMPUTER ORGANIZATION

Von Neumann
Machine

15
INTERNAL BUS ORGANIZATION

Von Neumann
Machine

16
CATEGORIES OF COMPUTER

 Computers are classified based on the


parameters like
 Speed of operation

 Cost

 Computational power

 Type of application

17
CATEGORIES OF COMPUTER CONT..

o Based on size and computing power


•Microcomputers (Personal Computer)
•Workstations
•Minicomputers
•Mainframes
•Supercomputers

18
CATEGORIES OF COMPUTERS CONT..

Personal computer
 Processing & storage units, visual display & audio
units, keyboards

 Storage media‐Hard disks, CD‐ROMs

 Eg: Personal computers which is used in homes and


offices

 + : Cost effective, easy to operate, suitable for general


purpose educational or business application
19
CATEGORIES OF COMPUTERS CONT..

Work stations
 More computational power than PC

 Costlier

 Used to solve complex problems which


arises in engineering application (graphics,
CAD/CAM etc)

20
CATEGORIES OF COMPUTERS CONT..

Minicomputers
 a computer of medium power, more than a
microcomputer but less than a mainframe.

Mainframe
 data processing in large organization

 referred as servers or super computers

21
CATEGORIES OF COMPUTERS CONT..

Super computers
 Faster than mainframes

 Helps in calculating large scale numerical and


algorithm calculation in short span of time

 Used for aircraft design and testing, military


application and weather forecasting

22
HISTORY OF COMPUTER
➢ Modern computers result from 2 streams
of evolution
▪ Mechanization of arithmetic calculating

machines (hardware)

▪ Concept of stored programs process control

(software )

23
HISTORY OF COMPUTER – MECHANICAL ERA

➢ The abacus
▪ origin unknown
▪ used by the Chinese 3 to 4 thousand years ago
➢ Blasé Pascal (1623-1662)
➢ 1642 - Pascal’s Adder
▪ 1st mechanized adding machine
▪ gears and wheels
▪ add and subtract
24
▪ inaccurate
HISTORY OF COMPUTER – MECHANICAL ERA

➢ Gottfried Wilhelm von Leibniz (1646-1716)


➢ 1670’s - Leibniz calculator
• add, subtract, multiply, divide
• more reliable and accurate
• still inaccurate
• he also invented calculus

25
HISTORY OF COMPUTER – MECHANICAL ERA

➢ Joseph Marie Jacquard (1752-1834)


➢ 1800 - Jacquard’s Loom
▪ weaving loom
▪ metal punch cards to position threads for the
weaving process
▪ within the decade, 11,000 used in France
▪ may have been 1st case of unemployment
caused by automation
26
HISTORY OF COMPUTER - MECHANICAL ERA

➢ Herman Hollerith (1860-1929)


▪ designed a machine that used electric charges to read
info off of punch cards
▪ for use in 1890 US census
▪ store and process census data
on punched cards
▪ started his own company in 1896
▪ in 1924 that company became International Business
Machines Corporation or IBM
27
HISTORY OF COMPUTER –

1822-33 - Difference Engine


▪ compute polynomials for math tables
▪ abandoned, wasn’t precise
1830-71 - Analytical Engine
▪ designed but never completed, ahead of its time
▪ Mill - arithmetic computations
▪ Store - store data and results
▪ Operation cards - program instructions
▪ Variable cards - select memory location for ops 28

▪ Output - printer or punch cards


HISTORY OF COMPUTER – ELECTROMECHANICAL
1939-42 - ABC
▪ John Atanasoff and
▪ Clifford Berry (Iowa State)
▪ small scale - 300 vacuum
tubes
1944 - Mark I
▪ electromechanical computer
▪ Howard Aiken (Harvard U.)
▪ first real analytical engine
29
▪ based on relays
HISTORY OF COMPUTER – ELECTRONIC

Electronic Numerical Integrator and Calculator


ENIAC (1946)
▪ Best known as first fully electronic computer
▪ 18,000 vacuum tubes
▪ 1,500 relays
▪ 20 x 40 foot room
▪ low reliability, lots of
power, air conditioning
▪ Grace Hopper 30

▪ debugging it
HISTORY OF COMPUTER – VON NEUMANN (1946)

▪ 1946 - John von Neumann (Princeton)

▪ Developed stored program concept

▪ both programs and data stored in same memory

▪ Modern computers said to use von Neumann

architecture

31
GENERATIONS OF ELECTRONIC COMPUTERS
➢ 1st Generation - [1945 – 1955]
▪ vacuum tubes and relays (ENIAC)
➢ 2nd Generation – [1955 – 1965]
▪ discrete transistors (IBM 7090)
➢ 3rd Generation – [1965 – 1980]
▪ integrated circuits or chips
▪ operating systems (IBM 360)
➢ 4th Generation – [1980 - ]
▪ large-scale integration - microprocessors 32
ELECTRONIC COMPUTERS
FIRST GENERATION (1945 –1955)
 Vacuum tubes were used for digital logic elements
and memory
 IAS computer
 Fundamental design approach was the stored
program concept
 Attributed to the mathematician John von Neumann
 First publication of the idea was in 1945 for the EDVAC
 Design began at the Princeton Institute for Advanced
Studies
 Completed in 1952
 Prototype of all subsequent general-purpose
computers 33
o A main memory, which stores both data Central processing unit (CPU)

and instructions Arithmetic-logic unit (CA)

AC MQ

o An arithmetic and logic unit (ALU) Arithmetic-logic


Input-
output
circuits
capable of operating on binary data equipment
(I, O)

MBR
o A control unit, which interprets the
Instructions
instructions in memory and causes and data

Them to be executed Instructions


and data
M(0)
M(1)
o Input/output (I/O) M(2)
M(3) PC IBR
M(4) AC: Accumulator register
equipment operated by the control unit MQ: multiply-quotient register
MBR: memory buffer register
IBR: instruction buffer register
MAR IR PC: program counter
MAR: memory address register
Main
IR: insruction register
memory
(M)
Control
Control
circuits
signals
M(4092)
M(4093)
M(4095)
Program control unit (CC)

Addresses
34

Figure 1.6 IAS Structure


0 1 39

sign bit (a) Number word

left instruction (20 bits) right instruction (20 bits)

0 8 20 28 39

opcode (8 bits) address (12 bits) opcode (8 bits) address (12 bits)

(b) Instruction word

Figure 1.7 IAS Memory Formats


35
REGISTERS
Memory buffer register • Contains a word to be stored in memory or sent to the I/O unit
(MBR) • Or is used to receive a word from memory or from the I/O unit

Memory address • Specifies the address in memory of the word to be written from
register (MAR) or read into the MBR

Instruction register • Contains the 8-bit opcode instruction being executed


(IR)

Instruction buffer • Employed to temporarily hold the right-hand instruction from a


register (IBR) word in memory

• Contains the address of the next instruction pair to be fetched


Program counter (PC) from memory

Accumulator (AC) and


• Employed to temporarily hold operands and results of ALU
multiplier quotient operations 36
(MQ)
Symbolic
Instruction Type Opcode Representation Description
00001010 LOAD MQ Transfer contents of register MQ to the
accumulator AC
00001001 LOAD MQ,M(X) Transfer contents of memory location X to
MQ
00100001 STOR M(X) Transfer contents of accumulator to memory
Data transfer location X
00000001 LOAD M(X) Transfer M(X) to the accumulator
00000010 LOAD –M(X) Transfer –M(X) to the accumulator
00000011 LOAD |M(X)| Transfer absolute value of M(X) to the
accumulator
00000100 LOAD –|M(X)| Transfer –|M(X)| to the accumulator
00001101 JUMP M(X,0:19) Take next instruction from left half of M(X)
Table 1.1
Unconditional
branch 00001110 JUMP M(X,20:39) Take next instruction from right half of M(X)
00001111 JUMP+ M(X,0:19) If number in the accumulator is nonnegative,
take next instruction from left half of M(X)
0 JU If number in the
0 MP accumulator is nonnegative,
Conditional branch 0
1
+
M(X
take next instruction from
right half of M(X)
The IAS
Instruction
0 ,20:
0 39)
0

00000101
0
ADD M(X) Add M(X) to AC; put the result in AC Set
00000111 ADD |M(X)| Add |M(X)| to AC; put the result in AC
00000110 SUB M(X) Subtract M(X) from AC; put the result in AC
00001000 SUB |M(X)| Subtract |M(X)| from AC; put the remainder
in AC
00001011 MUL M(X) Multiply M(X) by MQ; put most significant
bits of result in AC, put least significant bits
Arithmetic
in MQ
00001100 DIV M(X) Divide AC by M(X); put the quotient in MQ
and the remainder in AC
00010100 LSH Multiply accumulator by 2; i.e., shift left one
bit position
00010101 RSH Divide accumulator by 2; i.e., shift right one
position
00010010 STOR M(X,8:19) Replace left address field at M(X) by 12 37
rightmost bits of AC
Address modify
00010011 STOR M(X,28:39) Replace right address field at M(X) by 12
rightmost bits of AC
ELECTRONIC COMPUTERS
 SECOND GENERATION (1955 –1965)
 Transistor were used to design ALU & CU
 High Level Language is used (FORTRAN)
 To convert HLL to MLL compiler were used
 Separate I/O processor were developed to
operate in parallel with CPU, thus improving the
performance
 Invention of the transistor which was faster,
smaller and required considerably less power to 38

operate
ELECTRONIC COMPUTERS
 THIRD GENERATION (1965‐1975)
 IC technology improved
 Improved IC technology helped in designing low cost, high speed
processor and memory modules

 Multiprogramming, pipelining concepts were incorporated

 DOS allowed efficient and coordinate operation of computer


system with multiple users

 Cache and virtual memory concepts were developed

 More than one circuit on a single silicon chip became available

39
ELECTRONIC COMPUTERS
 FOURTH GENERATION (1975‐1985)
 CPU –Termed as microprocessor
 INTEL, MOTOROLA, TEXAS,NATIONAL semiconductors
started developing microprocessor

 Workstations, microprocessor (PC) & Notebook computers


were developed
 Interconnection of different computer for better
communication LAN,MAN,WAN
 Computational speed increased by 1000 times
 Specialized processors like Digital Signal Processor
were also developed 40
ELECTRONIC COMPUTERS

 BEYOND THE FOURTH GENERATION(1985 –


TILL DATE)
 E‐Commerce, E‐banking, home office

 ARM, AMD, INTEL, MOTOROLA

 High speed processor ‐GHz speed

 Because of submicron IC technology lot of added


features in small size

41
MILESTONES IN COMPUTER TECHNOLOGY
1800s Analyt. Engine Babbage First digital computer
1936 Z1 Zuse First relay machine
1943 COLOSSUS British gov’t First electronic computer
1944 Mark I Aiken First general-purpose computer
1946 ENIAC I Eckert/Mauchley Modern computer history starts
1949 EDSAC Wilkes First stored-program computer
1952 IAS Von Neumann Most computers use this design
1960 PDP-1 DEC First minicomputer
1964 360 IBM Computer family, architecture
1964 6600 CDC First scientific supercomputer
1974 8080 Intel First processor on a chip
1974 CRAY-1 Cray First vector supercomputer
1981 IBM PC IBM Personal computer era
1985 MIPS MIPS 42
First commercial RISC machine
1990 RS6000 IBM First superscalar microprocessor
TERMINOLOGIES
 Computer
 A device that accepts input, processes data, stores data, and
produces output, all according to a series of stored
instructions.
 Hardware
 Includes the electronic and mechanical devices that process
the data; refers to the computer as well as peripheral
devices.

 Software
 A computer program that tells the computer how to perform
particular tasks. 43
TERMINOLOGIES
 Network

 Two or more computers and other devices that are


connected, for the purpose of sharing data and
programs.

 Peripheral devices

 Used to expand the computer’s input, output and


storage capabilities.

44
TERMINOLOGIES
 Input

 Whatever is put into a computer system.

 Data

 Refers to the symbols that represent facts, objects, or ideas.

 Information

 The results of the computer storing data as bits and bytes;


the words, numbers, sounds, and graphics.

 Output

 Consists of the processing results produced by a computer

45
TERMINOLOGIES
 Processing

 Manipulation of the data in many ways.

 Memory

 Area of the computer that temporarily holds data


waiting to be processed, stored, or output.

 Storage

 Area of the computer that holds data on a permanent


basis when it is not immediately needed for
processing. 46
PERFORMANCE

 Introduction
 CPU Execution Time
 The Performance Equation

47
 Determinants of Performance
 SPEC Benchmark
 Other Performance Metrics
 Examples
INTRODUCTION
 Given a collection of computers, which one to buy?
 Best Performance ?
 Least Cost ?
 Best Cost/Performance?
 How to define performance?
 Time required to finish a task (individual users)
 Number of tasks executed per time (throughput)
 Less time to finish implies better performance

Performance = 1 / Execution Time

 If X is n times faster than Y, then

PerformanceX ExecutionTimeY
n= =
PerformanceY ExecutionTimeX
CPU EXECUTION TIME
 How to measure the execution time?
 Almost all modern computers are based on a clock
 The clock is a periodic square wave with known period
(cycle time)
 Period = 1 / Frequency

one clock cycle

• The base unit in measuring time is the cycle time ,


thus

Time = cycles * cycle time


Time = cycles / clock frequency
CPU EXECUTION TIME
 Time required to execute a program is essentially
the time required to execute its instructions!
Time = #instructions x cycle
time

50
 However, not all instructions take the same time!
 One way to think about execution time is that it equals the
number of instructions executed multiplied by the average
time per instruction

Time = #instructions x average cycles per instruction x


cycle time

Time = IC x CPI x CC
CPU EXECUTION TIME
 The average CPI is computed by


N
k =1
ICk  CPI k
Effective CPI =
IC

51
 Where
Where ICk is the number of instructions of class k
executed
CPIk is the number of clock cycles per instruction for
that instruction class
N is the number of instruction classes

 Note: The overall effective CPI varies by instruction


mix – a measure of the dynamic frequency of
instructions across one or many programs
THE PERFORMANCE EQUATION
Execution Time = IC  CPI x CC

Execution Time = IC  CPI / CR

52
Performance = 1 / Execution Time
 Notes
 Three key factors for performance: IC, CPI, and CC
 CC: The clock rate is usually given
 IC: Overall instruction count (executed instructions) by
using profilers/ simulators
 CPI: varies by instruction type and ISA
implementation
THE PERFORMANCE EQUATION
 Example 1. In a certain program 1000
instructions were executed on CPU running at 1
GHz. If the instruction counts and CPI for each
class are given below, how long does it take to

53
execute the program?
Instruction Instructi Class CPI
Class on Count
1 200 2
2 300 3
3 500 1

Effective CPI = (200x2+300x3+500x1)/1000 = 1.8

Time = 1000 x 1.8 x 1 ns = 1.8 us


THE PERFORMANCE EQUATION
 Example 2. Suppose the computer A has clock
cycle of 250 ps and CPI 2.0 for some program, and
computer B has clock cycle time of 500 ps and CPI
of 1.2 for the same program, then which computer

54
is faster ?

TimeA = IC x 2 x 250 ps = 500 IC ps

TimeB = IC x 1.2 x 500 ps = 600 IC ps

PerformanceA TimeB 600 IC


-------------------- = ---------- = --------- = 1.2
PerformanceB TimeA 500 IC

Computer A is 1.2 faster than B


THE PERFORMANCE EQUATION
 Example 3. A certain processor that has four instruction classes
is to be modified using different approaches. The details of the
program used in evaluating different approaches are given in the
table below.
 What is the effective CPI for

55
 The original processor
 Approach 1. A cache is added and it reduces the average load time to 2
cycles.
 Approach 2. A branch prediction scheme is used and it cuts the branch
time by 1 cycle. Original App1 App2 App3
 Approach 3. A second ALU is added CPI
to execute two ALU instructions at
Class Frequency Class CPI k x CPIk x F CPIk x F CPIk x F
once. F
ALU 50% 1 0.5 0.5 0.25
0.5
Load 20% 5 0.4 1.0 1.0
1.0
Store 10% 3 0.3 0.3 0.3
0.3
Branch 20% 2 0.4 0.2 0.4
0.4
Effective CPI 2.2 1.6 2.0 1.95
Speed up 1.375 1.10 1.128
DETERMINANTS OF PERFORMANCE
Execution Time = IC  CPI x CC

IC CPI CC

56
Algorithm X X
Programmin
g Language X X

Compiler X X
ISA X X X
Processor
Organizatio X X
n
X
Technology
SPEC BENCHMARK
 What programs can be used to evaluate
different computers? Can we cheat? Need a
standard!
 SPEC Benchmark

57
 Standard Performance Evaluation Corp (SPEC)
 Programs used to measure performance (CPU, Web,
I/O…)
 Typical actual workloads
 SPEC CPU2006
 Elapsed time to execute a selection of programs
 Negligible I/O, so focuses on CPU performance
 Summarize as geometric mean of performance ratios
 CINT2006 (integer) and CFP2006 (floating-point)

n
Geometric Mean = n
 Execution Time Ratio
i =1
i
SPEC BENCHMARK
CINT2006 for Opteron X4 2356

Name Description IC×109 CPI Tc (ns) Exec time Ref time SPECratio
perl Interpreted string processing 2,118 0.75 0.40 637 9,777 15.3
bzip2 Block-sorting compression 2,389 0.85 0.40 817 9,650 11.8

58
gcc GNU C Compiler 1,050 1.72 0.47 24 8,050 11.1
mcf Combinatorial optimization 336 10.00 0.40 1,345 9,120 6.8
go Go game (AI) 1,658 1.09 0.40 721 10,490 14.6
hmmer Search gene sequence 2,783 0.80 0.40 890 9,330 10.5
sjeng Chess game (AI) 2,176 0.96 0.48 37 12,100 14.5
libquantum Quantum computer simulation 1,623 1.61 0.40 1,047 20,720 19.8
h264avc Video compression 3,102 0.80 0.40 993 22,130 22.3
omnetpp Discrete event simulation 587 2.94 0.40 690 6,250 9.1
astar Games/path finding 1,082 1.79 0.40 773 7,020 9.1
xalancbmk XML parsing 1,058 2.70 0.40 1,143 6,900 6.0
Geometric mean 11.7

High cache miss rates


SPEC BENCHMARK
CINT2000 Results for Various Processors
Pentium 3
3400
Pentium 4

59
2900 P4 Extreme

2400 Xeon
CINT2000

Athlon
1900
Athlon 64
1400 Opteron
Pmac G5
900
Athlon FX (DC)
400 Core Duo
1

4
0.5

1.5

2.5

3.5

Core 2 Duo
Clock Speed (GHz)
SPEC BENCHMARK
CFP2000 Results for Various Processors
3200
Pentium 3

60
2700 Pentium 4
P4 Extreme
2200 Xeon
CFP2000

Athlon
1700
Athlon 64
1200 Opteron
Pmac G5
700 Athlon FX (DC)
Core Duo
200
Core 2 Duo
1

3
0.5

1.5

2.5

3.5

Clock Speed (GHz)


OTHER PERFORMANCE FACTORS
 Power consumption is one factor in evaluating
performance
 This is specifically important in the embedded
market where battery life is important (and passive

61
cooling)
EXAMPLES
 Example 4. given a program with 106 instructions with
the following mix: 10% class A, 20% class B, 50% class
C, and 20% class D. If this program is executed on two
different processors with the specifications given below,
then

62
Process CR CPI Class CPI Class CPI Class CPI Class
or (GHz) A B C D
1 1.5 1 2 3 4
2 2 2 2 2 2

 What is the effective CPI for the program for each


implementation?
 Which implementation is faster?
 What is the speedup?
EXAMPLES
 Example 5. The information for some program that is
executed on some processor is given below. If the
processor is modified such that the CPI for Class 2
instructions is reduced to 2, then would it be beneficial to
adopt this modification if this

63
 modification requires increasing the clock cycle by 10%?
 modification does not affect the clock cycle but requires
twice the amount of power to execute the program

Classi CPIi Frequenc


yi
1 2 0.3
2 5 0.2
3 3 0.5
PERFORMANCE AND COST
° Purchasing perspective : given a collection of
machines, which has the
° best performance ?
° least cost ?
° best performance / cost ?
° Design perspective: faced with design options,
which has the
° best performance improvement ?
° least cost ?
64

° best performance / cost ?


PERFORMANCE AND COST…

° Both design and purchasing perspectives

require

- basis for comparison

- metric for evaluation

° Our goal is to understand cost & performance

implications of architectural choices


65
PERFORMANCE AND COST…

Two Notions of Performance:

° Time to do the task

° execution time, response time, latency

° Tasks per day, hour, week, sec, ns. ..

° performance, throughput, bandwidth

66
TIME CAN BE MEASURED IN TERMS OF:

° Response time

° Total time to complete a task including

° executing on the CPU,

° accessing disk and memory,

° waiting for I/O and other processes, and

° operating system overhead.


67
TIME CAN BE MEASURED IN TERMS OF:

° CPU execution time :

° Total time a CPU spends computing on a

given task (excludes time for I/O or running

other programs).

° This is also referred to as simply CPU time.

68
MEASUREMENT OF TIME

° A computer clock runs at a constant rate and determines


when events take placed in hardware.

Clk

clock period

° Clock cycle time is the amount of time for one clock


period to elapse (e.g. 5 ns).
° Clock rate is the inverse of the clock cycle time.
69
TIME …
The time to execute a given program can be
computed as
CPU time = CPU clock cycles x clock cycle time
Since clock cycle time and clock rate are reciprocals
CPU time = CPU clock cycles / clock rate
The number of CPU clock cycles can be determined
by
CPU clock cycles = (inst/prog)x(clk cycles/inst
= Instruction count * CPI
70
EXAMPLE
If a computer has a clock rate of 50 MHz, how long
does it take to execute a program with 1,000
instructions, if the CPI for the program is 3.5?

Using the equation


CPU time = Instruction count x CPI / clock rate
gives
CPU time = 1000 x 3.5 / (50 x 106)

71
EXAMPLE
If a computer’s clock rate increases from 200 MHz to 250
MHz and the other factors remain the same, how many
times faster will the computer be?

CPU time old clock rate new 250 MHz


------------------- = ---------------------- = ---------------- = 1.25
CPU time new clock rate old 200 MHZ

72
COMPUTING THE CPI
The CPI is the average number of cycles per instruction.
If for each instruction type, we know its frequency and number
of cycles need to execute it, we can compute the overall CPI by
the formula, CPI = Σ CPI x F
For example
Operation F CPI CPI x F % Time
ALU 50% 1 .5 23%
Load 20% 5 1.0 45%
Store 10% 3 .3 14%
Branch 20% 2 .4 18% 73

Total 100% 2.2 100%


SUMMARY
 Computer Architecture includes the design of the
Instruction Set Architecture (programmer’s view) and
the Machine Organization (logic designer’s view).
 Levels of abstraction, which consist of an interface and
an implementation are useful to manage designs.
 Processor performance increases rapidly, but the speeds of
memory and I/0 have not kept pace.
 Computer systems are comprised of data path, memory,
input devices, output devices, and control.
 Memory systems are designed so that small, fast, and 74
expensive memories are closest to the processor.

You might also like