Top Banner
Lecture 02: Fundamentals of Computer Design - Basics Kai Bu [email protected] http://list.zju.edu.cn/kaibu/comparch2015
51
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Lecture 02: Fundamentalsof Computer Design

- Basics

Kai [email protected]

http://list.zju.edu.cn/kaibu/comparch2015

Page 2: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Chapter 1.1-1.3

Page 3: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

• What types of computers?• Why are computers be fast?• What is computer architecture?

Preview

Page 4: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

What types of computers?

Page 5: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

5 Classes of Computers

• PMD: Personal Mobile Device• Desktop• Server• Cluster/WSC (warehouse-scale

computer)• Embedded computer

Page 6: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

PMD: Personal Mobile Device

• Wireless devices with multimedia user interfaces

• cell phones, tablet computers, etc.• a few hundred dollars

Page 7: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

PMD Characteristics

• Cost effectivenessless expensive packaging

absence of fan for cooling

Page 8: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

PMD Characteristics

• Responsiveness & Predictabilityreal-time performance:

a maximum execution time for each app segmentsoft real-time: trade time of a certain event for others’;tolerate occasionally missed time constraint on an event, as long as not too many are missed;

Page 9: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

PMD Characteristics

• Memory efficiencyoptimize code size

• Energy efficiencybattery power

heat dissipation

Page 10: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Desktop Computing

• Largest market share• low-end netbooks: $x00• …• high-end workstations: $x000

Page 11: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Desktop Characteristics

• Price-Performancecombination of performance and price;compute performancegraphics performance

• The most important to customers,and hence to computer designers

Page 12: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Servers

• Provide large-scale and reliable file and computing services (to desktops)

• Constitute the backbone of large-scale enterprise computing

Page 13: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Servers Characteristics

• Availabilityagainst high-cost server failure

Page 14: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Servers Characteristics

• Scalabilityin response to increasing demand with scaling up computing capacity, memory, storage, and I/O bandwidth

• Efficient throughputtoward handling more requests in a unit time

Page 15: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Clusters/WSCsWarehouse-Scale Computerscollections of desktop computers or serversconnected by local area networks (LANs)

to act as a single larger computer

Characteristicsprice-performance, power, availability

Page 16: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Embedded Computers

hide everywhere

Page 17: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Embedded vs Non-embedded• Dividing line

the ability to run third-party software

• Embedded computers’ primary goalmeet the performance need at a minimum price;rather than achieve higher performance at a higher price

Page 18: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

What makes computers fast?

Page 19: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Parallelism

• Multi-task simultaneously takes effect

Application parallelismHardware parallelism

Page 20: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Application Parallelism

• DLP: Data-Level Parallelismmany data items being operated onat the same time

• TLP: Task-Level Parallelismtasks of work created to operate independently and largely in parallel

Page 21: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Hardware Parallelism

• Hardware exploits application parallelism in four ways:

Instruction-Level ParallelismVector Architectures and GPUsThread-Level ParallelismRequest-Level Parallelism

Page 22: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Hardware Parallelism

• Instruction-Level Parallelismexploits data-level parallelismat modest levels – pipelining

divide a task to steps;

simultaneously run different steps of different tasks.

at medium levels – speculative exec do some work in advance;

prevent delay when the work is needed.

Page 23: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Hardware Parallelism

• Vector Architectures & GPUs (Graphic Process Units)exploit data-level parallelismapply a single instruction to a collection of data in parallel

Page 24: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Hardware Parallelism

• Thread-Level Parallelismexploits either DLP or TLPin a tightly coupled hardware modelthat allows for interaction among parallel threads

Page 25: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Hardware Parallelism

• Request-Level Parallelismexploits parallelism among largely decoupled tasks specified by the programmer or the OS

Page 26: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Classes of Parallel Architectures

• by Michael FlynnSingle/Multiple Instruction/Data stream

SISDSIMDMISDMIMD

Page 27: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

SISD

• Single instruction stream, single data stream – uniprocessor

• Can exploit instruction-level parallelism

Page 28: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

SIMD

• Single instruction stream, multiple data stream

• The same instruction is executed by multiple processors using different data streams.

• Exploits data-level parallelism• Data memory for each processor;

whereas a single instruction memory and control processor.

Page 29: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

MISD

• Multiple instruction streams, single data stream

• No commercial multiprocessor of this type yet

Page 30: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

MIMD

• Multiple instruction streams, multiple data streams

• Each processor fetches its own instructions and operates on its own data.

• Exploits task-level parallelism

Page 31: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

What’s computer architecture?

Page 32: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Computer Architecture

• Used to refer only to instruction set design

Page 33: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

What’s instruction set architecture?

Page 34: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Instruction Set Architecture

ISA• actual programmer-visible instruction

set• the boundary between software and

hardware• 7 major dimensions

Page 35: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

ISA: Class

• Most are general-purpose register architectures with operands of either registers or memory locations

• Two popular versionsregister-memory ISA: e.g., 80x86

many instructions can access memoryload-store ISA: e.g., ARM, MIPS

only load or store instructions can access memory

Page 36: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

ISA: Memory Addressing

• Byte addressing• Aligned address

object width: s bytesaddress: Aaligned if A mod s = 0

Page 37: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Why alignment?

Page 38: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Each misaligned object requires two memory accesses

Page 39: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

ISA: Addressing Modes

• Specify the address of a memory object:

Register, Immediate, Displacement

constant register + constant

Page 40: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

ISA: Types and Sizes of OPerands

Type Size in bits

ASCII character 8

Unicode characterHalf word

16

Integerword

32

Double wordLong integer

64

IEEE 754 floating point – single precision

32

IEEE 754 floating point – double precision

64

Floating point –extended double precision

80

Page 41: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

ISA: Operations

• Four general categoriesdata transferarithmetic logicalcontrolfloating point

Page 42: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

MIPS64 Operations

• Data transfer

Page 43: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

MIPS64 Operations

• Arithmetic Logical

Page 44: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

MIPS64 Operations

• Control

Page 45: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

MIPS64 Operations

• Floating point

Page 46: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

ISA: Control Flow Instructions

• Types:conditional branchesunconditional jumpsprocedure callsreturns

• Branch address: add an address field to PC (program counter)

Page 47: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

ISA: Encoding an ISA

• Fixed length: ARM, MIPS – 32 bits• Variable length: 80x86 – 1~18 bytes

http://en.wikipedia.org/wiki/MIPS_architecture

Start with a 6-bit opcode.

R-type: register three registers,

a shift amount field, and a function field;

I-type: immediate two registers,

a 16-bit immediate value; J-type: jump

a 26-bit jump target.

Page 48: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Again,what’s computer architecture?

Page 49: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Computer Architecture

ISA Organization Hardwareactual programmervisible instruction set;boundary between swand hw;

high-level aspectsof computer design:

memory system,memory

interconnect,design of internal processor or CPU;

computer specifics:logic design,packaging tech;

Computer architects must design the organization and hardware to meet functional requirements as well as price, power, performance, and availability goals.

Page 50: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

Review

• 5 classes of computers• Parallelism• Instruction set architecture• Computer architecture

Page 51: Lecture 02: Fundamentals of Computer Design - Basics Kai Bu kaibu@zju.edu.cn .

?