Introduction 1 This course is all about how
Introduction 1 This course is all about how computers work But what do we mean by a computer? - Different types: desktop, servers, embedded devices - Different uses: automobiles, cell phones, graphics, structural analysis, finance, genomics… - Different manufacturers: Intel, Apple, IBM, Microsoft, Sun… - Different underlying technologies and different costs! CS@VT August 2009 Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
Theoretical Notion of Computability Introduction 2 Every computer is capable of computing exactly the same things… … given enough time and memory. well… not quite = PDA CS@VT August 2009 = Workstation Computer Organization I Supercomputer © 2006 -09 Mc. Quain, Feng & Ribbens
Turing Machine Model Introduction 3 Mathematical model of a device that can perform any computation – Alan Turing (1937) – – Ability to read/write symbols on an infinite “tape” State transitions, based on current state and symbol Tadd a, b a+b Turing machine that adds a, b Tmul ab Turing machine that multiplies Every effectively calculable function can be computed by some Turing machine. (Turing’s thesis) CS@VT August 2009 Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
Universal Turing Machine Introduction 4 A machine that can implement all Turing machines -- this is also a Turing machine! – inputs: data, plus a description of desired computation (other TMs) Tadd, Tmul a, b, c U c(a+b) Universal Turing Machine U is programmable – so it is a computer! - instructions are part of the input data - a computer can emulate a Universal Turing Machine A computer is a universal computing device. see CS 4124 CS@VT August 2009 Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
Practical Rejoinder Introduction 5 In theory, every computer is capable of computing exactly the same things… … given enough time and memory. But… in reality we operate under constraints: - time weather forecast, air traffic control, avionics - cost cell phone, navigation systems - power cell phone, portable game systems CS@VT August 2009 Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
Why learn this stuff? Introduction 6 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 Debugging skills often benefit from understanding architecture - better understand system error messages - better understand translators (compilers and interpreters) Both hardware and software affect performance: - Algorithm determines number of source-level statements - Language/Compiler/Architecture determine machine instructions (Chapters 2 and 3) - Processor/Memory determine how fast instructions are executed (Chapters 5, 6, and 7) CS@VT August 2009 Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
Primary Hardware Focus Introduction 7 The processor (datapath and control) - implemented using millions of transistors - Impossible to understand by looking at each transistor - We need. . . CS@VT August 2009 Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
Abstraction Introduction 8 Abstraction helps us deal with complexity - hides lower-level detail that's not needed from user-level perspective - failure to hide such detail can actually detract from the ability to carry out high-level tasks For example, what must you understand in order to: - make a call on a cell phone? open a door? turn on a light source? write an implementation of the Newton-Raphson algorithm in Java? CS@VT August 2009 Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
Conceptual Levels Introduction 9 Program - express an algorithm using a computer language - high-level language, low-level language Instruction Set Architecture (ISA) - specifies the set of instructions the computer can perform - data types, addressing mode Microarchitecture - detailed organization of a processor implementation - different implementations of a single ISA Logic Circuits - combine basic operations to realize microarchitecture - many different ways to implement a single function (e. g. , addition) Devices - properties of materials, manufacturability CS@VT August 2009 Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
Language Abstractions Introduction 10 Delving into the depths reveals more information An abstraction omits unneeded detail, helps us cope with complexity swap(int v[], int k) { int temp; temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; } Assembly language (MIPS) What are some of the details that appear in these familiar abstractions? 000010100000001100000100001 1000110000000000 100011110010000000100 101011001111001000000000 10101100010000000100 000000111110000000001000 CS@VT August 2009 swap: muli add lw lw sw sw jr High-level language (C) compiler $2, $5, 4 $2, $4, $2 $15, 0($2) $16, 4($2) $16, 0($2) $16, 4($2) $31 assembler Binary machine language (for MIPS) Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
How do computers work? Introduction 11 Need to understand abstractions such as: - Applications software - Systems software - Assembly Language - Machine Language - Architectural Issues: i. e. , Caches, Virtual Memory, Pipelining - Sequential logic, finite state machines - Combinational logic, arithmetic circuits - Boolean logic, 1 s and 0 s - Transistors used to build logic gates (CMOS) - Semiconductors/Silicon used to build transistors - Properties of atoms, electrons, and quantum dynamics So much to learn! CS@VT August 2009 Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
Pedagogy Introduction 12 Analogy: Consider a course on “automotive vehicles” - Many similarities from vehicle to vehicle (e. g. , wheels) - Huge differences from vehicle to vehicle (e. g. , gas vs. electric) Best way to learn: - Focus on a specific instance and learn how it works - While learning general principles and historical perspectives CS@VT August 2009 Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
Why learn this platform? Introduction 13 Assembly language programming - implementation of low-level system software - on RISC architectures, good optimizing compilers are usually better than humans - does that include GCC? MIPS architecture - clean, clear example of RISC architectures - used on some common, contemporary platforms CS@VT August 2009 Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
Course Overview Introduction 14 I. Bits and Bytes II. Digital Logic III. Processor and Instruction Set IV. Assembly Language Programming V. I/O, Traps, and Interrupts VI. Introduction to C Programming CS@VT August 2009 Computer Organization I © 2006 -09 Mc. Quain, Feng & Ribbens
- Slides: 14