Lec 01 Abstractions Technology

Download Lec 01 Abstractions Technology

Post on 01-Jun-2018




0 download

Embed Size (px)


<ul><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 1/60</p><p>COMPUTER ORGANIZATION AND DESIGN</p><p>The Hardware/Software Interface</p><p>5thEdition</p><p>January 5, 2015</p><p>Vara Varavithya</p><p>Computer Organization</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 2/60</p><p>COMPUTER ORGANIZATION AND DESIGN</p><p>The Hardware/Software Interface</p><p>5thEdition</p><p>The lecture material for this course has beenadapted in part from UC Berkeley, Penn</p><p>State, UB, and Publisher.</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 3/60</p><p>Overview</p><p>! Administrative Matters (5 minutes)! Course Style, Philosophy and Structure (15</p><p>min)</p><p>! Intro to Computer Architecture</p><p>Chapter 1 Computer Abstractions and Technology 3</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 4/60</p><p>Course Administration</p><p>! Instructor: Vara Varavithya (varavithya@gmail.com)</p><p>Office Hours: By appointmen</p><p>! Materials: https://www.facebook.com/groups/629713900488373/</p><p>! Text: Computer Organization and Design: The Hardware/SoftwareInterface, Fifth Edition, Patterson and Hennessy</p><p>Chapter 1 Computer Abstractions and Technology 4</p>https://www.facebook.com/groups/629713900488373/</li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 5/60</p><p>Textbook purchase options</p><p>!</p><p>Paperback or eBook! CU University Bookstore on campus</p><p>! Patterson Computer Org &amp; Design, 5thEdition</p><p>!</p><p>Amazon</p><p>Chapter 1 Computer Abstractions and Technology 5</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 6/60</p><p>Midterm Exams</p><p>!</p><p>Reduce the pressure of taking exams! 50 minutes</p><p>! Our goal: test knowledge vs. speed writing</p><p>!</p><p>All mid-terms closed book! Necessary sheets will be provided</p><p>Chapter 1 Computer Abstractions and Technology 6</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 7/60</p><p>Homework Assignments and Project</p><p>! Assignments consist of two parts! Homeworks Individual Effort: Exercises from the text book! Projects Team Effort: Lab assignments</p><p>! Homework assignments</p><p>! Exercises due in one week at beginning of lecture!</p><p>Brief (15 minute) quiz on assignment material in lectureor recitations (several of them)</p><p>! Must understand assignment to do quiz</p><p>! No late assignments!</p><p>! Recitations will help solve problems</p><p>! Homeworks will not be graded, but checked forcompleteness</p><p>Chapter 1 Computer Abstractions and Technology 8</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 8/60</p><p>Project/Lab Summary</p><p>!</p><p>Verilog installed on Unix! SPIM available on Unix, Windows! Lab assignments:</p><p>! 2-3 Projects</p><p>! Written report</p><p>Chapter 1 Computer Abstractions and Technology 10</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 9/60</p><p>Grading</p><p>! Grade breakdown! Three Midterm Exams: 30%</p><p>! Final: 40%</p><p>! Homeworks: 10%</p><p>! Projects: 10%</p><p>! Quizzes: 10%</p><p>! Class Attendance: +10%</p><p>Chapter 1 Computer Abstractions and Technology 11</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 10/60</p><p>! Cant make test! Tell us early and we will schedule alternate time, if appropriate</p><p>! Three Couponsfor 7 days extension, after that NO latehomeworks or labs</p><p>! What is cheating?!</p><p>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, ...</p><p>! Studying together in groups is encouraged</p><p>!</p><p>Work must be your own! Better off to skip an assignment (rather than copying)</p><p>! But it doesnt help on quiz (15% of grade) anyway</p><p>Course Problems</p><p>Chapter 1 Computer Abstractions and Technology 12</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 11/60</p><p>The Instruction Set: a Critical Interface</p><p>Chapter 1 Computer Abstractions and Technology 14</p><p>instruction set</p><p>software</p><p>hardware</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 12/60</p><p>COMPUTER ORGANIZATION AND DESIGN</p><p>The Hardware/Software Interface5th</p><p>Edition</p><p>Chapter 1</p><p>Computer Abstractions and</p><p>Technology</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 13/60</p><p>Chapter 1 Computer Abstractions and Technology 18</p><p>The Computer Revolution</p><p>!</p><p>Progress in computer technology! Underpinned by Moores Law</p><p>! Makes novel applications feasible! Computers in automobiles</p><p>! Cell phones</p><p>! Human genome project</p><p>! World Wide Web</p><p>! Search Engines</p><p>! Computers are pervasive</p><p>1.1Introduction</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 14/60</p><p>Chapter 1 Computer Abstractions and Technology 19</p><p>Classes of Computers</p><p>! Personal computers! General purpose, variety of software! Subject to cost/performance tradeoff</p><p>! Server computers! Network based! High capacity, performance, reliability!</p><p>Range from small servers to building sized</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 15/60</p><p>Classes of Computers</p><p>! Supercomputers! High-end scientific and engineering</p><p>calculations! Highest capability but represent a small</p><p>fraction of the overall computer market</p><p>! Embedded computers! Hidden as components of systems! Stringent power/performance/cost constraints</p><p>Chapter 1 Computer Abstractions and Technology 20</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 16/60</p><p>Chapter 1 Computer Abstractions and Technology 21</p><p>The PostPC Era</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 17/60</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 18/60</p><p>Chapter 1 Computer Abstractions and Technology 23</p><p>What You Will Learn</p><p>! How programs are translated into themachine language! And how the hardware executes them</p><p>! The hardware/software interface</p><p>! What determines program performance! And how it can be improved</p><p>! How hardware designers improveperformance</p><p>! What is parallel processing</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 19/60</p><p>Chapter 1 Computer Abstractions and Technology 24</p><p>Understanding Performance</p><p>! Algorithm! Determines number of operations executed</p><p>! Programming language, compiler, architecture! Determine number of machine instructions executed</p><p>per operation! Processor and memory system</p><p>! Determine how fast instructions are executed</p><p>! I/O system (including OS)! Determines how fast I/O operations are executed</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 20/60</p><p>Eight Great Ideas</p><p>! Design for Moores Law</p><p>! Use abstractionto simplify design</p><p>! Make the common case fast</p><p>!</p><p>Performance viaparallelism! Performance viapipelining</p><p>! Performance viaprediction</p><p>! Hierarchyof memories</p><p>! Dependabilityviaredundancy</p><p>Chapter 1 Computer Abstractions and Technology 25</p><p>1.2EightGreatIdeasinCom</p><p>puterArchitectu</p><p>re</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 21/60</p><p>Chapter 1 Computer Abstractions and Technology 26</p><p>Below Your Program</p><p>! Application software! Written in high-level language</p><p>! System software! Compiler: translates HLL code to</p><p>machine code! Operating System: service code</p><p>! Handling input/output</p><p>! Managing memory and storage</p><p>! Scheduling tasks &amp; sharing resources</p><p>! Hardware! Processor, memory, I/O controllers</p><p>1.3BelowYo</p><p>urProgram</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 22/60</p><p>Chapter 1 Computer Abstractions and Technology 27</p><p>Levels of Program Code</p><p>! High-level language! Level of abstraction closer to</p><p>problem domain! Provides for productivity and</p><p>portability</p><p>! Assembly language! Textual representation of</p><p>instructions</p><p>! Hardware representation!</p><p>Binary digits (bits)! Encoded instructions and</p><p>data</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 23/60</p><p>Chapter 1 Computer Abstractions and Technology 28</p><p>Components of a Computer</p><p>! Same components forall kinds of computer! Desktop, server,</p><p>embedded</p><p>! Input/output includes! User-interface devices</p><p>! Display, keyboard, mouse</p><p>! Storage devices! Hard disk, CD/DVD, flash</p><p>! Network adapters! For communicating with other</p><p>computers</p><p>1.4UndertheCovers</p><p>The BIG Picture</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 24/60</p><p>Chapter 1 Computer Abstractions and Technology 29</p><p>Touchscreen</p><p>! PostPC device</p><p>! Supersedes keyboardand mouse</p><p>! Resistive and</p><p>Capacitive types! Most tablets, smart</p><p>phones use capacitive</p><p>! Capacitive allows</p><p>multiple touchessimultaneously</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 25/60</p><p>Chapter 1 Computer Abstractions and Technology 30</p><p>Through the Looking Glass</p><p>! LCD screen: picture elements (pixels)! Mirrors content of frame buffer memory</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 26/60</p><p>Chapter 1 Computer Abstractions and Technology 31</p><p>Opening the Box</p><p>Capacitive multitouch LCD screen</p><p>3.8 V, 25 Watt-hour battery</p><p>Computer board</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 27/60 </p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 28/60</p><p>Chapter 1 Computer Abstractions and Technology 33</p><p>Inside the Processor</p><p>! Apple A5</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 29/60</p><p>Chapter 1 Computer Abstractions and Technology 34</p><p>Abstractions</p><p>! Abstraction helps us deal with complexity! Hide lower-level detail</p><p>! Instruction set architecture (ISA)! The hardware/software interface</p><p>! Application binary interface! The ISA plus system software interface</p><p>! Implementation! The details underlying and interface</p><p>The BIG Picture</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 30/60</p><p>Chapter 1 Computer Abstractions and Technology 35</p><p>A Safe Place for Data</p><p>! Volatile main memory! Loses instructions and data when power off</p><p>! Non-volatile secondary memory! Magnetic disk</p><p>! Flash memory</p><p>!</p><p>Optical disk (CDROM, DVD)</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 31/60</p><p>Chapter 1 Computer Abstractions and Technology 36</p><p>Networks</p><p>! Communication, resource sharing, nonlocalaccess</p><p>! Local area network (LAN): Ethernet</p><p>! Wide area network (WAN): the Internet</p><p>! Wireless network: WiFi, Bluetooth</p><p> 1</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 32/60</p><p>Chapter 1 Computer Abstractions and Technology 37</p><p>Technology Trends</p><p>! Electronics</p><p>technology continuesto evolve! Increased capacity</p><p>and performance</p><p>! Reduced costDRAM capacity</p><p>1.5Technolo</p><p>giesforBuilding</p><p>ProcessorsandMemory</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 33/60</p><p>Semiconductor Technology</p><p>! Silicon: semiconductor</p><p>! Add materials to transform properties:! Conductors</p><p>! Insulators</p><p>! Switch</p><p>Chapter 1 Computer Abstractions and Technology 38</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 34/60</p><p>Chapter 1 Computer Abstractions and Technology 39</p><p>Manufacturing ICs</p><p>! Yield: proportion of working dies per wafer</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 35/60</p><p>Chapter 1 Computer Abstractions and Technology 40</p><p>Intel Core i7 Wafer</p><p>! 300mm wafer, 280 chips, 32nm technology</p><p>! Each chip is 20.7 x 10.5 mm</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 36/60</p><p>Chapter 1 Computer Abstractions and Technology 41</p><p>Integrated Circuit Cost</p><p>! Nonlinear relation to area and defect rate! Wafer cost and area are fixed</p><p>! Defect rate determined by manufacturing process</p><p>! Die area determined by architecture and circuit design</p><p>2area/2))Dieareaper(Defects(1</p><p>1Yield</p><p>areaDieareaWaferwaferperDies</p><p>YieldwaferperDieswaferperCostdieperCost</p><p>!+</p><p>=</p><p>"</p><p>!</p><p>=</p><p> 1</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 37/60</p><p>Chapter 1 Computer Abstractions and Technology 42</p><p>Defining Performance</p><p>! Which airplane has the best performance?</p><p>Boeing 777</p><p>Boeing 747</p><p>BAC/Sud Concorde</p><p>Douglas DC-8-50</p><p>0 125 250 375 500</p><p>Passenger Capacity</p><p>Boeing 777</p><p>Boeing 747</p><p>BAC/Sud Concorde</p><p>Douglas DC-8-50</p><p>0 2250 4500 6750 9000</p><p>Cruising Range (miles)</p><p>Boeing 777</p><p>Boeing 747</p><p>BAC/Sud Concorde</p><p>Douglas DC-8-50</p><p>0 350 700 1050 1400</p><p>Cruising Speed (mph)</p><p>Boeing 777</p><p>Boeing 747</p><p>BAC/Sud Concorde</p><p>Douglas DC-8-50</p><p>0 75000 150000 225000 300000</p><p>Passengers x mph</p><p>.6Performa</p><p>nce</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 38/60</p><p>Chapter 1 Computer Abstractions and Technology 43</p><p>Response Time and Throughput</p><p>! Response time! How long it takes to do a task</p><p>! Throughput! Total work done per unit time</p><p>! e.g., tasks/transactions/ per hour</p><p>! How are response time and throughput affectedby! Replacing the processor with a faster version?</p><p>!</p><p>Adding more processors?! Well focus on response time for now</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 39/60</p><p>Chapter 1 Computer Abstractions and Technology 44</p><p>Relative Performance</p><p>! Define Performance = 1/Execution Time</p><p>! X is ntime faster than Y</p><p>n==XY</p><p>YX</p><p>timeExecutiontimeExecution</p><p>ePerformancePerformanc</p><p>! Example: time taken to run a program! 10s on A, 15s on B</p><p>! Execution TimeB/ Execution TimeA= 15s / 10s = 1.5</p><p>! So A is 1.5 times faster than B</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 40/60</p><p>Chapter 1 Computer Abstractions and Technology 45</p><p>Measuring Execution Time</p><p>! Elapsed time! Total response time, including all aspects</p><p>! Processing, I/O, OS overhead, idle time</p><p>! Determines system performance</p><p>!</p><p>CPU time! Time spent processing a given job</p><p>! Discounts I/O time, other jobs shares</p><p>! Comprises user CPU time and system CPU</p><p>time! Different programs are affected differently by</p><p>CPU and system performance</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 41/60</p><p>Chapter 1 Computer Abstractions and Technology 46</p><p>CPU Clocking</p><p>! Operation of digital hardware governed by a</p><p>constant-rate clock</p><p>Clock (cycles)</p><p>Data transferand computation</p><p>Update state</p><p>Clock period</p><p>! Clock period: duration of a clock cycle! e.g., 250ps = 0.25ns = 250!1012s</p><p>! Clock frequency (rate): cycles per second! e.g., 4.0GHz = 4000MHz = 4.0!109Hz</p><p>C</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 42/60</p><p>Chapter 1 Computer Abstractions and Technology 47</p><p>CPU Time</p><p>! Performance improved by! Reducing number of clock cycles</p><p>! Increasing clock rate</p><p>!</p><p>Hardware designer must often trade off clockrate against cycle count</p><p>RateClock</p><p>CyclesClockCPU</p><p>TimeCycleClockCyclesClockCPUTimeCPU</p><p>=</p><p>!=</p><p>CPU Ti E l</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 43/60</p><p>Chapter 1 Computer Abstractions and Technology 48</p><p>CPU Time Example</p><p>! Computer A: 2GHz clock, 10s CPU time</p><p>! Designing Computer B! Aim for 6s CPU time</p><p>! Can do faster clock, but causes 1.2 !clock cycles</p><p>! How fast must Computer B clock be?</p><p>4GHz6s</p><p>1024</p><p>6s</p><p>10201.2RateClock</p><p>10202GHz10s</p><p>RateClockTimeCPUCyclesClock</p><p>6s</p><p>CyclesClock1.2</p><p>TimeCPU</p><p>CyclesClockRateClock</p><p>99</p><p>B</p><p>9</p><p>AAA</p><p>A</p><p>B</p><p>BB</p><p>=</p><p>!</p><p>=</p><p>!!</p><p>=</p><p>!=!=</p><p>!=</p><p>!</p><p>==</p><p>I t ti C t d CPI</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 44/60</p><p>Chapter 1 Computer Abstractions and Technology 49</p><p>Instruction Count and CPI</p><p>! Instruction Count for a program! Determined by program, ISA and compiler</p><p>! Average cycles per instruction! Determined by CPU hardware</p><p>! If different instructions have different CPI! Average CPI affected by instruction mix</p><p>RateClock</p><p>CPICountnInstructio</p><p>TimeCycleClockCPICountnInstructioTimeCPUnInstructioperCyclesCountnInstructioCyclesClock</p><p>!</p><p>=</p><p>!!=</p><p>!=</p><p>CPI E l</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 45/60</p><p>Chapter 1 Computer Abstractions and Technology 50</p><p>CPI Example</p><p>! 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?</p><p>1.2500psI</p><p>600psI</p><p>ATimeCPU</p><p>BTimeCPU</p><p>600psI500ps1.2I</p><p>BTimeCycle</p><p>BCPICountnInstructio</p><p>BTimeCPU</p><p>500psI250ps2.0I</p><p>ATimeCycleACPICountnInstructioATimeCPU</p><p>=</p><p>!</p><p>!</p><p>=</p><p>!=!!=</p><p>!!=</p><p>!=!!=</p><p>!!=</p><p>A is faster</p><p>by this much</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 46/60</p><p>CPI E l</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 47/60</p><p>Chapter 1 Computer Abstractions and Technology 52</p><p>CPI Example</p><p>! Alternative compiled code sequences using</p><p>instructions in classes A, B, C</p><p>! Sequence 1: IC = 5!</p><p>Clock Cycles= 2!1 + 1!2 + 2!3= 10</p><p>! Avg. CPI = 10/5 = 2.0</p><p>! Sequence 2: IC = 6!</p><p>Clock Cycles= 4!1 + 1!2 + 1!3= 9</p><p>! Avg. CPI = 9/6 = 1.5</p><p>P f S</p></li><li><p>8/9/2019 Lec 01 Abstractions Technology</p><p> 48/60</p><p>Chapter 1 Computer Abstractions and Technology 53</p><p>Performance Summary</p><p>! Performance depends on! Algorithm: affects IC, possibly CPI</p><p>! Programming language: affects IC, CPI</p><p>! Compiler: affects IC, CP...</p></li></ul>