COMPUTER ARCHITECTURE AND OPERATING SYSTEMS

Transcription

COMPUTERARCHITECTURE ANDOPERATING SYSTEMS(CS31702)

Syllabus Architecture:– Basic organization,– fetch-decode-execute cycle,– data path and control path,– instruction set architecture,– I/O subsystems, interrupts, memory hierarchy, overview ofpipelined architecture. Operating systems:– An overview,– process management,– user and supervisor modes,– process synchronization, semaphores,– memory management, virtual memory,– file systems, I/O systems.

BooksComputer Architecture: David A. Patterson and John L. Hennessy, ComputerOrganization and Design: The Hardware/Software Interface,Elsevier. Carl Hamachar, Zvonco Vranesic and Safwat Zaky,Computer Organization, McGraw-Hill. John P. Hayes, Computer Architecture and Organization,McGraw-Hill.Operating System: Avi Silberschatz, Peter Galvin, Greg Gagne, OperatingSystem Concepts, Wiley Asia Student Edition. William Stallings, Operating Systems: Internals and DesignPrinciples, Prentice Hall of India.

COMPUTER ORGANIZATION AND DESIGN5EditionthThe Hardware/Software InterfaceChapter 1Computer Abstractions andTechnology

Progress in computer technology Makes novel applications feasible Underpinned by Moore’s Law – 2x integrationdensity every 18 months§1.1 IntroductionThe Computer RevolutionComputers in automobilesCell phonesHuman genome projectWorld Wide WebSearch EnginesComputers are pervasiveChapter 1 — Computer Abstractions and Technology — 5

Classes of Computers Personal computers General purpose, variety of softwareSubject to cost/performance tradeoffServer computers Network basedHigh capacity, performance, reliabilityRange from small servers to building sizedChapter 1 — Computer Abstractions and Technology — 6

Classes of Computers Supercomputers High-end scientific and engineeringcalculationsHighest capability but represent a smallfraction of the overall computer marketEmbedded computers Hidden as components of systemsStringent power/performance/cost constraintsChapter 1 — Computer Abstractions and Technology — 7

The PostPC EraChapter 1 — Computer Abstractions and Technology — 8

The PostPC Era Personal Mobile Device (PMD) Battery operatedConnects to the InternetHundreds of dollarsSmart phones, tablets, electronic glassesCloud computing Warehouse Scale Computers (WSC)Software as a Service (SaaS)Portion of software run on a PMD and aportion run in the CloudAmazon and GoogleChapter 1 — Computer Abstractions and Technology — 9

What You Will Learn How programs are translated into themachine language The hardware/software interfaceWhat determines program performance And how the hardware executes themAnd how it can be improvedHow hardware designers improveperformanceWhat is parallel processingChapter 1 — Computer Abstractions and Technology — 10

What Affects Performance? Algorithm Programming language, compiler, architecture Determine number of machine instructions executedper operationProcessor and memory system Determines number of operations executedDetermine how fast instructions are executedI/O system (including OS) Determines how fast I/O operations are executedChapter 1 — Computer Abstractions and Technology — 11

Design for Moore’s Law Use abstraction to simplify design Make the common case fast Performance via parallelism Performance via pipelining Performance via prediction Hierarchy of memories Dependability via redundancy§1.2 Eight Great Ideas in Computer ArchitectureEight Great IdeasChapter 1 — Computer Abstractions and Technology — 12

Application software Written in high-level languageSystem software Compiler: translates HLL code tomachine codeOperating System: service code §1.3 Below Your ProgramBelow Your ProgramHandling input/outputManaging memory and storageScheduling tasks & sharing resourcesHardware Processor, memory, I/O controllersChapter 1 — Computer Abstractions and Technology — 13

Levels of Program Code High-level language Assembly language Level of abstraction closerto problem domainProvides for productivityand portabilityTextual representation ofinstructionsHardware representation Binary digits (bits)Encoded instructions anddataChapter 1 — Computer Abstractions and Technology — 14

The BIG Picture Same components forall kinds of computer Desktop, server,embedded§1.4 Under the CoversComponents of a ComputerInput/output includes User-interface devices Storage devices Display, keyboard, mouseHard disk, CD/DVD, flashNetwork adapters For communicating withother computersChapter 1 — Computer Abstractions and Technology — 15

Opening the BoxCapacitive multitouch LCD screen3.8 V, 25 Watt-hour batteryComputer boardChapter 1 — Computer Abstractions and Technology — 16

Inside the Processor (CPU) Datapath: performs operations on dataControl: sequences datapath, memory, .Cache memory Small fast SRAM memory for immediateaccess to dataChapter 1 — Computer Abstractions and Technology — 17

