Computer Architecture Introduction
Computer Architecture Introduction
Dina Tantawy
Computer Engineering Department
Cairo University
Agenda
• Introduction
• Eight great ideas in computer architecture
• Performance
• Real stuff: Benchmarking the Intel core i7
• Fallacies and pitfalls
Introduction
• This course is all about how computers work
software
instruction set
hardware
Instruction Set Architecture (ISA)
• The instruction set provides commands to the processor, to tell it
what it needs to do.
• The instruction set consists of addressing modes, instructions,
native data types, registers, memory architecture, interrupt,
exception handling, and external I/O.
Instruction Set Architecture (ISA)
• Modern instruction set architectures:
– IA-32, PowerPC, MIPS, SPARC, ARM, RISC-V and others
Computer Components
• The five classic components of a computer are input, output,
memory, datapath, and control, with the last two sometimes
combined and called the processor.
Computer Components
Inside the Processor - Datapath
• Datapath is the hardware that performs all the required operations.
• The datapath is the "brawn" of a processor, since it implements the
fetch-decode-execute cycle.
Inside the Processor - Control
• Control is the hardware that tells the datapath what to do, in terms of
switching, operation selection, data movement between ALU
components.
• The Control is the “Brain” of the processor.
Performance
Defining Performance
• Which airplane has the best performance?
BAC/Sud BAC/Sud
Concorde Concorde
Douglas Douglas DC-
DC-8-50 8-50
0 100 200 300 400 500 0 2000 4000 6000 8000 10000
BAC/Sud BAC/Sud
Concorde Concorde
Douglas Douglas DC-
DC-8-50 8-50
• Throughput (bandwidth)
— How many jobs can the machine run at once?
— What is the average execution rate?
— How much work is getting done?
PerformanceX / PerformanceY = n
Relative Performance
• Computer A runs a program in 10s and
• computer B runs it in 15s
• how much faster is A than B?
Relative Performance
• If Computer A runs a program in 10s and computer B runs it in 15s,
how much faster is A than B?
– Performance A/ Performance B = Execution Time B/ Execution Time A
= 15/10 = 1.5
Clock period
Clock (cycles)
Data transfer
and computation
Update state
• Performance improved by
– Reducing number of clock cycles
– Increasing clock rate
– Hardware designer must often trade off clock
rate against cycle count
How many cycles are required for a program?
2nd instruction
3rd instruction
1st instruction
4th
5th
6th
...
time
Why? hint: remember that these are machine instructions, not lines of C code
Different numbers of cycles for different instructions
time
registers
A compiler designer is trying to decide between Which sequence will be faster? How much?
two code sequences for a particular machine.
Based on the hardware implementation, there are
three different classes of instructions: Class A,
Class B, and Class C, and they require one, two,
and three cycles (respectively).
A compiler designer is trying to decide Which sequence will be faster? How much?
between two code sequences for a
particular machine. Based on the
hardware implementation, there are
three different classes of instructions: Clock cycles = σ 𝐶𝑃𝐼𝑖 × 𝐼𝐶𝑖
Class A, Class B, and Class C, and they
require one, two, and three cycles
(respectively).
Store 10% 3 .3 .3 .3 .3
.4 .4 .2 .4
Branch 20% 2
Programming
language
Compiler
ISA
Core
organization
Technology
Determinates of CPU Performance
CPU time = Instruction_count x CPI x clock_cycle
Programming X X
language
Compiler X X
ISA
X X X
Core
X X
organization
Technology
X
Component Analysis
Performance Summary
The BIG Picture
• Performance depends on
– Algorithm: affects IC, possibly CPI
– Programming language: affects IC, CPI
– Compiler: affects IC, CPI
– Instruction set architecture: affects IC, CPI, Tc
Pitfall 1
• Can we use subset of the performance equation as a performance
measure ?? !!!
• SPEC CPU2006
– Elapsed time to execute a selection of programs
• Negligible I/O, so focuses on CPU performance
– Normalize relative to reference machine
– Summarize as geometric mean of performance ratios
• CINT2006 (integer) and CFP2006 (floating-point)
n
n
Execution time ratio
i=1
i
CINT2006 for Intel Core i7 920
Recap
• Introduction
• Eight great ideas in computer architecture
• Performance
• Real stuff: Benchmarking the Intel core i7
• Fallacies and pitfalls