Computer Architecture Lecture Notes PDF
Document Details
Uploaded by AdmirableKremlin
Dr.Nesma Ebrahim
Tags
Related
- INF 1101 Introduction to Computer Systems PDF
- Computer Organization And Architecture - Lecture Notes PDF
- University of Buckingham Introduction to Computer Systems Lecture 5 PDF
- Computer Systems Organization Lecture Notes PDF
- Introduzione al Computer - Università San Raffaele Roma - PDF
- Introduction to Computer Studies PDF
Summary
These lecture notes cover fundamental concepts in computer architecture. Topics discussed include the introduction to computer architecture, assessment weighting, structural components, and related concepts, as well as different levels of transformation in computer systems, and the power of abstraction to improve productivity.
Full Transcript
Computer Architecture Lecture 1: Introduction and Basics Prepared by: Dr.Nesma Ebrahim ORCID: orcid.org/0000-0001-6677-2837 Web of Science Researcher Google Scholar Citation: Nesma Ebrahim Elsayd Assistant Professor , Computer Science Questio...
Computer Architecture Lecture 1: Introduction and Basics Prepared by: Dr.Nesma Ebrahim ORCID: orcid.org/0000-0001-6677-2837 Web of Science Researcher Google Scholar Citation: Nesma Ebrahim Elsayd Assistant Professor , Computer Science Question: What Is This? 2 Answer: Masterpiece of A Famous Architect 3 A Quote from The Architect Himself ◼ “architecture […] based upon principle, and not upon precedent” 4 Weighting of assessment ◼ Attendance : 5 ◼ Semester work : 5 ◼ Midterm Exam : 10 ◼ Oral Exam: 10 ◼ Practical Exam: 20 ◼ Final Term Exam: 50 =================== ◼ Total = 100 Outline of the Book (1) ◼ Computer Evolution and Performance ◼ Computer Interconnection Structures ◼ Internal Memory ◼ External Memory ◼ Input/Output ◼ Operating Systems Support ◼ Computer Arithmetic ◼ Instruction Sets Outline of the Book (2) ◼ CPU Structure and Function ◼ Reduced Instruction Set Computers ◼ Superscalar Processors ◼ Control Unit Operation ◼ Microprogrammed Control ◼ Multiprocessors and Vector Processing ◼ Digital Logic (Appendix) Major High-Level Goals of This Course ◼ Understand the principles ◼ Understand the precedents ◼ Based on such understanding: ❑ Enable you to evaluate tradeoffs of different designs and ideas ❑ Enable you to develop principled designs ❑ Enable you to develop novel, out-of-the-box designs ◼ The focus is on: ❑ Principles, precedents, and how to use them for new designs ◼ In Computer Architecture 8 Role of the (Computer) Architect Role of The (Computer) Architect ◼ Look backward (to the past) ❑ Understand tradeoffs and designs, upsides/downsides, past workloads. Analyze and evaluate the past. ◼ Look forward (to the future) ❑ Be the dreamer and create new designs. Listen to dreamers. ❑ Push the state of the art. Evaluate new design choices. ◼ Look up (towards problems in the computing stack) ❑ Understand important problems and their nature. ❑ Develop architectures and ideas to solve important problems. ◼ Look down (towards device/circuit technology) ❑ Understand the capabilities of the underlying technology. ❑ Predict and adapt to the future of technology (you are designing for N years ahead). Enable the future technology. 10 Architecture & Organization 1 Architecture is those attributes visible to the programmer —Instruction set, number of bits used for data representation, I/O mechanisms, addressing techniques. —e.g. Is there a multiply instruction? Organization is how features are implemented —Control signals, interfaces, memory technology. —e.g. Is there a hardware multiply unit or is it done by repeated addition? Architecture & Organization 2 All Intel x86 family share the same basic architecture The IBM System/370 family share the same basic architecture This gives code compatibility... at least backwards Organization differs within members of the same family, e.g. floating point numerical co- processors with names like 8087, 80287 and 80387. With very few exceptions, the 80486 and subsequent x86 processors then integrated this x87 functionality on chip. Computer Architecture refers to those attributes of a system that have a direct impact on the logical execution of a program. Examples: o the instruction set o the number of bits used to represent various data types o I/O mechanisms o memory addressing techniques Computer Organization refers to the operational units and their interconnections that realize the architectural specifications. Examples are transparent to the programmer: o control signals o interfaces between computer and peripherals o the memory technology being used. Computer Architecture = Instruction Set Architecture + Machine Organization Levels of Transformation “The purpose of computing is insight” (Richard Hamming) We gain and generate insight by solving problems How do we ensure problems are solved by electrons? Problem Algorithm Program/Language Runtime System (VM, OS, MM) ISA (Architecture) Microarchitecture Logic Circuits Electrons 14 Structure & Function Structure is the way in which components relate to each other Function is the operation of individual components as part of the structure ❑ The components from which computers are built, i.e., computer organization. ❑ In contrast, computer architecture is the science of integrating those components to achieve a level of functionality and performance. ❑ It is as if computer organization examines the lumber, bricks, nails, and other building material. ❑ While computer architecture looks at the design of the house. At each level, the designer is concerned with structure and function: Structure is the way in which components relate to each other. Function is the operation of individual components as part of the structure. The basic functions that a computer can perform are: - Data processing - Data storage - Data movement - Control Function ◼ There are four basic functions that a computer can perform: ❑ Data processing ◼ Data may take a wide variety of forms and the range of processing requirements is broad ❑ Data storage ◼ Short-term ◼ Long-term ❑ Data movement ◼ Input-output (I/O) - when data are received from or delivered to a device (peripheral) that is directly connected to the computer ◼ Data communications – when data are moved over longer distances, to or from a remote device ❑ Control ◼ A control unit manages the computer’s resources and orchestrates the performance of its functional parts in response to instructions Function General computer functions: —Data processing —Data storage —Data movement —Control Operations (a) Data movement I/O (peripherals directly attached) Communications/Networking (communication lines) Example application? Operations (a) Data movement I/O (peripherals directly attached) Communications/Networking (communication lines) Camera attached to a PC, sending the frames to a window on the screen of the same PC. Operations (b) Storage Example application? Operations (b) Storage Playing an mp3 file stored in memory to earphones attached to the same PC. Operation (c) Processing from/to storage Example application? Operation (c) Processing from/to storage Any number-crunching application that takes data from memory and stores the result back in memory. Operation (d) Processing from storage to I/O Example application? Operation (d) Processing from storage to I/O Receiving packets over a network interface, verifying their CRC, then storing them in memory. Structure we’ll concern on the internal structure of the computer itself, There are four main structural components: Central processing unit (CPU): Controls the operation of the computer and performs its data processing functions; often simply referred to as processor. Main memory: Stores data. I/O: Moves data between the computer and its external environment. System interconnection: Some mechanism that provides for communication among CPU, main memory, and I/O. A common example of system interconnection is by means of a system bus, consisting of a number of conducting wires to which all the other components attach. CPU ◼ Control Unit ❑ Controls the operation Major structural of the CPU and hence components: the computer ❑ Arithmetic and Logic Unit (ALU) ❑ Performs the computer’s data processing function ❑ Registers ❑ Provide storage internal to the CPU Structure - Top Level Peripherals Computer Central Main Processing Memory Unit Computer Systems Interconnection Input Output Communication lines Structure - The CPU CPU Computer Arithmetic Registers and I/O Login Unit System CPU Bus Internal CPU Memory Interconnection Control Unit Structure - The Control Unit Control Unit CPU Sequencing ALU Login Control Internal Unit Bus Control Unit Registers Registers and Decoders Control Memory So, I Hope You Are Here for This “C” as a model of computation 18-213 Programmer’s view of how a computer system works ◼ How does an assembly program end up executing as Architect/microarchitect’s view: digital logic? How to design a computer that meets system design goals. ◼ What happens in-between? Choices critically affect both ◼ How is a computer designed the SW programmer and using logic gates and wires the HW designer to satisfy specific goals? HW designer’s view of how a computer system works 18-240 Digital logic as a model of computation 33 Levels of Transformation “The purpose of computing is insight” (Richard Hamming) We gain and generate insight by solving problems How do we ensure problems are solved by electrons? Problem Algorithm Program/Language Runtime System (VM, OS, MM) ISA (Architecture) Microarchitecture Logic Circuits Electrons 34 The Power of Abstraction ◼ Levels of transformation create abstractions ❑ Abstraction: A higher level only needs to know about the interface to the lower level, not how the lower level is implemented ❑ E.g., high-level language programmer does not really need to know what the ISA is and how a computer executes instructions ◼ Abstraction improves productivity ❑ No need to worry about decisions made in underlying levels ❑ E.g., programming in Java vs. C vs. assembly vs. binary vs. by specifying control signals of each transistor every cycle ◼ Then, why would you want to know what goes on underneath or above? 35 Crossing the Abstraction Layers ◼ As long as everything goes well, not knowing what happens in the underlying level (or above) is not a problem. ◼ What if ❑ The program you wrote is running slow? ❑ The program you wrote does not run correctly? ❑ The program you wrote consumes too much energy? ◼ What if ❑ The hardware you designed is too hard to program? ❑ The hardware you designed is too slow because it does not provide the right primitives to the software? ◼ What if ❑ You want to design a much more efficient and higher performance system? 36 Crossing the Abstraction Layers ◼ Two key goals of this course are ❑ to understand how a processor works underneath the software layer and how decisions made in hardware affect the software/programmer ❑ to enable you to be comfortable in making design and optimization decisions that cross the boundaries of different layers and system components 37 An Example: Multi-Core Systems Multi-Core Chip L2 CACHE 1 L2 CACHE 0 SHARED L3 CACHE DRAM INTERFACE DRAM BANKS CORE 0 CORE 1 DRAM MEMORY CONTROLLER L2 CACHE 2 L2 CACHE 3 CORE 2 CORE 3 *Die photo credit: AMD Barcelona 38 Unexpected Slowdowns in Multi-Core High priority Memory Performance Hog Low priority (Core 0) (Core 1) Moscibroda and Mutlu, “Memory performance attacks: Denial of memory service in multi-core systems,” USENIX Security 2007. 39 A Question or Two ◼ Can you figure out why there is a disparity in slowdowns if you do not know how the system executes the programs? ◼ Can you fix the problem without knowing what is happening “underneath”? 40 Why the Disparity in Slowdowns? CORE matlab1 gcc 2 CORE Multi-Core Chip L2 L2 CACHE CACHE unfairness INTERCONNECT Shared DRAM DRAM MEMORY CONTROLLER Memory System DRAM DRAM DRAM DRAM Bank 0 Bank 1 Bank 2 Bank 3 41 DRAM Bank Operation Access Address: (Row 0, Column 0) Columns (Row 0, Column 1) (Row 0, Column 85) Row decoder (Row 1, Column 0) Rows Row address 0 1 Row 01 Row Empty Row Buffer CONFLICT HIT ! Column address 0 1 85 Column mux Data 42 DRAM Controllers ◼ A row-conflict memory access takes significantly longer than a row-hit access ◼ Current controllers take advantage of the row buffer ◼ Commonly used scheduling policy (FR-FCFS) [Rixner 2000]* (1) Row-hit first: Service row-hit memory accesses first (2) Oldest-first: Then service older accesses first ◼ This scheduling policy aims to maximize DRAM throughput 43 The Problem ◼ Multiple applications share the DRAM controller ◼ DRAM controllers designed to maximize DRAM data throughput ◼ DRAM scheduling policies are unfair to some applications ❑ Row-hit first: unfairly prioritizes apps with high row buffer locality ◼ Threads that keep on accessing the same row ❑ Oldest-first: unfairly prioritizes memory-intensive applications ◼ DRAM controller vulnerable to denial of service attacks ❑ Can write programs to exploit unfairness 44 A Memory Performance Hog // initialize large arrays A, B // initialize large arrays A, B for (j=0; j