Introduction To Computer Architecture: Instructor
Introduction To Computer Architecture: Instructor
Architecture
Lecture 01
Computer Architecture =
Instruction Set Architecture + Machine
Organization
3
Instruction Set Architecture
• ISA = attributes of the computing system as
seen by the programmer
– Organization of programmable storage
– Data types & data structures
– Instruction set
– Instruction formats
– Modes of addressing
– Exception handling
4
Machine Organization
• Capabilities & performance characteristics of
principal functional units (e.g., registers, ALU,
shifters, logic units)
• Ways in which these components are
interconnected
• Information flow between components
• Logic and means by which such information flow
is controlled
5
Definitions
• Computer architecture refers to those attributes
of a system visible to a programmer or
• Those attributes that have a direct impact on the
logical execution of a program
• Examples of architectural attributes: Instruction
set, the number of bits used to represent various
data types (e.g., numbers, characters), I/O
mechanisms, and techniques for addressing
memory
Definitions
• For example, it is an architectural design issue
whether a computer will have a multiply
instruction
• On the other hand, it is an organizational issue
whether that instruction will be implemented
by a special multiply unit or by a mechanism
that makes repeated use of the add unit of the
system
STRUCTURE AND FUNCTION
• A computer is a complex system
• The hierarchical nature of complex systems is essential to both
their design and their description
• The designer need only deal with a particular level of the system
at a time
• At each level, the system consists of a set of components and
their interrelationships and the designer is concerned with
associated structure and function:
– Structure: The way in which the components are interrelated
– Function: The operation of each individual component as
part of the structure
Functional View of a Computer
Functional units
• In general terms, there are only four functional units:
• Data processing: The computer must be able to process data
– The data may take a wide variety of forms, and the range of processing
requirements is broad
• Data storage: It is also essential that a computer store data
• If the computer is processing data on the fly (i.e., data come in and get
processed, and the results go out immediately), the computer must
temporarily store at least those pieces of data that are being worked on at
any given moment
– Thus, there is at least a short-term data storage function
• Equally important, the computer performs a long-term data storage function
also
• Files of data are stored on the computer for subsequent retrieval and update
Functional units
• Data movement: The computer must be able to move data between itself and the
outside world
• The computer’s operating environment consists of devices that serve as either
sources or destinations of data
• When data are received from or delivered to a device that is directly connected to
the computer, the process is known as input–output(I/O), and the device is referred
to as a peripheral
• When data are moved over longer distances, to or from a remote device, the process
is known as data communications
• Control: There must be control of these three functions
• This control is exercised by the individual(s) who provides the computer with
instructions
• Within the computer, a control unit manages the computer’s resources and
orchestrates the performance of its functional parts in response to those instructions
Possible Operations
• The computer can function as a data movement device (Figure 1), simply
transferring data from one peripheral or communications line to another
• It can also function as a data storage device (Figure 2), with data
transferred from the external environment to computer storage (read) and
vice versa (write)
Possible Operations
CPI I i i
CPI i 1
Ic
Clock Speed and Instructions per Second
• The processor time T needed to execute a given program can be expressed as:
T I c CPI
• We can refine this formulation by recognizing that during the execution of an instruction, part
of the work is done by the processor, and part of the time a word is being transferred to or
from memory
• In this latter case, the time to transfer depends on the memory cycle time, which may be
greater than the processor cycle time
• We can rewrite the preceding equation as
T I C p (m k )
• where p is the number of processor cycles needed to decode and execute the instruction, m
is the number of memory references needed, and k is the ratio between memory cycle time
and processor cycle time
• The five performance factors in the preceding equation (Ic, p, m, k, τ ) are influenced by four
system attributes: the design of the instruction set (known as instruction set architecture),
compiler technology (how effective the compiler is in producing an efficient machine language
program from a high-level language program), processor implementation, and cache and
memory hierarchy
Clock Speed and Instructions per Second
• For the multi-cycle MIPS, there are 5 types of instructions:
– Load (5 cycles)
– Store (4 cycles)
– R-type (4 cycles)
– Branch (3 cycles)
– Jump (3 cycles)
• If a program has:
– 50% load instructions
– 15% R-type instructions
– 25% store instructions
– 8% branch instructions
– 2% jump instructions
– then, the CPI is:
Clock Speed and Instructions per Second
• A 400-MHz processor was used to execute a benchmark program with the
following instruction mix and clock cycle count:
• Instruction type Instruction count Clock cycle count Integer arithmetic 45000 1
Data transfer 32000 2 Floating point 15000 2 Control transfer 8000 2
• Total instruction count = 100000
• Determine the effective CPI, MIPS rate, and execution time for this program.
Clock Speed and Instructions per Second
•
• 1.55
• Effective Processor Performance
• Execution Time(T)
Clock Speed and Instructions per Second
• A common measure of performance for a processor is the rate at
which instructions are executed, expressed as millions of
instructions per second (MIPS), referred to as the MIPS rate
• We can express the MIPS rate in terms of the clock rate and CPI as
follows: 𝐼
𝐶
𝑀𝐼𝑃𝑆 𝑟𝑎𝑡𝑒 = 6
𝑇 ×1 0
• Consider the execution of a program which results in the execution
of 2 million instructions on a 400-MHz processor
• The program consists of four major types of instructions
• The instruction mix and the CPI for each instruction type are given
below based on the result of a program trace experiment
Clock Speed and Instructions per Second
𝑇 (1− 𝑓 )+𝑇𝑓
1
¿ ¿
𝑇𝑓 𝑓
𝑇 (1 − 𝑓 )+ (1− 𝑓 )+
• 𝑁
Two important conclusions 𝑁 be drawn:
can
1) When f is small, the use of parallel processors
has little effect
2) As N approaches infinity, speedup is bound by 1/
(1 - f), so that there are diminishing returns for
using more processors
Amdahl’s Law
• Amdahl’s law can be generalized to evaluate
any design or technical improvement in a
computer system
• Consider any enhancement to a feature of a
system that results in a speedup
• The speedup can be expressed as:
Performanc e after enhancement
Speedup
Performanc e before enhancement
Amdahl’s Law
Execution time before enhancement
Speedup
Execution time after enhancement
•
Suppose that a feature of the system is used during
execution a fraction of the time f, before enhancement,
and that speedup of that feature after enhancement is .
Then the overall speedup of the system is