Professional Documents
Culture Documents
Computer Architecture: Trần Trọng Hiếu
Computer Architecture: Trần Trọng Hiếu
Computer Architecture: Trần Trọng Hiếu
7/3/2019 1
Introduction
7/3/2019 2
The Computer Revolution
⚫ Makes novel applications feasible
⚫ Computers in automobiles
⚫ Cell phones
⚫ World Wide Web
⚫ Search Engines
⚫ Computers are pervasive
7/3/2019 3
Classes of Computers
⚫ Desktop computers/ Handheld devices
⚫ General purpose, variety of software
⚫ Subject to cost/performance tradeoff
⚫ Server computers
⚫ Network based
⚫ High capacity, performance, reliability
⚫ Range from small servers to building sized
⚫ Embedded computers
⚫ Hidden as components of systems
⚫ Stringent power/performance/cost constraints
7/3/2019 4
Components of a Computer
⚫ Same components for
all kinds of computer
⚫ Desktop, server,
embedded
⚫ Input/output includes
⚫ User-interface devices
⚫ Display, keyboard, mouse
⚫ Storage devices
⚫ Hard disk, CD/DVD, flash
⚫ Network adapters
⚫ For communicating with
7/3/2019 other computers 5
Anatomy of a Computer
Output
device
Network
cable
Input Input
device device
7/3/2019 6
Opening the Box
7/3/2019 7
The Processor
⚫ AMD Barcelona: 4 processor cores
7/3/2019 8
RAM (Random Access
Memory)
7/3/2019 9
A Safe Place for Data
⚫ Volatile main memory
⚫ Loses instructions and data when power off
⚫ Non-volatile secondary memory
⚫ Magnetic disk
⚫ Flash memory
⚫ Optical disk (CDROM, DVD)
7/3/2019 10
Memory Hierarchy Levels
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
(10,000,000 ns)
Disk
~ $1 / GByte user/operator
Files Mbytes
Larger
Tape
infinite Tape Lower Level
sec-min
7/3/2019 11
~$1 / GByte
Networks
⚫ Communication and resource sharing
⚫ Local area network (LAN): Ethernet
⚫ Within a building
⚫ Wide area network (WAN: the Internet
⚫ Wireless network: WiFi, Bluetooth
7/3/2019 12
Inside structure
7/3/2019 13
Abstractions
⚫ Abstraction helps us deal with complexity
⚫ Hide lower-level detail
⚫ Instruction set architecture (ISA)
⚫ The hardware/software interface
⚫ Application binary interface
⚫ The ISA plus system software interface
⚫ Implementation
⚫ The details underlying and interface
7/3/2019 14
What is Computer Architecture?
Easy Answer
Computer Architecture =
Instruction Set Architecture +
Machine Organization
7/3/2019 15
The Instruction Set:
a Critical Interface
software
instruction set
hardware
7/3/2019 16
Instruction Set Architecture
7/3/2019 17
What You Will Learn
⚫ How programs are translated into the
machine language
⚫ And how the hardware executes them
⚫ The hardware/software interface
⚫ What determines program performance
⚫ And how it can be improved
⚫ How hardware designers improve
performance
7/3/2019 18
Below Your Program
⚫ Application software
⚫ Written in high-level language
⚫ System software
⚫ Compiler: translates HLL code to
machine code
⚫ Operating System: service code
⚫ Handling input/output
⚫ Hardware
⚫ Processor, memory, I/O controllers
7/3/2019 19
Levels of Program Code High-level
language
swap(int v[], int k)
{int temp;
program temp = v[k];
(in C) v[k] = v[k+1];
⚫ High-level language }
v[k+1] = temp;
⚫ Hardware representation
⚫ Binary digits (bits) Assembler
7/3/2019 21