《Chapter 1 Computer Abstractions and Technology》由会员分享,可在线阅读,更多相关《Chapter 1 Computer Abstractions and Technology(46页珍藏版)》请在金锄头文库上搜索。
1、Chapter 1Computer Abstractions and TechnologyThe Computer RevolutionnProgress in computer technologynUnderpinned by Moores Law nMakes novel applications feasiblenComputers in automobilesnCell phonesnHuman genome projectnWorld Wide WebnSearch EnginesnComputers are pervasive1.1 IntroductionChapter 1 C
2、omputer Abstractions and Technology 2Classes of ComputersnDesktop computersnGeneral purpose, variety of softwarenSubject to cost/performance tradeoffnServer computersnNetwork basednHigh capacity, performance, reliabilitynRange from small servers to building sizednEmbedded computersnHidden as compone
3、nts of systemsnStringent power/performance/cost constraintsChapter 1 Computer Abstractions and Technology 3The Processor MarketChapter 1 Computer Abstractions and Technology 4What You Will LearnnHow programs are translated into the machine languagenAnd how the hardware executes themnThe hardware/sof
4、tware interfacenWhat determines program performancenAnd how it can be improvednHow hardware designers improve performancenWhat is parallel processingChapter 1 Computer Abstractions and Technology 5Understanding PerformancenAlgorithmnDetermines number of operations executednProgramming language, comp
5、iler, architecturenDetermine number of machine instructions executed per operationnProcessor and memory systemnDetermine how fast instructions are executednI/O system (including OS)nDetermines how fast I/O operations are executedChapter 1 Computer Abstractions and Technology 6Below Your ProgramnAppl
6、ication softwarenWritten in high-level languagenSystem softwarenCompiler: translates HLL code to machine codenOperating System: service codenHandling input/outputnManaging memory and storagenScheduling tasks & sharing resourcesnHardwarenProcessor, memory, I/O controllers1.2 Below Your ProgramChapter
7、 1 Computer Abstractions and Technology 7Levels of Program CodenHigh-level languagenLevel of abstraction closer to problem domainnProvides for productivity and portability nAssembly languagenTextual representation of instructionsnHardware representationnBinary digits (bits)nEncoded instructions and
8、dataChapter 1 Computer Abstractions and Technology 8Components of a ComputernSame components forall kinds of computernDesktop, server,embeddednInput/output includesnUser-interface devicesnDisplay, keyboard, mousenStorage devicesnHard disk, CD/DVD, flashnNetwork adaptersnFor communicating with other
9、computers1.3 Under the CoversThe BIG PictureChapter 1 Computer Abstractions and Technology 9Anatomy of a ComputerOutput deviceInput deviceInput deviceNetwork cableChapter 1 Computer Abstractions and Technology 10Anatomy of a MousenOptical mousenLED illuminates desktopnSmall low-res cameranBasic imag
10、e processornLooks for x, y movementnButtons & wheelnSupersedes roller-ball mechanical mouseChapter 1 Computer Abstractions and Technology 11Through the Looking GlassnLCD screen: picture elements (pixels)nMirrors content of frame buffer memoryChapter 1 Computer Abstractions and Technology 12Opening t
11、he BoxChapter 1 Computer Abstractions and Technology 13Inside the Processor (CPU)nDatapath: performs operations on datanControl: sequences datapath, memory, .nCache memorynSmall fast SRAM memory for immediate access to dataChapter 1 Computer Abstractions and Technology 14Inside the ProcessornAMD Bar
12、celona: 4 processor coresChapter 1 Computer Abstractions and Technology 15AbstractionsnAbstraction helps us deal with complexitynHide lower-level detailnInstruction set architecture (ISA)nThe hardware/software interfacenApplication binary interfacenThe ISA plus system software interfacenImplementati
13、onnThe details underlying and interfaceThe BIG PictureChapter 1 Computer Abstractions and Technology 16A Safe Place for DatanVolatile main memorynLoses instructions and data when power offnNon-volatile secondary memorynMagnetic disknFlash memorynOptical disk (CDROM, DVD)Chapter 1 Computer Abstractio
14、ns and Technology 17NetworksnCommunication and resource sharingnLocal area network (LAN): EthernetnWithin a buildingnWide area network (WAN: the InternetnWireless network: WiFi, BluetoothChapter 1 Computer Abstractions and Technology 18Technology TrendsnElectronics technology continues to evolvenInc
15、reased capacity and performancenReduced costYearTechnologyRelative performance/cost1951Vacuum tube11965Transistor351975Integrated circuit (IC)9001995Very large scale IC (VLSI)2,400,0002005Ultra large scale IC6,200,000,000DRAM capacityChapter 1 Computer Abstractions and Technology 19Defining Performa
16、ncenWhich airplane has the best performance?1.4 PerformanceChapter 1 Computer Abstractions and Technology 20Response Time and ThroughputnResponse timenHow long it takes to do a tasknThroughputnTotal work done per unit timene.g., tasks/transactions/ per hournHow are response time and throughput affec
17、ted bynReplacing the processor with a faster version?nAdding more processors?nWell focus on response time for nowChapter 1 Computer Abstractions and Technology 21Relative PerformancenDefine Performance = 1/Execution Timen“X is n time faster than Y”nExample: time taken to run a programn10s on A, 15s
18、on BnExecution TimeB / Execution TimeA= 15s / 10s = 1.5nSo A is 1.5 times faster than BChapter 1 Computer Abstractions and Technology 22Measuring Execution TimenElapsed timenTotal response time, including all aspectsnProcessing, I/O, OS overhead, idle timenDetermines system performancenCPU timenTime
19、 spent processing a given jobnDiscounts I/O time, other jobs sharesnComprises user CPU time and system CPU timenDifferent programs are affected differently by CPU and system performanceChapter 1 Computer Abstractions and Technology 23CPU ClockingnOperation of digital hardware governed by a constant-
20、rate clockClock (cycles)Data transferand computationUpdate stateClock periodnClock period: duration of a clock cyclene.g., 250ps = 0.25ns = 2501012snClock frequency (rate): cycles per secondne.g., 4.0GHz = 4000MHz = 4.0109HzChapter 1 Computer Abstractions and Technology 24CPU TimenPerformance improv
21、ed bynReducing number of clock cyclesnIncreasing clock ratenHardware designer must often trade off clock rate against cycle countChapter 1 Computer Abstractions and Technology 25CPU Time ExamplenComputer A: 2GHz clock, 10s CPU timenDesigning Computer BnAim for 6s CPU timenCan do faster clock, but ca
22、uses 1.2 clock cyclesnHow fast must Computer B clock be?Chapter 1 Computer Abstractions and Technology 26Instruction Count and CPInInstruction Count for a programnDetermined by program, ISA and compilernAverage cycles per instructionnDetermined by CPU hardwarenIf different instructions have differen
23、t CPInAverage CPI affected by instruction mixChapter 1 Computer Abstractions and Technology 27CPI ExamplenComputer A: Cycle Time = 250ps, CPI = 2.0nComputer B: Cycle Time = 500ps, CPI = 1.2nSame ISAnWhich is faster, and by how much?A is fasterby this muchChapter 1 Computer Abstractions and Technolog
24、y 28CPI in More DetailnIf different instruction classes take different numbers of cyclesnWeighted average CPIRelative frequencyChapter 1 Computer Abstractions and Technology 29CPI ExamplenAlternative compiled code sequences using instructions in classes A, B, CClassABCCPI for class123IC in sequence
25、1212IC in sequence 2411nSequence 1: IC = 5nClock Cycles= 21 + 12 + 23= 10nAvg. CPI = 10/5 = 2.0nSequence 2: IC = 6nClock Cycles= 41 + 12 + 13= 9nAvg. CPI = 9/6 = 1.5Chapter 1 Computer Abstractions and Technology 30Performance SummarynPerformance depends onnAlgorithm: affects IC, possibly CPInProgram
26、ming language: affects IC, CPInCompiler: affects IC, CPInInstruction set architecture: affects IC, CPI, TcThe BIG PictureChapter 1 Computer Abstractions and Technology 31Power TrendsnIn CMOS IC technology1.5 The Power Wall1000305V 1VChapter 1 Computer Abstractions and Technology 32Reducing PowernSup
27、pose a new CPU hasn85% of capacitive load of old CPUn15% voltage and 15% frequency reductionnThe power wallnWe cant reduce voltage furthernWe cant remove more heatnHow else can we improve performance?Chapter 1 Computer Abstractions and Technology 33Uniprocessor Performance1.6 The Sea Change: The Swi
28、tch to MultiprocessorsConstrained by power, instruction-level parallelism, memory latencyChapter 1 Computer Abstractions and Technology 34MultiprocessorsnMulticore microprocessorsnMore than one processor per chipnRequires explicitly parallel programmingnCompare with instruction level parallelismnHar
29、dware executes multiple instructions at oncenHidden from the programmernHard to donProgramming for performancenLoad balancingnOptimizing communication and synchronizationChapter 1 Computer Abstractions and Technology 35Manufacturing ICsnYield: proportion of working dies per wafer1.7 Real Stuff: The
30、AMD Opteron X4Chapter 1 Computer Abstractions and Technology 36AMD Opteron X2 WafernX2: 300mm wafer, 117 chips, 90nm technologynX4: 45nm technologyChapter 1 Computer Abstractions and Technology 37Integrated Circuit CostnNonlinear relation to area and defect ratenWafer cost and area are fixednDefect
31、rate determined by manufacturing processnDie area determined by architecture and circuit designChapter 1 Computer Abstractions and Technology 38SPEC CPU BenchmarknPrograms used to measure performancenSupposedly typical of actual workloadnStandard Performance Evaluation Corp (SPEC)nDevelops benchmark
32、s for CPU, I/O, Web, nSPEC CPU2006nElapsed time to execute a selection of programsnNegligible I/O, so focuses on CPU performancenNormalize relative to reference machinenSummarize as geometric mean of performance ratiosnCINT2006 (integer) and CFP2006 (floating-point)Chapter 1 Computer Abstractions an
33、d Technology 39CINT2006 for Opteron X4 2356NameDescriptionIC109CPITc (ns)Exec timeRef timeSPECratioperlInterpreted string processing2,1180.750.406379,77715.3bzip2Block-sorting compression2,3890.850.408179,65011.8gccGNU C Compiler1,0501.720.47248,05011.1mcfCombinatorial optimization33610.000.401,3459
34、,1206.8goGo game (AI)1,6581.090.4072110,49014.6hmmerSearch gene sequence2,7830.800.408909,33010.5sjengChess game (AI)2,1760.960.483712,10014.5libquantumQuantum computer simulation1,6231.610.401,04720,72019.8h264avcVideo compression3,1020.800.4099322,13022.3omnetppDiscrete event simulation5872.940.40
35、6906,2509.1astarGames/path finding1,0821.790.407737,0209.1xalancbmkXML parsing1,0582.700.401,1436,9006.0Geometric mean11.7High cache miss ratesChapter 1 Computer Abstractions and Technology 40SPEC Power BenchmarknPower consumption of server at different workload levelsnPerformance: ssj_ops/secnPower
36、: Watts (Joules/sec)Chapter 1 Computer Abstractions and Technology 41SPECpower_ssj2008 for X4Target Load %Performance (ssj_ops/sec)Average Power (Watts)100%231,86729590%211,28228680%185,80327570%163,42726560%140,16025650%118,32424640%920,3523330%70,50022220%47,12620610%23,0661800%0141Overall sum1,28
37、3,5902,605ssj_ops/ power493Chapter 1 Computer Abstractions and Technology 42Pitfall: Amdahls LawnImproving an aspect of a computer and expecting a proportional improvement in overall performance1.8 Fallacies and PitfallsnCant be done!nExample: multiply accounts for 80s/100snHow much improvement in m
38、ultiply performance to get 5 overall?nCorollary: make the common case fastChapter 1 Computer Abstractions and Technology 43Fallacy: Low Power at IdlenLook back at X4 power benchmarknAt 100% load: 295WnAt 50% load: 246W (83%)nAt 10% load: 180W (61%)nGoogle data centernMostly operates at 10% 50% loadn
39、At 100% load less than 1% of the timenConsider designing processors to make power proportional to loadChapter 1 Computer Abstractions and Technology 44Pitfall: MIPS as a Performance MetricnMIPS: Millions of Instructions Per SecondnDoesnt account fornDifferences in ISAs between computersnDifferences
40、in complexity between instructionsnCPI varies between programs on a given CPUChapter 1 Computer Abstractions and Technology 45Concluding RemarksnCost/performance is improvingnDue to underlying technology developmentnHierarchical layers of abstractionnIn both hardware and softwarenInstruction set architecturenThe hardware/software interfacenExecution time: the best performance measurenPower is a limiting factornUse parallelism to improve performance1.9 Concluding RemarksChapter 1 Computer Abstractions and Technology 46