Computer Architecture: Trần Trọng Hiếu

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Computer Architecture

Trần Trọng Hiếu


Information Systems Department
Faculty of Information Technology
VNU - UET
hieutt@vnu.edu.vn

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

⚫ A very important abstraction:


⚫ interface between hardware and low-level software
⚫ standardizes instructions, machine language bit patterns, etc.
⚫ advantage: allows different implementations of the same
architecture
⚫ disadvantage: sometimes prevents adding new innovations

⚫ Modern instruction set architectures:


⚫ 80x86/Pentium/K6, PowerPC, DEC Alpha, MIPS, SPARC, HP

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

⚫ Managing memory and storage

⚫ Scheduling tasks & sharing resources

⚫ 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;

⚫ Level of abstraction closer to


problem domain C compiler

⚫ Provides for productivity and


portability Assembly swap:
language muli $2, $5,4

⚫ Assembly language program


(for MIPS)
add $2, $4,$2
lw $15, 0($2)
lw $16, 4($2)
⚫ Textual representation of sw $16, 0($2)
sw $15, 4($2)
instructions jr $31

⚫ Hardware representation
⚫ Binary digits (bits) Assembler

⚫ Encoded instructions and data


Binary machine 00000000101000010000000000011000
language 00000000100011100001100000100001
program 10001100011000100000000000000000
(for MIPS) 10001100111100100000000000000100
7/3/2019 20
10101100111100100000000000000000
10101100011000100000000000000100
00000011111000000000000000001000
Quiz?
⚫ How can computers play audio files?
⚫ How can they understand characters?

7/3/2019 21

You might also like