CS35101 Computer Architecture Spring 2006 Week 1 Slides adapted from: Mary Jane Irwin ( Course url: [Adapted from Dave Patterson’s UCB CS152 slides]
Course Administration Instructor:Paul J Durand Labs:Accounts on loki or neptune Texts:Computer Organization and Design: The Hardware/Software Interface, Third Edition, Patterson and Hennessy
Course Goals and Structure Introduction to the major components of a computer system, how they function together in executing a program, how they are designed. l MIPS assembler programming using the spim system
spim Assembler and Simulator spim is a self-contained assembler and simulator for the MIPS R2000/R3000 l It provides a simple assembler, debugger and a simple set of operating system services l It implements both a simple, terminal-style interface and a visual windowing interface Available as l xspim on unix -installed on the CS unix machines loki, hermes, neptune, poseidon l PCSpim on Windows -can be downloaded and installed on your own PC from l Sorry, there is no Macintosh version of spim
Head’s Up This week’s material l Course introduction -Reading assignment – PH 1.1 through 1.3 and A.9 through A.10 (on cd) Reminders l Make sure your unix account is operational; change your password to something you can remember and that is secure (must be six to eight alphanumeric characters) l Check out the course homepage ( Next week’s material l Introduction to MIPS assembler -Reading assignment - PH 2.1 through 2.7, omit 2.6
What You Should Already Know How to write, compile and run programs in a higher level language (C, C++, Java, …) How to create, organize, and edit files and run programs on Unix How to represent and operate on positive and negative numbers in binary form (two’s complement, sign magnitude, etc.) Logic design l How to design combinational components (Boolean algebra, logic minimization, decoders and multiplexors)
Below the Program High-level language program (in C) swap (int v[], int k) (int temp; temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; ) Assembly language program (for MIPS) swap:sll$2, $5, 2 add$2, $4,$2 lw$15, 0($2) lw$16, 4($2) sw$16, 0($2) sw$15, 4($2) jr$31 Machine (object) code (for MIPS)
Below the Program High-level language program (in C) swap (int v[], int k) (int temp; temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; ) Assembly language program (for MIPS) swap:sll$2, $5, 2 add$2, $4,$2 lw$15, 0($2) lw$16, 4($2) sw$16, 0($2) sw$15, 4($2) jr$31 Machine (object) code (for MIPS) C compilerassembler
Advantages of Higher-Level Languages Higher-level languages As a result, very little programming is done today at the assembler level
Advantages of Higher-Level Languages Higher-level languages As a result, very little programming is done today at the assembler level l Allow the programmer to think in a more natural language and for their intended use (Fortran for scientific computation, Cobol for business programming, Lisp for symbol manipulation, …) l Improve programmer productivity – more understandable code that is easier to debug and validate l Improve program maintainability l Allow programmers to be independent of the computer on which they are developed (compilers and assemblers can translate high-level language programs to the binary instructions of any machine) l Emergence of optimizing compilers that produce very efficient assembly code optimized for the target machine
Machine Organization Capabilities and performance characteristics of the principal Functional Units (FUs) l e.g., register file, ALU, multiplexors, memories,... The ways those FUs are interconnected l e.g., buses Logic and means by which information flow between FUs is controlled The machine’s Instruction Set Architecture (ISA) Register Transfer Level (RTL) machine description
Major Components of a Computer Processor Control Datapath Memory Devices Input Output
Impacts of Advancing Technology Processor l logic capacity:increases about 30% per year l performance:2x every 1.5 years Memory l DRAM capacity:4x every 3 years l memory speed:1.5x every 10 years l cost per bit:decreases about 25% per year Disk l capacity:increases about 60% per year
Example: Growth in DRAM Chip Capacity
Below the Program C compilerassembler one-to-many one-to-one High-level language program (in C) swap (int v[], int k)... Assembly language program (for MIPS) swap: sll $2, $5, 2 add $2, $4, $2 lw $15, 0($2) lw $16, 4($2) sw $16, 0($2) sw $15, 4($2) jr $31 Machine (object) code (for MIPS)
Below the Program C compilerassembler one-to-many one-to-one High-level language program (in C) swap (int v[], int k)... Assembly language program (for MIPS) swap: sll $2, $5, 2 add $2, $4, $2 lw $15, 0($2) lw $16, 4($2) sw $16, 0($2) sw $15, 4($2) jr $31 Machine (object) code (for MIPS)
Input Device Inputs Object Code Processor Control Datapath Memory Devices Input Output
Object Code Stored in Memory Processor Control Datapath Memory Devices Input Output
Processor Fetches an Instruction Processor Control Datapath Memory Devices Input Output Processor fetches an instruction from memory Where does it fetch from?
Control Decodes the Instruction Processor Control Datapath Memory Devices Input Output Control decodes the instruction to determine what to execute
Datapath Executes the Instruction Processor Control Datapath Memory Devices Input Output contents Reg #4 ADD contents Reg #2 results put in Reg #2 Datapath executes the instruction as directed by control
Processor Organization Control needs to have the l Ability to input instructions from memory l Logic and means to control instruction sequencing l Logic and means to issue signals that control the way information flows between datapath components l Logic and means to control what operations the datapath’s functional units perform Datapath needs to have the l Components - functional units (e.g., adder) and storage locations (e.g., register file) - needed to execute instructions l Components interconnected so that the instructions can be accomplished l Ability to load data from and store data to memory Where does it load and store from and to?
What Happens Next? Processor Control Datapath Memory Devices Input Output
What Happens Next? Processor Control Datapath Memory Devices Input Output FetchDecodeExec
Output Data Stored in Memory Processor Control Datapath Memory Devices Input Output At program completion the data to be output resides in memory
Output Device Outputs Data Processor Control Datapath Memory Devices Input Output
The Instruction Set Architecture instruction set architecture software hardware The interface description separating the software and hardware. Stopped here 1/19
MIPS R3000 Instruction Set Architecture Instruction Categories l Load/Store l Computational l Jump and Branch l Floating Point -coprocessor l Memory Management l Special R0 - R31 PC HI LO OP rs rt rdsafunct rs rt immediate jump target 3 Instruction Formats: all 32 bits wide Registers Q: How many already familiar with MIPS ISA?
How Do the Pieces Fit Together? I/O systemInstr. Set Proc. Compiler Operating System Application Digital Design Circuit Design Instruction Set Architecture Firmware Coordination of many levels of abstraction Under a rapidly changing set of forces Design, measurement, and evaluation Memory system Datapath & Control