CA Lec1
CA Lec1
Lecture 0: Introduction
1
Course Information
o Instructor
n Dr. Nguyen Minh Son ([email protected])
o Office: Faculty of CE, Building E6.5
o Textbook Required
n David A. Patterson and John L. Hennessy, Computer
Organization and Design: The Hardware/Software Interface
(4th edition), Morgan Kaufmann, 2008.
o Other teaching materials
n Some reference books available in class meetings and course
web
n Slides & Lectures
n Coordinator: …
Reading references
2
Objectives – To Learn
Recent trends of architectural features in high-performance
computer systems
o Week 1: Computer Abstractions and Technology
o Week 2,3: Instructions - Language of the Computer
o Week 4,5: Arithmetic for Computers
o Week 6,7: Assessing and Understanding Performance
o Week 8: Mid-Term Exam
o Week 9,10,11: The processor – Datapath and Control
o Week 12,13,14: Pipelining - Datapath and Control
o Week 15: Presentation – Term-Projects
o Optional: Large and Fast Exploiting Memory Hierarchy
o Week 16: Final Exam
3
Course evaluation
o Grading policy:
n Quizzes (attendance): 25%
n Midterm exam: 25% (Multiple choice and Essay)
n Final exam: 50% (Multiple choice and Essay)
o No cheating ?!
4
Computer Architecture
5
In Your Course
o Mix of lecture vs. discussion
n Depends on how well reading is done before class
o Goal is to learn how to know a computer system
n Learn fundamental computer organization: machanism,
sequential and parallel computing.
n Learn how to evaluate and measure the performance of
computer system.
6
Course Focus
o Understanding machine structures, technology
factors, evaluation methods that will determine the
form of computers in 21st Century
8
The Computer Revolution
Year Technology Relative performance/cost
n Computers in automobiles
n Cell phones
n WWW, Search Engines
o Computers are pervasive
n Internet of Things
9
The Processor Market
o Number of distinct processors sold between 1998 and
2002
10
Internet of Things
11
Internet of Things
12
Computer System: Layers
o Application software
n Written in high-level language
o System software
n Compiler: translates HLL code to
machine code
n Operating System: service code
o Handling input/output
o Managing memory and storage
o Scheduling tasks & sharing resources
o Hardware
n Processor, memory, I/O controllers
Breakdown of a Computing Problem
Programming in Compiler/Assembler/
Problem Algorithms
High-Level Language Linker
Apps Trend
Instruction Set Architecture (ISA)
Target Machine
Micro-architecture
(one implementation)
System architecture
Functional units/
Data Path
Technology Trend
Gates Level
Design
Transistors Manufacturing
14
Computer as Problem Solver
What is a problem?
• A problem requires some unprocessed facts (data) converted
into useful results (information)
--------------
Katie 70
-----
--------------
---
------
Jane 65 Brain
Bob 79
Averaging
Technique
Average=73.5
Computer: A more efficient Problem Solver
Average=73.5
John 80
Katie 70
Jane 65
Bob 79
Averaging Technique
(Computer Software)
Manufacturing ICs
18
What Computer Architecture bring to Table
19
1) Taking Advantage of Parallelism
o Increasing throughput of server computer via multiple processors
or multiple disks
o Detailed HW design
n Carry lookahead adders uses parallelism to speed up computing
sums from linear to logarithmic in number of bits per operand
n Multiple memory banks searched in parallel in set-associative caches
o Pipelining: overlap instruction execution to reduce the total time to
complete an instruction sequence
n Not every instruction depends on immediate predecessor Þ
executing instructions completely/partially in parallel possible
n Classic 5-stage pipeline:
1) Instruction Fetch (Ifetch),
2) Register Read (Reg),
3) Execute (ALU),
4) Data Memory Access (Dmem),
5) Register Write (Reg)
20
Pipelined Instruction Execution
Time (clock cycles)
ALU
n Ifetch Reg DMem Reg
s
t
r.
ALU
Ifetch Reg DMem Reg
O
r
ALU
Ifetch Reg DMem Reg
d
e
r
ALU
Ifetch Reg DMem Reg
21
Limits to Pipelining
o Hazards prevent next instruction from executing during its
designated clock cycle
n Structural hazards: attempt to use the same hardware to do two
different things at once
n Data hazards: Instruction depends on result of prior instruction still
in the pipeline
n Control hazards: Caused by delay between the fetching of
instructions and decisions about changes in control flow (branches
and jumps). Time (clock cycles)
ALU
Ifetch Reg DMem Reg
n
s
ALU
Ifetch Reg DMem Reg
t
r.
ALU
Ifetch Reg DMem Reg
O
ALU
r Ifetch Reg DMem Reg
d
e
r
22
2) The Principle of Locality
P $ MEM
23
Level of the Memory Hierarchy
Capacity
Access Time Staging
Cost Xfer Unit
CPU Registers
Registers Upper Level
100s Bytes
300 – 500 ps (0.3-0.5 ns) prog./compiler
Instr. Operands 1-8 bytes faster
L1 and L2 Cache L1 Cache
10s-100s K Bytes cache cntl
~1 ns - ~10 ns Blocks 32-64 bytes
$1000s/ GByte
L2 Cache
cache cntl
Main Memory Blocks 64-128 bytes
G Bytes
80ns- 200ns Memory
~ $100/ GByte
OS
Pages 4K-8K bytes
Disk
10s T Bytes, 10 ms Disk
(10,000,000 ns)
~ $1 / GByte user/operator
Files Mbytes
Larger
Tape
infinite Tape Lower Level
sec-min
~$1 / GByte
24
3) Focus on the Common Case
o Common sense guides computer design
n Since its engineering, common sense is valuable
25
4) Computer Performance: Amdahl’s Law
o Make the common case faster
o Speedup 1
= Perfnew / Perfold = Told / Tnew = f
(1 − f ) +
P
o Performance improvement from using faster mode is limited by the
fraction the faster mode can be applied.
Told
(1 - f) f
Tnew
(1 - f) f/P
26
CPI
5) Processor Performance Equation
27
Conclusion
o Computer Architecture =
Computer Organization + Design & Performance
Application
Operating
System
Compiler Firmware
Instruction Set
Architecture
Instars. Set Proc.I/O system
Datapath & Control
Digital Design
Circuit Design
Layout
28
Enjoy !!!
Q&A
29