Professional Documents
Culture Documents
in JNTU World
Computer Organization
ld
or
W
TU
JN
Syllabus:
• Introduction: Function and structure of a computer,
computer Functional components of a
computer, Interconnection of components, Performance of a computer.
ld
• Representation of Instructions: Machine instructions, Operands, Addressing
modes, Instruction formats, Instruction sets, Instruction set architectures - CISC and
or
RISC architectures.
W
control unit, Hardwired control unit, Microprogrammed control unit.
• Input/Output Subsystem: Access of I/O devices, I/O ports, I/O control mechanisms -
Program controlled I/O,
I/O Interrupt controlled I/O, I/O and DMA controlled I/O, I/O I/O interfaces
- Serial port, Parallel port, PCI bus, SCSI bus, USB bus, Firewall and Infiniband, I/O
peripherals - Input devices, Output devices, Secondary storage devices.
Downloaded From JNTU World (http://www.alljntuworld.in)
www.alljntuworld.in JNTU World
References
ld
1. C. Hamacher, Z. Vranesic and S. Zaky, "Computer Organization", McGraw-
Hill, 2002.
or
2. W. Stallings, "Computer Organization and Architecture - Designing for
Performance", Prentice Hall of India, 2002.
W
The Hardware/Software Interface", Morgan Kaufmann,1998.
ld
or
W
TU
JN
Program Execution
ld
equivalent machine language program. Then the machine language
program is executed.
or
Interpretation: Another program reads the high level program
instructions one-by-one and executes a equivalent series of
W
machine language instructions.
ld
or
W
TU
JN
ld
Application Program
or
Algorithms
Language
Software
W
Hardware
IInstruction
t ti Set S t Architecture
A hit t
(and I/O Interfaces)
Microarchitecture
TU
Circuits
Devices
JN
ld
In theory, computer can compute anything
that’s possible to compute
or
• given enough memory and time
W
computing
ti underd constraints.
t i t
• time
weather forecast
forecast, next frame of animation
animation, ...
TU
• cost
cell phone, automotive engine controller, ...
• power
JN
ld
A systematic sequence of transformations between
layers of abstraction.
or
Problem
Software Design:
choose algorithms and data structures
W
Al
Algorithm
ith
Programming:
g g to express
use language p design
g
TU
Program
Compiling/Interpreting:
convert language to
JN
machine instructions
Instr Set
A hit t
Architecture
ld
IInstr
t Set
S t
or
Architecture
Processor Design:
choose structures to implement ISA
W
Microarch
Logic/Circuit Design:
gates and low-level circuits to
implement components
TU
Circuits
Process Engineering & Fabrication:
develop and manufacture
lowest-level components
JN
Devices
ld
Problem Statement
or
• stated using "natural language"
• may be ambiguous,
ambiguous imprecise
Algorithm
W
• step-by-step
p y p procedure,
p , guaranteed
g to finish
• definiteness, effective computability, finiteness
Program
TU
• express the algorithm using a computer language
• high-level language, low-level language
Instruction Set Architecture (ISA)
JN
ld
Microarchitecture
or
• detailed organization of a processor implementation
• different implementations of a single ISA
Logic Circuits
W
• combine basic operations
p to realize microarchitecture
• many different ways to implement a single function
(e.g., addition)
TU
D i
Devices
• properties of materials, manufacturability
JN
ld
Solve a system of equations
or
Gaussian Jacobi
Red-black SOR Multigrid
g
elimination iteration
W
FORTRAN C C++ Java Tradeoffs:
cost
performance
Sun SPARC Intel x86 Compaq Alpha power
TU
(etc.)
Pentium II Pentium III AMD Athlon
What’s Next
ld
Bits and Bytes
• How do we represent information using electrical signals?
Digital Logic
or
• How do we build circuits to process information?
Processor and Instruction Set
W
• How do we build a p
processor out of logic
g elements?
• What operations (instructions) will we implement?
Assembly Language Programming
TU
• How do we use processor instructions to implement
algorithms?
• How do we write modular
modular, reusable code? (subroutines)
I/O, Traps, and Interrupts
JN
ld
understanding and design - Identify the
hierarchical nature of most complex system.
system
or
A hierarchical system
y is a set of interrelated
subsystems, each in turn, hierarchical in structure;
until at the lowest level we have elementary
W
subsystems.
b t
At each
h level,
l l the
th system
t consists
i t off a sett off
components and their interrelationships.
Downloaded From JNTU World (http://www.alljntuworld.in)
www.alljntuworld.in JNTU World
ld
the system at the next lower level.
or
At each level,, the designer
g is concerned
with structure and function:
W
Structure: The
h way iin which
hi h the
h components are
interrelated.
TU
Function: The operation of each individual
component
p as p
part of the structure.
JN
ld
or
W
TU
JN
• Data processing
i
ld
• Data storage
• Data movement
• Control
or
MAIN STRUCTURAL BLOCKS/PARTS:
W
Central
C t l Processing
P i Unit
U it (CPU):
(CPU) Controls
C t l the
th operation
ti off
the computer and performs its data processing functions.
Often simply referred to as processor.
TU
Main Memory: Stores data.
The major
j structural components
p of a CPU are:
ld
Control Unit (CU): Controls the operation of the
C
CPU andd hence
h the
h computer.
or
Arithmetic and Logic Unit (ALU): Performs
computer’s data processing functions.
W
Register: Provides storage internal to the CPU.
TU
CPU Interconnection:
I i communication
i i among the
h
control unit, ALU, and register.
JN
ld
or
Peripherals Computer
W
Central Main
Processing M
Memory
Unit
Computer
Systems
TU
Interconnection
Input
Output
JN
Communication
lines
li
ld
or
W
Computer Arithmetic
Registers
g and
I/O Logic Unit
System CPU
Bus
Internal CPU
TU
Memory Interconnection
CPU
Control
JN
Unit
ld
or
Control Unit
W
CPU
Sequencing
q g
ALU Logic
Control
Internal
Unit
Bus
Registers and
TU
Registers Decoders
Of CU
Control
JN
Memory
ld
– Atanasoff Berry
y Computer
p ((1937 - 1938))
solved systems of linear equations.
or
– John Atanasoff and Clifford Berryy of
Iowa State University.
W
– Electronic Numerical Integrator and Computer Computer
TU
(ENIAC) byb John
J h Mauchly
M hl andd J. J Presper
P E k
Eckertat the
h UUniversity
i i
of Pennsylvania, 1946
ld
– Digital Equipment Corporation (DEC) PDP-1
PDP 1
– Univac 1100
or
– Control Data Corporation 1604
1604.
– . . . and many others.
W
• The Third Generation: Integrated Circuit Computers (1965
- 1980)
– IBM 360
TU
– DEC PDP-8 and PDP-11
– Cray-1
y supercomputer
p p
• IBM had gained overwhelming dominance in the industry.
JN
ld
• The invention of stored program computers
or
has been ascribed to a mathematician, John
von Neumann,
N who
h was a contemporary
t off
Mauchley and Eckert.
W
TU
• St
Stored-program
d computers
t have
h become
b
known as von Neumann Architecture
systems.
JN
ld
• Today’s
Today s stored-program
stored program computers have the
following characteristics:
or
– Three hardware systems:
y
• A central processing unit (CPU)
W
• A main memory system
• An
A I/O system
ld
or
W
TU
JN
IAS (P
(Princeton)
i t ) computer
t model
d l by
b Von
V Neumann’s
N ’ group.
ld
- A main memory,
memory which stores both data and instructions.
instructions
or
- An arithmetic-logical
arithmetic logical unit (ALU) capable of operating on
binary data.
W
- A control unit, which interprets the instructions in memory
and causes them to be executed.
TU
- Input
p and output
p (
(I/O)
/ ) equipment
q p operated
p by
y the
control unit.
JN
CPU Organization
ld
or
W
TU
JN
ld
• This is a general
or
depiction of a von
Ne mann s
Neumann system:
stem
W
• These computers
p
employ a fetch-
decode-execute
cycle to run
TU
programs as
follows . . .
JN
ld
• Th
The control
t l unit
it fetches
f t h the
th nextt instruction
i t ti from
f
memory using the program counter to determine where
or
the instruction is located.
W
TU
JN
ld
• Th
The instruction
i t ti iis d
decoded
d d into
i t a language
l that
th t the
th ALU
can understand.
or
W
TU
JN
ld
• A
Any ddata
t operands
d required
i d to
t execute
t the
th instruction
i t ti
are fetched from memory and placed into registers
or
within the CPU.
W
TU
JN
ld
• Th
The ALU executes
t the
th instruction
i t ti and
d places
l results
lt in
i
registers or memory.
or
W
TU
JN
ld
– Binary number (2 (2’s
s complement)
or
– 2 x 20 bit instructions
• Set of registers (storage in CPU)
W
– Memory y Buffer Register
g
– Memory Address Register
Addition time was 62
– Instruction Register
TU
microseconds and
the multiplication time
– Instruction Buffer Register was 713 microseconds.
– Program Counter
It was an asynchronous
JN
– Accumulator machine.
– Multiplier Quotient
Downloaded From JNTU World (http://www.alljntuworld.in)
www.alljntuworld.in JNTU World
Structure of IAS
ld
Central Processing Unit
Arithmetic and Logic Unit
Accumulator MQ
or
A ith ti & Logic
Arithmetic L i Circuits
Ci it
W
Input MBR
Output Instructions
& Data Main
Equipment
Memory
TU
IBR PC
MAR
IR Control
Circuits
JN
Address
Program
g Control
Unit
ld
• Conventional stored
stored-program
program computers have
undergone many incremental improvements over
or
the years.
W
buses floating
buses, floating-point
point units,
units and cache memories,
memories
to name only a few.
TU
• B
But enormous iimprovements iin computational
i l
power require departure from the classic von
Neumann architecture.
architecture
JN
DEC - PDP-8
PDP 8 Bus Structure
ld
or
Console Main I/O I/O
CPU Memory Module
Controller Module
W
TU
OMNIBUS
JN
ld
Small scale integration: 1965 ; Up to 100 devices on a chip
or
Medium scale integration: -1971; 100-3,000 devices on a chip
W
Very large scale integration: 1978 -1991; 100,000 - 100,000,000 devices on a chip
ld
or
Often used interchangeably – in book titles and as keywords.
keywords
W
Thin line of difference – should be clear as we progress through
the course material.
TU
JN
ld
Typical Categories of Instructions:
• Arithmetic - add, subtract
or
• Logic - and, or and not
• Data - move,
move input
input, output
output, load and store
• Control flow - goto, if ... goto, call and return.
W
An instruction set, or instruction set
architecture (ISA), is the part of the computer
TU
architecture related to programming, including the
native data types, instructions, registers,
addressing modes
modes, memory architecture
architecture, interrupt
and exception handling, and external I/O; also
JN
ld
Application Program
or
Algorithms
Language
Software
W
Hardware
IInstruction
t ti Set S t Architecture
A hit t
(and I/O Interfaces)
Microarchitecture
TU
Circuits
Devices
JN
ld
(ISA) and formats, opcode, data types, addressing
modes and I/O.
or
Instruction set architecture (ISA) is different
from “microarchitecture”, which consist of various
W
processor
p ocesso des
design
g tec
techniques
ques used to implement
pe e t
the instruction set.
TU
Computers with different microarchitectures
can share a common instruction set.
Athlon implement
p nearly
y identical versions of the
x86 instruction set, but have radically different
internal designs. Downloaded From JNTU World (http://www.alljntuworld.in)
Computer architecture is the conceptual design
www.alljntuworld.in JNTU World
ld
p
computer.
It is the science and art of selecting and
or
interconnecting g hardware components
p to create
computers that meet functional, performance and cost
goals.
W
It deals with the architectural attributes like
physical address memory, CPU and how they should be
designed and made to coordinate with each other
TU
keeping the goals in mind.
Analogy:
l “building
“b ildi the
h d design i and d architecture
hi off
house” – architecture may take more time due to
JN
ld
Computer organization (CO) is how
or
operational attributes are linked together and
contribute
t ib t tot realise
li the
th architectural
hit t l
specifications.
W
CO encompasses all physical aspects of
computer systems
TU
e.g. Circuit design, control signals, memory types.
JN
ld
that involves how the constituent parts of the
system
t are interconnected
i t t d and
d how
h they
th
interoperate in order to implement the ISA.
or
W
The size of a computer's cache, for example, is
an organizational issue that generally has nothing
to do with the ISA.
TU
Another example: it is an architectural design
issue whether a computer will have a multiply
instruction. It is an organizational issue whether
JN
ld
The most important abstraction of computer design
or
Application
pp Programs
Application
W
Compiler
Instruction Set Architecture
Processor I/O System Interface between SW & HW
TU
Logic - gates, state machines, etc.
Hardware
Circuit - transistors, etc.
ld
Microprocessor
or
Memory
ld
BIOS ROM
IDE Disk Conn.
or
Memory
AGP
W
Processor
PCI Cards
N. Bridge
TU
Rear Panel Conn.
PCI - Peripheral
p Component
p Interconnect;;
IDE – Integrated Drive Electronics;
BIOS - Basic input/output system
Downloaded From JNTU World (http://www.alljntuworld.in)
www.alljntuworld.in JNTU World
ld
or
W
TU
JN
ld
- Cannot assume infinite speed and memory.
or
- handle
h dl b bugs and
d errors (b
(bad
d pointers,
i t overflow
fl etc.)
t )
W
- multiple processors, processes, threads
- shared memory
TU
- disk access
Enhancing Performance
(speed)
ld
• Pipelining
or
• On board cache
• On board L1 & L2 cache
• Branch prediction
W
TU
• Data flow analysis (in compilers)
• Speculative execution
JN
ld
or
W
TU
JN
ld
or
W
TU
JN
Performance Analysis
N *S
A basic performance equation: T
ld
R
T – processor time required to execute a program (not total time used);
or
N - Actual number of machine instructions (including that due to loops);
W
R – Cycle/sec
y Earlier measures –
CPI – Cycles
y p
per Instruction;;
“User CPU” time; “system (kernel) CPU” time and the “elapsed” real-time.
ld
g A:
e.g. 0.327u 0.010s 0:01.15; %-age
g elapsed
p time in CPU:
0.327 0.01
or
0.45%
75
W
e.g.
g B: 90.7u 12.9s 0:12.39;; %-age
g elapsed
p time in CPU:
90.7 12.9
A better situation, for exploitation 65%
TU
of CPU time. 159
CPU execution
ti titime ffor a program =
JN
ld
CPU clock cycles = No. of instructions * Avg. clock cycles/instruction
n
CPU clock cycles N i * CPI i
or
i 1
CPI = cycles/instruction; N – No. of instructions;
W
°CPU execution time for program
= Instruction Count x CPI x Clock Cycle Time
TU
Exec _ Time( A) 1 n
A better measure: Exec _ time Timei
E _ Time
Exec Ti ( B) n i 1
JN
sec onds
d t ti ns clock
IInstructio l k cycle
l seconds
d
* *
program program Instruction clock cycle
Downloaded From JNTU World (http://www.alljntuworld.in)
www.alljntuworld.in JNTU World
Performance - SPECS
• CPU
SPEC MPI2007 focuses on performance
ld
• Graphics/Workstations of compute intensive applications using
the Message-Passing Interface (MPI),
• MPI/OMP
which means these benchmarks
or
(Orthogonal Multi-Processor) emphasize the performance of:
• Java Client/Server
• computer processor (CPU),
• Mail Servers • number of computer processors,
W
• MPI Library,
• Network File System
• i ti
communication interconnect,
i t t
• Power • memory architecture,
• compilers, and
• SIP
• shared file system.
system
TU
(Session Initiation Protocol)
Not for Graphics, O/S and I/O.
• SOA
(Service Oriented Architecture)
JN
• Virtualization
• Web Servers
Downloaded From JNTU World (http://www.alljntuworld.in)
www.alljntuworld.in JNTU World
ld
CFP2006 is used for measuring
g and comparing
p g compute-intensive
p
floating point performance.
or
SPEC rating (ratio) = TR / TC;
W
TC = Running time of the Computer under test;
TU
1/ n
n
SPEC SPECi Higher the SPEC score,
i 1 better the performance
performance.
JN
ld
113.GemsFDTD Fortran Computational Electromagnetics
or
121 pop2
121.pop2 C/Fortran Climate Modeling
W
126.lammps C++ Molecular Dynamics
129 tera tf
129.tera_tf Fortran 3D Eulerian Hydrodynamics
JN
ld
- Reduced Power dissipation
or
- More increase in Speed and Registers (GPRs) for operation
W
- Use of Cache
-
JN
Increase in CPU p
performance,, may
y come from three factors:
ld
• Increase in clock rate
or
• Compiler enhancements for lower average CPI
W
•
TU
JN
Key terminologies:
• Control Path
ld
• Microcontroller • ALU, FPU, GPU etc.
or
• Hardware description language • Cache
W
• Multi-core
M lti (
(computing)
ti ) • Out-of-order
Out of order execution
• Addressing Modes
JN
• SIMD, MIMD
• Flynn’s taxonomy
ld
• MMX instructions
or
•
W
TU
JN
ld
or
END of INTRO –
W
- binary arithmetic
TU
JN