Lecture 1: Chap 1: What is a computer ? What is architecture ? Methodology: ----------- These notes have the following structure. First we present the goals of the chapter. Next we go into the key concepts. For each concept, - we present a motivating scenario for introduction. - look at it from a top-down perspective. This is also known as the BIG PICTURE approach. - build it up from basic building blocks or components. This is called the bottom-up perspective. Finally we provide a checklist of concepts. Make sure you understand each one clearly. Clarity of understanding is our first priority ! Now, you should go on to the text for a detailed exposition and quantitative examples. Remember that this is just a capsule for a quick check of concepts. You will be tested on your quantitative skills and on some important details covered in the text, but not in these notes. ================================================================================ GOALS: ----- 1. Course snapshot: What are we going to learn from this course ? Ans: a) How does a computer work ? What is our view of the computer (abstraction/interface)? {ORGANIZATION/ARCHITECTURE} b) How to actually build a computer (MACHINE) that implements this abstraction/interface ? {DESIGN/IMPLEMENTATION} c) What are the concepts in systems software which release the power of the computer to the common man ? {SYSTEMS SOFTWARE: COMPILERS, ASSEMBLERS, OPERATING SYSTEMS} d) How to evaluate the performance of a computer system ? {PERFORMANCE} ================================================================================ Concepts: -------- - Abstraction/Interface = Architecture - Technological context - What is a computer ? It is a machine that implements the instruction set architecture. ================================================================================ - Abstraction: Scenario: Consider a "swap" program which will run on a computer. Write it down without peeking at the rest of the text! Qn: while thinking of swap, did you think about computer details such as registers etc ? If yes, I salute you ! You are a seasoned assembly programmer. If no, you are one of the millions benifiting from the powerful concept of abstraction ! Abstraction means that details not important to task at hand i.e. "swap" are hidden (possibly by some systems software called the compiler) BIG PICTURE: - Complex system => details. Need to make progress (=> develop systems that are even more complex). The only resort is to keep details manageable => keep minimal information about details which can help you reconstruct it at will. But this implies that the details themselves will have to be structured ("organization"), and you view an interface to the details ("the architecture"). Implications: - Easier to understand. You can learn more by peeling off each layer without worrying about details in lower layer. - Programmer productivity increases. Fewer lines of code. - "Technology" in each layer can be developed independently and faster if the interface (architecture) does not change. - Simplifies comparison between different "technologies" BOTTOM UP: - Layers, mechanisms/components, interface - Useful not because it omits details; but because it omits only those details not relevant to task at hand. Remember Einstien's warning about oversimplification: "Everything should be made as simple as possible, but no simpler!" - Architecture: Formulation of set of abstractions and interfaces between them. - Eg: Instruction set architecture. Instruction set is the interface between two layers of abstractions (hardware and software) and its formulation is an architectural issue. - Put another way, the interface *IS* the view of the lower layer abstraction as seen by the higher layer. That is why we use the term "architecture" to primarily talk about the design of the interface, but also refer to abstractions as architecture too! ------------------------------------------------------------------------------------------- - Technological context: Scenario: We suddenly witness a 10-fold increase in amount of transistors per unit area. {this is a technology increase in lower layer of abstraction} - HOW CAN YOU BEST USE THIS NEW ADVANCE IN TECHNOLOGY - this additional "real estate" ? Possibilities: - ENHANCE THE ARCHITECTURE (instruction set) of the machine (eg: Intel 8086 vs 386) ? - IMPROVE PERFORMANCE of the existing architecture by using the extra real estate for a pipeline or cache ? - Answer: need to understand both architecture, organization and the implementation to make this choice. Eg: - Architecture questions: What is the following of the current instruction set (interface)? Is there a pressing demand for something new (like multimedia in the case of MMX) ? - Implementation questions: Does some powerful organization feature like pipelining or caching become enabled given the extra real estate ? Another example: - 20 years ago: memory was costly => minimize use of memory to make programs faster. Smaller memory size => fewer bits to code addresses. Need for smaller programs (instruction count) => instructions had to be more powerful and complex. Size dominated speed. - Today: Speed dominates size; memory cheap. Simpler instructions which can be executed faster (smaller clock cycle time 266 Mhz vs 66 MHz or clock cycles per instruction) leads to faster program execution even if the number of instructions per program is larger. larger program, but overall execution time is BIG PICTURE: - Changes in technology drives changes in organization, and sometimes in the architecture (i.e. abstractions, interfaces). - "Technology" is the functionality or speed of whatever is inside the abstraction layers (above or below, but typically below) - Computer designers need to understand key elements or "drivers" of both hardware and software. That's why we are here. BOTTOM UP: Quick technology check: - Silicon: add impurities and it can become a conductor, insulator or a switch based upon a controllable current/voltage input. Switch = transistor. - Chip manufacturing: Ingot -> Wafers -> Dies -> Packaged Dies - Engine behind Moore's law: S - Die area larger => fewer dies per wafer => higher costs - Pentium pro: 2 dies within a package. ------------------------------------------------------------------------------ - What's a computer: Scenario: We are filled with enthusiam and say, we want to build a computer! A group member asks us, what really do we want to build ? For example, how is it different from a calculator ? What should it achieve ? BIG PICTURE: - Turing machine: bits in memory; read, process, write, move left or right. - Ans: We want to build a machine that implements an interface (architecture) ! The architecture (instruction set) should allow one to do whatever a Turing machine can do ! - All our sophisticated computers are theoretically no more powerful in terms of what it can compute than this machine ! - Computer architecture (interface design) issues then stem from practical issues: - Expressiveness (ease/efficiency) of mapping higher level language to lower level interface, - Hardware technology (ease of implementation) - Performance considerations (speedup in coding and running real programs) BOTTOM UP: - The key components in all computers are Processor (Datapath+Control), Memory, and I/O. See similarity to Turing machine. Each component is influenced by hardware technology, application demands for expressiveness, and performance. Note: the following discussion contains terms which may not be familiar to you. Just browse through it. We will learn the concepts later. The point is to introduce you to the tradeoffs. - Processor: - Application constraints. Functionality: arithmetic, data-types, decision making. Performance: run the benchmarks - Hardware constraint: hardware ALU possible, but hardware control is costly, complex instructions may require longer time to interpret/execute. - Architectural Solutions: - store instructions like data (stored-pgm), - Design instructions carefully (instruction set design) in conjunction with design of processor components (registers, alu, datapath, control). Goal: to minimize execution TIME. - Apply techniques like pipelining to speedup. Exploit spatial locality of instructions in a program. - Memory: - Application: wants flat, fast-access, infinite memory - Hardware: - On-processor memory = registers which are faster/costlier than memory. - Limited memory available. - Limited processor-to-memory bandwidth. - Architectural solutions: - Few general purpose or special purpose registers. Use registers efficiently - Use virtual memory used to create illusion of larger amount of memory. - Use caching to create illusion of faster access to memory. Exploit locality of reference in designing VM and caching. - I/O: - Hardware: - Much slower than memory. - Appln: - Some programs very I/O bound and require illusion of fast access. - Solutions: - Build parallel interfaces that require minimum negotiation (synchronous bus) - Develop a hierarchy for I/O similar to VM and caching. (RAID etc) ======================================================================================= Concepts checklist: ------------------ - abstraction - architecture = abstractions + interfaces - computer: processor, memory, i/o - design/implementation: realization of an architecture - interfaces - organization: how abstractions are hooked together - layers - performance - systems software - technology =================================================================================