Transcript ch1
Computer Architecture
CS401
Sabanci University
[email protected]
4/6/2016
Erkay Savas
1
Outline
•
•
•
•
Brief Overview
What is under a computer program
Components
Roadmap for this class
4/6/2016
Erkay Savas
2
Things You will be Learning
• How computers work; the basic foundation
• How to analyze their performance and
how not to
• Key technologies determining the modern
processor performance
–
–
–
–
–
–
Datapath
Pipeline
Cache
Memory Hierarchy
I/O
Multiprocessors
4/6/2016
Erkay Savas
3
Below the Software
• Abstraction
– Delving into the depths reveals more information
– An abstraction omits unneeded detail, helps us cope
with complexity
– Computers might be very different from what we
think they are when we look at it at the hardware
level.
– In fact, they can be communicated only by sending
them electrical signals: HIGH/LOW voltage
– First level of abstraction is to designate these signals
as TRUE/FALSE and 1/0
– We often think that the true language of the
computers is binary numbers
4/6/2016
Erkay Savas
4
Instruction Set Architecture
• Important abstraction
– interface between hardware and low-level software
• Or features available to programmers
– instructions
• e.g. does a computer have an multiply instruction?
– instruction coding
– number of bits to represent data
– I/O mechanism.
– addressing mechanism
• Modern instruction set architectures:
– 80x86/Pentium/K6, PowerPC, DEC Alpha, MIPS,
SPARC, HP, ARM.
4/6/2016
Erkay Savas
5
Organization
• Organization is how features are implemented in
hardware
–
–
–
–
Transparent to programmers
different implementations of the same architecture
Control signals, interfaces, memory technology.
e.g. Is there a hardware multiply unit or is it done by
repeated addition?
4/6/2016
Erkay Savas
6
How to Program a Computer?
• Most natural way is to encode whatever you
want to tell the computer to do with
electrical signals (on and off)
– since this is the only thing it understands
• Of course, we need something simpler to
work with
• Machine Code
• Assembly language
• High-level languages
– C/C++, Pascal, Fortran, Java, C#
4/6/2016
Erkay Savas
7
Processing a C Program
High-level language
program (in C)
swap (int v[], int k){
int temp;
temp = v[k];
v[k] = v[k+1];
v[k+1] = temp;
}
Binary machine
language program
for MIPS
4/6/2016
Assembly language
program for MIPS
C compiler
0000000010100001000000000001
10000000000010001110000110000
01000011000110001100010000000
00000000001000110011110010000
00000000001001010110011110010
00000000000000001010110001100
01000000000000001000000001111
1000000000000000001000
Erkay Savas
swap:
muli
add
lw
lw
sw
sw
jr
$2,
$2,
$15,
$16,
$16,
$15,
$31
$5, 4
$4, $2
0($2)
4($2)
0($2)
4($2)
Assembler
8
Functions of a Computer
•
•
•
•
Data processing
Data storage
Data movement
Control
4/6/2016
Erkay Savas
9
Functions of a Computer
source & destination of data
data movements
apparatus
Control
mechanism
Data processing
facility
Data storage
facility
4/6/2016
Erkay Savas
10
Five Classic Components
Computer
Processor
Datapath
Memory
Control
4/6/2016
Input
Output
Erkay Savas
System Interconnection
11
Motherboard
PS/2
connectors
USB 2.0
SIMM
Sockets
Sound
PCI
Card
Slots
4/6/2016
Parallel/Serial
Processor
IDE
Connectors
Erkay Savas
12
Inside the Processor Chip
Instruction
Cache
Data
Cache
4/6/2016
Control
Bus
Erkay Savas
branch
prediction
integer floating-point
datapath
datapath
13
Computer
peripherals
CPU
computer
I/O
System
interconnection
Memory
network
4/6/2016
Erkay Savas
14
CPU
ALU
CPU
Internal CPU
interconnection
Cache
Memory
4/6/2016
Registers
Erkay Savas
Control
Unit
15
Memory
• Nonvolatile:
– ROM
– Hard disk, floppy disk, magnetic tape, CDROM, USB
Memory
• Volatile
– DRAM used usually for main memory
– SRAM used mainly for on-chip memory such as
register and cache
– DRAM is much less expensive than SRAM
– SRAM is much faster than DRAM
4/6/2016
Erkay Savas
16
DRAM and Processor Characteristics
4/6/2016
Erkay Savas
17
Solutions to Memory Problems
• Increase number of bits retrieved at one time
– Make DRAM “wider” rather than “deeper”
• Change DRAM interface
– Cache
• Reduce frequency of memory access
– More complex cache and cache on chip
• Increase interconnection bandwidth
– High speed buses
– Hierarchy of buses
4/6/2016
Erkay Savas
18
Computer Networks
• Very essential aspect of computer systems
– Communication
– Resource sharing
– Remote access
• Ethernet is the most popular LAN
– Range is limited to 1 kilometer
– 3 Mbit/s to 10 Gbit/s
– Coaxial cable to twisted pair to optical fiber
• Wide Area Networks (WAN)
– Cross continents and backbone of the Internet
4/6/2016
Erkay Savas
19
Roadmap
•
•
•
•
•
•
•
•
Performance issues
Instruction set of MIPS
Arithmetic and ALU
Constructing a processor to execute our
instructions (datapath design)
Pipelining
Memory hierarchy: caches and virtual memory
I/O
Multiprocessors
4/6/2016
Erkay Savas
20