530 likes | 609 Views
COM 249 – Computer Organization and Assembly Language Chapter 1 Computer Abstraction and Technology. Based on slides from D. Patterson and www-inst.eecs.berkeley.edu/~cs152/. Arithmetic. Single/multicycle Datapaths. IFetch. Dcd. Exec. Mem. WB. µProc 60%/yr. (2X/1.5yr). 1000. CPU.
E N D
COM 249 – Computer Organization andAssembly LanguageChapter 1 Computer Abstraction and Technology Based on slides from D. Patterson and www-inst.eecs.berkeley.edu/~cs152/
Arithmetic Single/multicycle Datapaths IFetch Dcd Exec Mem WB µProc 60%/yr. (2X/1.5yr) 1000 CPU IFetch Dcd Exec Mem WB “Moore’s Law” IFetch Dcd Exec Mem WB 100 Processor-Memory Performance Gap:(grows 50% / year) IFetch Dcd Exec Mem WB 10 Performance DRAM 9%/yr. (2X/10 yrs) DRAM 1 Pipelining 1980 1982 1983 1984 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1998 1999 2000 1981 1985 1997 I/O Time Memory Systems Where are we going?? COM 249 Spring ‘09 Y O U R C P U
Where Are We Going? • Performance issues (Chapter 1) overview, vocabulary and motivation • A specific instruction set architecture (Chapter 2) • Arithmetic and how to build an ALU (Chapter 3) • Constructing a processor to execute our instructions (Chapter 4) • Pipelining to improve performance (Chapter 4) • Memory: caches and virtual memory (Chapter 5) • I/O (Chapter 6) • Multicores, Multiprocessors (Chapter 7)Key to a good grade: reading the book!
What You Will Learn • How programs are translated into the machine language • And how the hardware executes them • The hardware/software interface • What determines program performance • And how it can be improved • How hardware designers improve performance • What parallel processing is and what implications it has for programmers
Introduction • Rapidly changing field: • vacuum tube -> transistor -> IC -> VLSI (see section 1.3) • doubling every 1.5 years: (Moore’s Law)memory capacity processor speed (Due to advances in technology and organization) • Things you’ll be learning: • how computers work, a basic foundation • how to analyze their performance (or how not to!) • issues affecting modern processors (caches, pipelines) • Why learn this stuff? • you want to call yourself a “computer scientist” • you want to build software people use (need performance) • you need to make a purchasing decision or offer “expert” advice
Understanding Performance • Algorithm • Determines number of operations executed • Programming language, compiler, architecture • Determine number of machine instructions executed per operation • Processor and memory system • Determine how fast instructions are executed • I/O system (including OS) • Determines how fast I/O operations are executed
COM 249: So what's in it for me? • Learn some of the big ideas in CS & engineering: • 5 Classic components of a Computer • Data can be anything (integers, floating point, characters): • the program determines what it is • Stored program concept: instructions just data • Principle of Locality, exploited via a memory hierarchy (cache) • Greater performance by exploiting parallelism • Principle of abstraction, used to build systems as layers • Compilation vs. interpretation through system layers • Principles/Pitfalls of Performance Measurement • Designer’s “conceptual” toolbox
“Conceptual” Tool Box? • Evaluation Techniques • Levels of translation (e.g., Compilation) • Levels of Interpretation (e.g., Microprogramming) • Hierarchy (e.g, registers, cache, memory, disk, tape) • Pipelining and Parallelism • Indirection and Address Translation • Synchronous /Asynchronous Control Transfer • Timing, Clocking, and Latching • CAD Programs, Hardware Description Languages, Simulation • Static / Dynamic Scheduling • Physical Building Blocks (e.g., Carry Lookahead) • Understanding Technology Trends
Our Goals • To understand modern computer architecture in its rapidly changing form • To explore the relationship between hardware and software • To design by leading you through the process of challenging design problems and by examining real designs • To learn how to test and to design for improved performance
Where is “Computer Organization and Assembly Language”? Application (Netscape) • Coordination of many levels of abstraction Operating Compiler System (Windows 2K) Software Assembler Instruction Set Architecture Hardware Processor Memory I/O system Datapath & Control Digital Design COM249 Circuit Design transistors
Dual Level Abstraction SOFTWARE Negation, Add, Double, Subtract Higher Levels HARDWARE Negation, Add Lower Levels
Computer Architecture Includes: • Instruction set architecture (ISA) (programmer’s abstraction of a computer) • Organization or microarchitecture (internal implementation of a computer at the register and functional unit level) • System architecture (organization of the computer at the cache and bus level) • See Computing Curriculum 2001 – pages 97-101 http://www.acm.org/education/education/curric_vols/cc2001.pdf
Instruction Set Architecture (ISA) • A very important abstraction • interface between hardware and low-level software • standardizes instructions, machine language bit patterns, etc. • advantage: different implementations of the same architecture • disadvantage: sometimes prevents using new innovationsModern instruction set architectures: • 80x86/Pentium/K6, PowerPC, DEC Alpha, MIPS, SPARC, HP
Hardware Levels CPU, Memory, Etc. Level 2 Digital Logic Circuits Level 1 Transistors Level 0
Software Levels High-Level Languages Level 6 Assembly Language Level 5 Operating Systems Level 4 Machine Language Level 3
Software • At higher levels (above Level 2) • Level 3: Machine language • Level 4: Operating system services • Level 5: Assembly language • Level 6: High-level languages • Most programs are written at Level 6. • Hardware only understands Level 3 instructions.
Below Your Program • Application software • Written in high-level language (HLL) • System software • Compiler: translates HLL code to machine code • Operating System: service code • Handling input/output • Managing memory and storage • Scheduling tasks & sharing resources • Hardware • Processor, memory, I/O controllers §1.2 Below Your Program
Levels of Representation temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; High Level Language Program (e.g., C) Compiler lw $t0, 0($2) #load word lw $t1, 4($2) sw $t1, 0($2) #store word sw $t0, 4($2) Assembly Language Program (e.g.,MIPS) Assembler Machine Language Program (MIPS) 0000 1001 1100 0110 1010 1111 0101 1000 1010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111 Machine Interpretation wire [31:0] dataBus; regFile registers (databus); ALU ALUBlock (inA, inB, databus); Hardware Architecture Description (e.g.,Verilog Language) Architecture Implementation wire w0; XOR (w0, a, b); AND (s, w0, a); Logic Circuit Description (Verilog Language)
Revolutions 1. Agricultural 2. Industrial 3. Information / computer Computers have become part of daily life and are ubiquitous (in cars, ATMs, microwave ovens, cell phones, etc.) Classes: desktops, servers, supercomputers, embedded Software: • Systems- Operating systems, compilers, assemblers • Applications- Word processors, databases, spreadsheets, games, etc...
Classes of Computers • Desktop computers • General purpose, variety of software • Subject to cost/performance tradeoff • Server computers • Network based • High capacity, performance, reliability • Range from small servers to building sized • Embedded computers • Hidden as components of systems • Stringent power/performance/cost constraints
Embedded Computers • Run one set of related applications, such as those in cell phones, TVs, cars, game machines, etc. • Growth of cell phones, with embedded computers, has been faster than desktop computers. • In 2004 there were 1 PC, 2.2 cell phones, and 2.5 TVs for every 8 people on the planet. • In 2006, a US family owned 12 gadgets (3 TVs, 2 PCs, and others –MP3 players, cell phones, game consoles.)
The Computer Revolution §1.1 Introduction • Progress in computer technology • Underpinned by Moore’s Law • Makes novel applications feasible • Computers in automobiles • Cell phones • Human genome project • World Wide Web • Search Engines • Computers are pervasive
Moore’s Law • Moore's Law, states that the number of transistors on a chip will double about every two years. • Almost every measure of the capabilities of digital electronic devices is linked to Moore's law: processing speed, memory capacity, even the number and size of pixels in digital cameras • http://en.wikipedia.org/wiki/Moore's_law • http://www.intel.com/technology/mooreslaw/index.htm
From High Level to Low Level Advantages of High Level Languages • Think in more natural terms about real world objects • Improve programmer productivity • Programmers independent of machine Advantages of Low Level Language • Faster • Communicate directly with hardware
Components of a Computer • Same components forall kinds of computer • Desktop, server,embedded • Input/output includes • User-interface devices • Display, keyboard, mouse • Storage devices • Hard disk, CD/DVD, flash • Network adapters • For communicating with other computers The BIG Picture
Anatomy: 5 components of any Computer Personal Computer Keyboard, Mouse Computer Processor Memory (where programs, data live when running) Devices Disk(where programs, data live when not running) Input Control (“brain”) Datapath (“brawn”) Output Display, Printer
Anatomy of a Computer Output device Network cable Input device Input device
Anatomy of a Mouse • Invented by Doug Englebart (1967) • Mechanical (roller ball) • Optical mouse • LED illuminates desktop • Small low-res camera • Basic image processor • Looks for x, y movement • Buttons & wheel • Supersedes roller-ball mechanical mouse
Through the Looking Glass • LCD screen: picture elements (pixels) • Mirrors content of frame buffer memory
LCD Displays • Liquid Crystal Display- thin, low power • Uses rod shape molecules in a liquid forming a twisted helix that bends light. • Rods straighten when current is applied and do not bend the light. • Uses an active matrix of tiny transistors to control current and form sharper images. • Images are composed of red, green and blue dots.
Forming Images • An image is composed of picture elements or pixels, represented as a matrix of bits, called a bit map. • Display matrix can be 640 x 480 to 2560 x 1600 pixels in size. • A color display uses 8 bits for each of the 3 (RGB) colors, or 24 bits/pixel, creating millions of colors. • A raster refresh or frame buffer is the hardware to support graphics. It stores the bit map.
Inside the Processor (CPU) • Datapath: performs operations on data • Control: sequences datapath, memory, ... • Cache memory • Small fast SRAM memory for immediate access to data
Inside the Processor • AMD Barcelona: 4 processor cores
Abstractions The BIG Picture • Abstraction helps us deal with complexity • Hide lower-level detail • Instruction set architecture (ISA) • The hardware/software interface • Application binary interface (ABI) • The ISA plus system software interface • Implementation • The details underlying and interface
A Safe Place for Data • Volatile main memory • Loses instructions and data when power off • Non-volatile secondary memory • Magnetic disk • Flash memory • Optical disk (CDROM, DVD)
Networks • Communication and resource sharing • Local area network (LAN): Ethernet • Within a building • Wide area network (WAN: the Internet • Wireless network: WiFi, Bluetooth
Technology Trends • Electronics technology continues to evolve • Increased capacity and performance • Reduced cost DRAM capacity
Overview of Physical Implementations The hardware out of which we make systems. • Integrated Circuits (ICs) • Combinational logic circuits, memory elements, analog interfaces. • Printed Circuits (PC) boards • substrate for ICs and interconnection, distribution of CLK, Vdd, and GND signals, heat dissipation. • Power Supplies • Converts line AC voltage to regulated DC low voltage levels. • Chassis (rack, card case, ...) • holds boards, power supply, provides physical interface to user or other systems. • Connectors and Cables.
Review of Major Components • Mouse ( mechanical, optical) • Display (CRT, LCD) • Motherboard • Integrated Circuits (transistors, CMOS) • CPU - controls memory, I/O, datapath according to instructions • Datapath- performs arithmetic operations
Review of Major Components • Memory • DRAM - Dynamic RAM - main memory • SRAM - Static RAM- faster, more expensive • Cache- fast buffer for main memory • DIMM and SIMM - small boards that contain DRAM chips • RAM, ROM, volatile, non-volatile, primary, secondary, magnetic disk, optical disks (CD, DVD), FLASH based
Memory Comparisons • Main Memory vs. Disk • Volatile Non Volatile • Fast(electrical) Slower(mechanical) • Expensive (100 * more) Cheaper Memory Access DRAM Disk 40 -80 nanoseconds 5- 15 milliseconds 10-910-3 (100,000 times faster)
Computer Technology - Dramatic Change! • Processor • 2X in speed every 1.5 years (since ‘85); 100X performance in last decade. • Memory • DRAM capacity: 2x / 2 years (since ‘96); 64xsize improvement in last decade. • Disk • Capacity: 2X / 1 year (since ‘97) • 250Xsize in last decade.
Technology Trends: Processor Performance Intel P4 2000 MHz (Fall 2001) 1.54X/yr Performance measure year We’ll talk about processor performance later on…
Technology Trends: Memory Capacity(Single-Chip DRAM) year size (Mbit) 1980 0.0625 1983 0.25 1986 1 1989 4 1992 16 1996 64 1998 128 2000 256 2002 512 • Now 1.4X/yr, or 2X every 2 years. • 8000X since 1980!
Tech. Trends: Microprocessor Complexity 2X transistors/Chip Every 1.5 to 2.0 years Called “Moore’s Law”
Networks Advantages • Communication • Resource Sharing • Non-local access Types • LANs - Ethernet • WANs