Lec 01 Abstractions Technology

Embed Size (px)

Citation preview

  • 8/9/2019 Lec 01 Abstractions Technology

    1/60

    COMPUTER ORGANIZATION AND DESIGN

    The Hardware/Software Interface

    5thEdition

    January 5, 2015

    Vara Varavithya

    Computer Organization

  • 8/9/2019 Lec 01 Abstractions Technology

    2/60

    COMPUTER ORGANIZATION AND DESIGN

    The Hardware/Software Interface

    5thEdition

    The lecture material for this course has beenadapted in part from UC Berkeley, Penn

    State, UB, and Publisher.

  • 8/9/2019 Lec 01 Abstractions Technology

    3/60

    Overview

    ! Administrative Matters (5 minutes)! Course Style, Philosophy and Structure (15

    min)

    ! Intro to Computer Architecture

    Chapter 1 Computer Abstractions and Technology 3

  • 8/9/2019 Lec 01 Abstractions Technology

    4/60

    Course Administration

    ! Instructor: Vara Varavithya ([email protected])

    Office Hours: By appointmen

    ! Materials: https://www.facebook.com/groups/629713900488373/

    ! Text: Computer Organization and Design: The Hardware/SoftwareInterface, Fifth Edition, Patterson and Hennessy

    Chapter 1 Computer Abstractions and Technology 4

    https://www.facebook.com/groups/629713900488373/
  • 8/9/2019 Lec 01 Abstractions Technology

    5/60

    Textbook purchase options

    !

    Paperback or eBook! CU University Bookstore on campus

    ! Patterson Computer Org & Design, 5thEdition

    !

    Amazon

    Chapter 1 Computer Abstractions and Technology 5

  • 8/9/2019 Lec 01 Abstractions Technology

    6/60

    Midterm Exams

    !

    Reduce the pressure of taking exams! 50 minutes

    ! Our goal: test knowledge vs. speed writing

    !

    All mid-terms closed book! Necessary sheets will be provided

    Chapter 1 Computer Abstractions and Technology 6

  • 8/9/2019 Lec 01 Abstractions Technology

    7/60

    Homework Assignments and Project

    ! Assignments consist of two parts! Homeworks Individual Effort: Exercises from the text book! Projects Team Effort: Lab assignments

    ! Homework assignments

    ! Exercises due in one week at beginning of lecture!

    Brief (15 minute) quiz on assignment material in lectureor recitations (several of them)

    ! Must understand assignment to do quiz

    ! No late assignments!

    ! Recitations will help solve problems

    ! Homeworks will not be graded, but checked forcompleteness

    Chapter 1 Computer Abstractions and Technology 8

  • 8/9/2019 Lec 01 Abstractions Technology

    8/60

    Project/Lab Summary

    !

    Verilog installed on Unix! SPIM available on Unix, Windows! Lab assignments:

    ! 2-3 Projects

    ! Written report

    Chapter 1 Computer Abstractions and Technology 10

  • 8/9/2019 Lec 01 Abstractions Technology

    9/60

    Grading

    ! Grade breakdown! Three Midterm Exams: 30%

    ! Final: 40%

    ! Homeworks: 10%

    ! Projects: 10%

    ! Quizzes: 10%

    ! Class Attendance: +10%

    Chapter 1 Computer Abstractions and Technology 11

  • 8/9/2019 Lec 01 Abstractions Technology

    10/60

    ! Cant make test! Tell us early and we will schedule alternate time, if appropriate

    ! Three Couponsfor 7 days extension, after that NO latehomeworks or labs

    ! What is cheating?!

    Common examples of cheating: running out of time on anassignment and then pick up output, take homework from anotherand copy, person asks to borrow solution just to take a look,copying an exam question, ...

    ! Studying together in groups is encouraged

    !

    Work must be your own! Better off to skip an assignment (rather than copying)

    ! But it doesnt help on quiz (15% of grade) anyway

    Course Problems

    Chapter 1 Computer Abstractions and Technology 12

  • 8/9/2019 Lec 01 Abstractions Technology

    11/60

    The Instruction Set: a Critical Interface

    Chapter 1 Computer Abstractions and Technology 14

    instruction set

    software

    hardware

  • 8/9/2019 Lec 01 Abstractions Technology

    12/60

    COMPUTER ORGANIZATION AND DESIGN

    The Hardware/Software Interface5th

    Edition

    Chapter 1

    Computer Abstractions and

    Technology

  • 8/9/2019 Lec 01 Abstractions Technology

    13/60

    Chapter 1 Computer Abstractions and Technology 18

    The Computer Revolution

    !

    Progress in computer technology! Underpinned by Moores Law

    ! Makes novel applications feasible! Computers in automobiles

    ! Cell phones

    ! Human genome project

    ! World Wide Web

    ! Search Engines

    ! Computers are pervasive

    1.1Introduction

  • 8/9/2019 Lec 01 Abstractions Technology

    14/60

    Chapter 1 Computer Abstractions and Technology 19

    Classes of Computers

    ! Personal computers! 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

  • 8/9/2019 Lec 01 Abstractions Technology

    15/60

    Classes of Computers

    ! Supercomputers! High-end scientific and engineering

    calculations! Highest capability but represent a small

    fraction of the overall computer market

    ! Embedded computers! Hidden as components of systems! Stringent power/performance/cost constraints

    Chapter 1 Computer Abstractions and Technology 20

  • 8/9/2019 Lec 01 Abstractions Technology

    16/60

    Chapter 1 Computer Abstractions and Technology 21

    The PostPC Era

  • 8/9/2019 Lec 01 Abstractions Technology

    17/60

  • 8/9/2019 Lec 01 Abstractions Technology

    18/60

    Chapter 1 Computer Abstractions and Technology 23

    What You Will Learn

    ! How programs are translated into themachine language! And how the hardware executes them

    ! The hardware/software interface

    ! What determines program performance! And how it can be improved

    ! How hardware designers improveperformance

    ! What is parallel processing

  • 8/9/2019 Lec 01 Abstractions Technology

    19/60

    Chapter 1 Computer Abstractions and Technology 24

    Understanding Performance

    ! Algorithm! Determines number of operations executed

    ! Programming language, compiler, architecture! Determine number of machine instructions executed

    per operation! Processor and memory system

    ! Determine how fast instructions are executed

    ! I/O system (including OS)! Determines how fast I/O operations are executed

  • 8/9/2019 Lec 01 Abstractions Technology

    20/60

    Eight Great Ideas

    ! Design for Moores Law

    ! Use abstractionto simplify design

    ! Make the common case fast

    !

    Performance viaparallelism! Performance viapipelining

    ! Performance viaprediction

    ! Hierarchyof memories

    ! Dependabilityviaredundancy

    Chapter 1 Computer Abstractions and Technology 25

    1.2EightGreatIdeasinCom

    puterArchitectu

    re

  • 8/9/2019 Lec 01 Abstractions Technology

    21/60

    Chapter 1 Computer Abstractions and Technology 26

    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

    1.3BelowYo

    urProgram

  • 8/9/2019 Lec 01 Abstractions Technology

    22/60

    Chapter 1 Computer Abstractions and Technology 27

    Levels of Program Code

    ! High-level language! Level of abstraction closer to

    problem domain! Provides for productivity and

    portability

    ! Assembly language! Textual representation of

    instructions

    ! Hardware representation!

    Binary digits (bits)! Encoded instructions and

    data

  • 8/9/2019 Lec 01 Abstractions Technology

    23/60

    Chapter 1 Computer Abstractions and Technology 28

    Components of a Computer

    ! Same components forall 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 other

    computers

    1.4UndertheCovers

    The BIG Picture

  • 8/9/2019 Lec 01 Abstractions Technology

    24/60

    Chapter 1 Computer Abstractions and Technology 29

    Touchscreen

    ! PostPC device

    ! Supersedes keyboardand mouse

    ! Resistive and

    Capacitive types! Most tablets, smart

    phones use capacitive

    ! Capacitive allows

    multiple touchessimultaneously

  • 8/9/2019 Lec 01 Abstractions Technology

    25/60

    Chapter 1 Computer Abstractions and Technology 30

    Through the Looking Glass

    ! LCD screen: picture elements (pixels)! Mirrors content of frame buffer memory

  • 8/9/2019 Lec 01 Abstractions Technology

    26/60

    Chapter 1 Computer Abstractions and Technology 31

    Opening the Box

    Capacitive multitouch LCD screen

    3.8 V, 25 Watt-hour battery

    Computer board

  • 8/9/2019 Lec 01 Abstractions Technology

    27/60

  • 8/9/2019 Lec 01 Abstractions Technology

    28/60

    Chapter 1 Computer Abstractions and Technology 33

    Inside the Processor

    ! Apple A5

  • 8/9/2019 Lec 01 Abstractions Technology

    29/60

    Chapter 1 Computer Abstractions and Technology 34

    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

    The BIG Picture

  • 8/9/2019 Lec 01 Abstractions Technology

    30/60

    Chapter 1 Computer Abstractions and Technology 35

    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)

  • 8/9/2019 Lec 01 Abstractions Technology

    31/60

    Chapter 1 Computer Abstractions and Technology 36

    Networks

    ! Communication, resource sharing, nonlocalaccess

    ! Local area network (LAN): Ethernet

    ! Wide area network (WAN): the Internet

    ! Wireless network: WiFi, Bluetooth

    1

  • 8/9/2019 Lec 01 Abstractions Technology

    32/60

    Chapter 1 Computer Abstractions and Technology 37

    Technology Trends

    ! Electronics

    technology continuesto evolve! Increased capacity

    and performance

    ! Reduced costDRAM capacity

    1.5Technolo

    giesforBuilding

    ProcessorsandMemory

  • 8/9/2019 Lec 01 Abstractions Technology

    33/60

    Semiconductor Technology

    ! Silicon: semiconductor

    ! Add materials to transform properties:! Conductors

    ! Insulators

    ! Switch

    Chapter 1 Computer Abstractions and Technology 38

  • 8/9/2019 Lec 01 Abstractions Technology

    34/60

    Chapter 1 Computer Abstractions and Technology 39

    Manufacturing ICs

    ! Yield: proportion of working dies per wafer

  • 8/9/2019 Lec 01 Abstractions Technology

    35/60

    Chapter 1 Computer Abstractions and Technology 40

    Intel Core i7 Wafer

    ! 300mm wafer, 280 chips, 32nm technology

    ! Each chip is 20.7 x 10.5 mm

  • 8/9/2019 Lec 01 Abstractions Technology

    36/60

    Chapter 1 Computer Abstractions and Technology 41

    Integrated Circuit Cost

    ! Nonlinear relation to area and defect rate! Wafer cost and area are fixed

    ! Defect rate determined by manufacturing process

    ! Die area determined by architecture and circuit design

    2area/2))Dieareaper(Defects(1

    1Yield

    areaDieareaWaferwaferperDies

    YieldwaferperDieswaferperCostdieperCost

    !+

    =

    "

    !

    =

    1

  • 8/9/2019 Lec 01 Abstractions Technology

    37/60

    Chapter 1 Computer Abstractions and Technology 42

    Defining Performance

    ! Which airplane has the best performance?

    Boeing 777

    Boeing 747

    BAC/Sud Concorde

    Douglas DC-8-50

    0 125 250 375 500

    Passenger Capacity

    Boeing 777

    Boeing 747

    BAC/Sud Concorde

    Douglas DC-8-50

    0 2250 4500 6750 9000

    Cruising Range (miles)

    Boeing 777

    Boeing 747

    BAC/Sud Concorde

    Douglas DC-8-50

    0 350 700 1050 1400

    Cruising Speed (mph)

    Boeing 777

    Boeing 747

    BAC/Sud Concorde

    Douglas DC-8-50

    0 75000 150000 225000 300000

    Passengers x mph

    .6Performa

    nce

  • 8/9/2019 Lec 01 Abstractions Technology

    38/60

    Chapter 1 Computer Abstractions and Technology 43

    Response Time and Throughput

    ! Response time! How long it takes to do a task

    ! Throughput! Total work done per unit time

    ! e.g., tasks/transactions/ per hour

    ! How are response time and throughput affectedby! Replacing the processor with a faster version?

    !

    Adding more processors?! Well focus on response time for now

  • 8/9/2019 Lec 01 Abstractions Technology

    39/60

    Chapter 1 Computer Abstractions and Technology 44

    Relative Performance

    ! Define Performance = 1/Execution Time

    ! X is ntime faster than Y

    n==XY

    YX

    timeExecutiontimeExecution

    ePerformancePerformanc

    ! Example: time taken to run a program! 10s on A, 15s on B

    ! Execution TimeB/ Execution TimeA= 15s / 10s = 1.5

    ! So A is 1.5 times faster than B

  • 8/9/2019 Lec 01 Abstractions Technology

    40/60

    Chapter 1 Computer Abstractions and Technology 45

    Measuring Execution Time

    ! Elapsed time! Total response time, including all aspects

    ! Processing, I/O, OS overhead, idle time

    ! Determines system performance

    !

    CPU time! Time spent processing a given job

    ! Discounts I/O time, other jobs shares

    ! Comprises user CPU time and system CPU

    time! Different programs are affected differently by

    CPU and system performance

  • 8/9/2019 Lec 01 Abstractions Technology

    41/60

    Chapter 1 Computer Abstractions and Technology 46

    CPU Clocking

    ! Operation of digital hardware governed by a

    constant-rate clock

    Clock (cycles)

    Data transferand computation

    Update state

    Clock period

    ! Clock period: duration of a clock cycle! e.g., 250ps = 0.25ns = 250!1012s

    ! Clock frequency (rate): cycles per second! e.g., 4.0GHz = 4000MHz = 4.0!109Hz

    C

  • 8/9/2019 Lec 01 Abstractions Technology

    42/60

    Chapter 1 Computer Abstractions and Technology 47

    CPU Time

    ! Performance improved by! Reducing number of clock cycles

    ! Increasing clock rate

    !

    Hardware designer must often trade off clockrate against cycle count

    RateClock

    CyclesClockCPU

    TimeCycleClockCyclesClockCPUTimeCPU

    =

    !=

    CPU Ti E l

  • 8/9/2019 Lec 01 Abstractions Technology

    43/60

    Chapter 1 Computer Abstractions and Technology 48

    CPU Time Example

    ! Computer A: 2GHz clock, 10s CPU time

    ! Designing Computer B! Aim for 6s CPU time

    ! Can do faster clock, but causes 1.2 !clock cycles

    ! How fast must Computer B clock be?

    4GHz6s

    1024

    6s

    10201.2RateClock

    10202GHz10s

    RateClockTimeCPUCyclesClock

    6s

    CyclesClock1.2

    TimeCPU

    CyclesClockRateClock

    99

    B

    9

    AAA

    A

    B

    BB

    =

    !

    =

    !!

    =

    !=!=

    !=

    !

    ==

    I t ti C t d CPI

  • 8/9/2019 Lec 01 Abstractions Technology

    44/60

    Chapter 1 Computer Abstractions and Technology 49

    Instruction Count and CPI

    ! Instruction Count for a program! Determined by program, ISA and compiler

    ! Average cycles per instruction! Determined by CPU hardware

    ! If different instructions have different CPI! Average CPI affected by instruction mix

    RateClock

    CPICountnInstructio

    TimeCycleClockCPICountnInstructioTimeCPUnInstructioperCyclesCountnInstructioCyclesClock

    !

    =

    !!=

    !=

    CPI E l

  • 8/9/2019 Lec 01 Abstractions Technology

    45/60

    Chapter 1 Computer Abstractions and Technology 50

    CPI Example

    ! Computer A: Cycle Time = 250ps, CPI = 2.0! Computer B: Cycle Time = 500ps, CPI = 1.2! Same ISA! Which is faster, and by how much?

    1.2500psI

    600psI

    ATimeCPU

    BTimeCPU

    600psI500ps1.2I

    BTimeCycle

    BCPICountnInstructio

    BTimeCPU

    500psI250ps2.0I

    ATimeCycleACPICountnInstructioATimeCPU

    =

    !

    !

    =

    !=!!=

    !!=

    !=!!=

    !!=

    A is faster

    by this much

  • 8/9/2019 Lec 01 Abstractions Technology

    46/60

    CPI E l

  • 8/9/2019 Lec 01 Abstractions Technology

    47/60

    Chapter 1 Computer Abstractions and Technology 52

    CPI Example

    ! Alternative compiled code sequences using

    instructions in classes A, B, C

    ! Sequence 1: IC = 5!

    Clock Cycles= 2!1 + 1!2 + 2!3= 10

    ! Avg. CPI = 10/5 = 2.0

    ! Sequence 2: IC = 6!

    Clock Cycles= 4!1 + 1!2 + 1!3= 9

    ! Avg. CPI = 9/6 = 1.5

    P f S

  • 8/9/2019 Lec 01 Abstractions Technology

    48/60

    Chapter 1 Computer Abstractions and Technology 53

    Performance Summary

    ! Performance depends on! Algorithm: affects IC, possibly CPI

    ! Programming language: affects IC, CPI

    ! Compiler: affects IC, CPI

    ! Instruction set architecture: affects IC, CPI, Tc

    The BIG Picture

    cycleClock

    Seconds

    nInstructio

    cyclesClock

    Program

    nsInstructioTimeCPU !!=

  • 8/9/2019 Lec 01 Abstractions Technology

    49/60

    R d i P

  • 8/9/2019 Lec 01 Abstractions Technology

    50/60

    Chapter 1 Computer Abstractions and Technology 55

    Reducing Power

    ! Suppose a new CPU has! 85% of capacitive load of old CPU

    ! 15% voltage and 15% frequency reduction

    0.520.85FVC

    0.85F0.85)(V0.85CPP 4

    old

    2

    oldold

    old

    2

    oldold

    old

    new ==

    !!

    !!!!!

    =

    ! The power wall!

    We cant reduce voltage further! We cant remove more heat

    ! How else can we improve performance?

    U i P f1.8

  • 8/9/2019 Lec 01 Abstractions Technology

    51/60

    Chapter 1 Computer Abstractions and Technology 56

    Uniprocessor Performance8TheSeaChange:TheSw

    itchtoMultiprocessors

    Constrained by power, instruction-level parallelism,memory latency

    M lti

  • 8/9/2019 Lec 01 Abstractions Technology

    52/60

    Chapter 1 Computer Abstractions and Technology 57

    Multiprocessors

    ! Multicore microprocessors! More than one processor per chip

    ! Requires explicitly parallel programming! Compare with instruction level parallelism

    ! Hardware executes multiple instructions at once

    ! Hidden from the programmer

    ! Hard to do!

    Programming for performance! Load balancing

    ! Optimizing communication and synchronization

    SPEC CPU B h k

  • 8/9/2019 Lec 01 Abstractions Technology

    53/60

    Chapter 1 Computer Abstractions and Technology 58

    SPEC CPU Benchmark

    ! Programs used to measure performance! Supposedly typical of actual workload

    ! Standard Performance Evaluation Corp (SPEC)! Develops benchmarks for CPU, I/O, Web,

    ! 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

    1i

    iratiotimeExecution!

    =

    CINT2006 f I t l C i7 920

  • 8/9/2019 Lec 01 Abstractions Technology

    54/60

    Chapter 1 Computer Abstractions and Technology 59

    CINT2006 for Intel Core i7 920

    SPEC Power Benchmark

  • 8/9/2019 Lec 01 Abstractions Technology

    55/60

    Chapter 1 Computer Abstractions and Technology 60

    SPEC Power Benchmark

    ! Power consumption of server at differentworkload levels! Performance: ssj_ops/sec

    ! Power: Watts (Joules/sec)

    !"

    #$%

    &!"

    #$%

    &= ''

    ==

    10

    0i

    i

    10

    0i

    i powerssj_opsWattperssj_opsOverall

    SPEC j2008 f X X5650

  • 8/9/2019 Lec 01 Abstractions Technology

    56/60

    Chapter 1 Computer Abstractions and Technology 61

    SPECpower_ssj2008 for Xeon X5650

    Pitfall: Amdahls Law1.1

  • 8/9/2019 Lec 01 Abstractions Technology

    57/60

    Chapter 1 Computer Abstractions and Technology 62

    Pitfall: Amdahls Law

    ! Improving an aspect of a computer and

    expecting a proportional improvement in overallperformance

    0FallaciesandPitfalls

    2080

    20 +=n

    ! Cant be done!

    unaffectedaffected

    improved T

    factortimprovemen

    TT +=

    ! Example: multiply accounts for 80s/100s! How much improvement in multiply performance to

    get 5!overall?

    ! Corollary: make the common case fast

    Fallacy: Low Power at Idle

  • 8/9/2019 Lec 01 Abstractions Technology

    58/60

    Chapter 1 Computer Abstractions and Technology 63

    Fallacy: Low Power at Idle

    ! Look back at i7 power benchmark! At 100% load: 258W

    ! At 50% load: 170W (66%)

    ! At 10% load: 121W (47%)

    ! Google data center! Mostly operates at 10% 50% load

    ! At 100% load less than 1% of the time

    ! Consider designing processors to makepower proportional to load

  • 8/9/2019 Lec 01 Abstractions Technology

    59/60

    Concluding Remarks1.9

  • 8/9/2019 Lec 01 Abstractions Technology

    60/60

    Concluding Remarks

    ! Cost/performance is improving! Due to underlying technology development

    ! Hierarchical layers of abstraction! In both hardware and software

    ! Instruction set architecture! The hardware/software interface

    ! Execution time: the best performance

    measure! Power is a limiting factor

    ! Use parallelism to improve performance

    Concludin

    gRemarks