CPU Clocking Operation of digital hardware governed by aconstant-rate clockClock periodClock (cycles)Data transferand computationUpdate state Clock period: duration of a clock cycle e.g., 250ps 0.25ns 250 10–12sClock frequency (rate): cycles per second e.g., 4.0GHz 4000MHz 4.0 109HzChapter 1 — Computer Abstractions and Technology — 18

CPU TimeCPU Time CPU Clock Cycles Clock Cycle TimeCPU Clock Cycles Clock Rate Performance improved by Reducing number of clock cyclesIncreasing clock rateHardware designer must often trade off clockrate against cycle countChapter 1 — Computer Abstractions and Technology — 19

CPU Time Example Computer A: 2GHz clock, 10s CPU timeDesigning Computer B Aim for 6s CPU timeCan do faster clock, but causes 1.2 clock cyclesHow fast must Computer B clock be?Clock CyclesB 1.2 Clock CyclesAClock RateB CPU Time B6sClock CyclesA CPU Time A Clock Rate A 10s 2GHz 20 10 91.2 20 10 9 24 109Clock RateB 4GHz6s6sChapter 1 — Computer Abstractions and Technology — 20

Instruction Count and CPIClock Cycles Instructio n Count Cycles per Instructio nCPU Time Instructio n Count CPI Clock Cycle TimeInstructio n Count CPI Clock Rate Instruction Count for a program Determined by program, ISA and compilerAverage cycles per instruction Determined by CPU hardwareIf different instructions have different CPI Average CPI affected by instruction mixChapter 1 — Computer Abstractions and Technology — 21

CPI Example Computer A: Cycle Time 250ps, CPI 2.0Computer B: Cycle Time 500ps, CPI 1.2Same ISAWhich is faster, and by how much?CPU TimeCPU TimeA Instructio n Count CPI Cycle TimeAA I 2.0 250ps I 500psA is faster B Instructio n Count CPI Cycle TimeBB I 1.2 500ps I 600psCPU TimeB I 600ps 1.2CPU TimeI 500psA by this muchChapter 1 — Computer Abstractions and Technology — 22

CPI in More Detail If different instruction classes take differentnumbers of cyclesnClock Cycles (CPIi Instructio n Counti )i 1 Weighted average CPInClock CyclesInstructio n Counti CPI CPIi Instructio n Count i 1 Instructio n Count Relative frequencyChapter 1 — Computer Abstractions and Technology — 23

CPI Example Alternative compiled code sequences usinginstructions in classes A, B, CClassABCCPI for class123IC in sequence 1212IC in sequence 2411Sequence 1: IC 5 Clock Cycles 2 1 1 2 2 3 10Avg. CPI 10/5 2.0 Sequence 2: IC 6 Clock Cycles 4 1 1 2 1 3 9Avg. CPI 9/6 1.5Chapter 1 — Computer Abstractions and Technology — 24

Performance SummaryThe BIG PictureInstructio ns Clock cycles SecondsCPU Time ProgramInstructio n Clock cycle Performance depends on Algorithm: affects IC, possibly CPIProgramming language: affects IC, CPICompiler: affects IC, CPIInstruction set architecture: affects IC, CPI, TcChapter 1 — Computer Abstractions and Technology — 25

Response Time and Throughput Response time How long it takes to do a taskThroughput Total work done per unit time How are response time and throughput affectedby e.g., tasks/transactions/ per hourReplacing the processor with a faster version?Adding more processors?We’ll study their estimation nowChapter 1 — Computer Abstractions and Technology — 26

§1.7 The Power WallPower Trends In CMOS IC technologyPower Capacitive load Voltage 2 Frequency 305V 1V 1000Chapter 1 — Computer Abstractions and Technology — 27

Reducing Power Suppose a new CPU has 85% of capacitive load of old CPU15% voltage and 15% frequency reductionPnew Cold 0.85 (Vold 0.85) 2 Fold 0.854 0.85 0.522PoldCold Vold Fold The power wall We can’t reduce voltage furtherWe can’t remove more heatHow else can we improve performance?Chapter 1 — Computer Abstractions and Technology — 28

Multiprocessors Multicore microprocessors More than one processor per chipClock frequency limitedRequires explicitly parallel programming Compare with instruction level parallelism Hardware executes multiple instructions at onceHidden from the programmerHard to do Programming for performanceLoad balancingOptimizing communication and synchronizationChapter 1 — Computer Abstractions and Technology — 29

Cost/performance is improving Hierarchical layers of abstraction In both hardware and softwareInstruction set architecture Due to underlying technology development§1.9 Concluding RemarksConcluding RemarksThe hardware/software interfaceExecution time: the best performancemeasurePower is a limiting factor Use parallelism to improve performanceChapter 1 — Computer Abstractions and Technology — 30

Computer Architecture: David A. Patterson and John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, Elsevier. Carl Hamachar, Zvonco Vranesic and Safwat Zaky, Computer Organization, McGraw-Hill. John P. Hayes, Computer Architecture and