Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*

Slides:



Advertisements
Similar presentations
Henk Corporaal TUEindhoven 2011
Advertisements

Lecture 13: 10/8/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Goal: Write Programs in Assembly
Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
Instruction Set-Intro
1 ECE462/562 ISA and Datapath Review Ali Akoglu. 2 Instruction Set Architecture A very important abstraction –interface between hardware and low-level.
1 ECE369 ECE369 Chapter 2. 2 ECE369 Instruction Set Architecture A very important abstraction –interface between hardware and low-level software –standardizes.
ECE 15B Computer Organization Spring 2010 Dmitri Strukov Lecture 5: Data Transfer Instructions / Control Flow Instructions Partially adapted from Computer.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 5 MIPS ISA & Assembly Language Programming.
Systems Architecture Lecture 5: MIPS Instruction Set
Chapter 2 Instructions: Language of the Computer
Chapter 2.
Instructions Set Bo Cheng Instruction Set Design An Instruction Set provides a functional description of a processor. It is the visible.
1 Lecture 2: MIPS Instruction Set Today’s topic:  MIPS instructions Reminder: sign up for the mailing list cs3810 Reminder: set up your CADE accounts.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.
CDA 3101 Fall 2012 Introduction to Computer Organization Instruction Set Architecture MIPS Instruction Format 04 Sept 2013.
CSE331 W02.1Irwin Fall 2001 PSU Computer Architecture Discussion Lecture # 2 MIPS Programming.
1 Computer Architecture COSC 3430 Lecture 3: Instructions.
April 23, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Assemblers, Linkers, and Loaders * Jeremy R. Johnson Mon. April 23,
Chapter 2 Instructions: Language of the Computer Part I.
Computer Organization and Architecture Instructions: Language of the Machine Hennessy Patterson 2/E chapter 3. Notes are available with photocopier 24.
Computer Architecture CSE 3322 Lecture 2 NO CLASS MON Sept 1 Course WEB SITE crystal.uta.edu/~jpatters.
Computer Architecture (CS 207 D) Instruction Set Architecture ISA.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /08/2013 Lecture 10: MIPS Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE CENTRAL STATE.
 1998 Morgan Kaufmann Publishers MIPS arithmetic All instructions have 3 operands Operand order is fixed (destination first) Example: C code: A = B +
Chapter 2 CSF 2009 The MIPS Assembly Language. Stored Program Computers Instructions represented in binary, just like data Instructions and data stored.
Computer Organization CS224 Fall 2012 Lessons 7 and 8.
Computer Organization Rabie A. Ramadan Lecture 3.
EE472 – Spring 2007P. Chiang, with Slide Help from C. Kozyrakis (Stanford) ECE472 Computer Architecture Lecture #3—Oct. 2, 2007 Patrick Chiang TA: Kang-Min.
EET 4250 Instruction Representation & Formats Acknowledgements: Some slides and lecture notes for this course adapted from Prof. Mary Jane Penn.
Chapter 2 — Instructions: Language of the Computer — 1 Memory Operands Main memory used for composite data – Arrays, structures, dynamic data To apply.
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 7, 8 Instruction Set Architecture.
CHAPTER 2 Instruction Set Architecture 3/21/
Computer Architecture & Operations I
Computer Architecture & Operations I
MIPS Assembly.
MIPS Instruction Set Advantages
COMPUTER ARCHITECTURE & OPERATIONS I
Instruction Set Architecture
Morgan Kaufmann Publishers
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
The University of Adelaide, School of Computer Science
Computer Architecture (CS 207 D) Instruction Set Architecture ISA
Computer Architecture & Operations I
MIPS Assembly.
CS170 Computer Organization and Architecture I
CSCI206 - Computer Organization & Programming
Instructions - Type and Format
Lecture 4: MIPS Instruction Set
CSCI206 - Computer Organization & Programming
The University of Adelaide, School of Computer Science
Systems Architecture Lecture 5: MIPS Instruction Set
Henk Corporaal TUEindhoven 2010
Computer Architecture & Operations I
MIPS Instruction Encoding
The University of Adelaide, School of Computer Science
September 24 Test 1 review More programming
MIPS Instruction Encoding
Chapter 2 Instructions: Language of the Computer
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Computer Architecture
September 17 Test 1 pre(re)view Fang-Yi will demonstrate Spim
COMS 361 Computer Organization
UCSD ECE 111 Prof. Farinaz Koushanfar Fall 2018
COMS 361 Computer Organization
COMS 361 Computer Organization
CPU Structure CPU must:
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Presentation transcript:

Systems Architecture I (CS 281-001) Lecture 5: MIPS Instruction Set* September 4, 1997 Systems Architecture I (CS 281-001) Lecture 5: MIPS Instruction Set* Jeremy R. Johnson Mon. Apr. 10, 2000 *This lecture was derived from material in the text (sec. 3.1-3.5). Apr. 10, 2000 Systems Architecture I

Systems Architecture I September 4, 1997 Introduction Objective: To introduce the MIPS instruction set and to show how MIPS instructions are represented in the computer. The stored-program concept: Instructions are represented as numbers. Programs can be stored in memory to be read or written just like data. Apr. 10, 2000 Systems Architecture I

Systems Architecture I September 4, 1997 Instructions Language of the machine More primitive than higher level languages (e.g. C, C++, Java) e.g. no sophisticated control flow , primitive data structures MIPS (SGI, NEC, Nintendo ) developed in the early 80’s (RISC) Regular (32 bit instructions, small number of different formats) Relatively small number of instructions Register (all instructions operate on registers) Load/Store (memory accessed only with load/store instructions, with few addressing modes) Design goals: maximize performance and minimize cost, reduce design time Apr. 10, 2000 Systems Architecture I

Systems Architecture I September 4, 1997 MIPS Arithmetic All instructions have 3 operands Operand order is fixed (destination first) Example C code: A = B + C MIPS code: add $s0, $s1, $s2 (associated with variables by compiler) Apr. 10, 2000 Systems Architecture I

Systems Architecture I September 4, 1997 Temporary Variables Regularity of instruction format requires that expressions get mapped to a sequence of binary operations with temporary results being stored in temporary variables. Example C code: f = (g + h) - (i + j); Assume: f,g,h,i,j in $s0 through $s4 respectively MIPS code: add $t0, $s1, $s2 # $t0 = g+h add $t1, $s3, $s4 # $t1 = i+j sub $s0, $t0, $t1 # f = $t0 - $t1 Apr. 10, 2000 Systems Architecture I

Systems Architecture I September 4, 1997 Registers vs. Memory operands for arithmetic instructions must be registers, — only 32 registers provided Compiler associates variables with registers When too many registers are used to simultaneously fit in 32 registers, the compiler must load and store temporary results to/from memory. The compiler tries to put the most frequently occurring variables in registers. Extra temporary variables must be “spilled” to memory. Apr. 10, 2000 Systems Architecture I

Systems Architecture I September 4, 1997 Memory Organization Viewed as a large, single-dimension array, where a memory address is an index into the array In MIPS memory is "Byte addressing”, which means that the index points to a byte of memory. 1 2 3 4 5 6 ... 8 bits of data Apr. 10, 2000 Systems Architecture I

Systems Architecture I September 4, 1997 Memory Organization Most data items are grouped into words (a MIPS word is 4 bytes) 232 bytes with byte addresses from 0 to 232-1 230 words with byte addresses 0, 4, 8, ... 232-4 Words are aligned bytes can be accessed from left to right (big endian) or right to left (little endian) 4 8 12 ... 32 bits of data Registers hold 32 bits of data Apr. 10, 2000 Systems Architecture I

Systems Architecture I September 4, 1997 Load and Store All arithmetic instructions operate on registers Memory is accessed through load and store instructions Example: C code: A[12] = h + A[8]; Assume that $s0 contains the base address of A MIPS code: lw $t0, 32($s3) add $t0, $s2, $t0 sw $t0, 48($s3) Store word has destination last Apr. 10, 2000 Systems Architecture I

Representing Instructions in the Computer September 4, 1997 Representing Instructions in the Computer MIPS instructions are 32 bits opcode, operands Example: add $t0, $s0, $s1 $t0 = $8, $s0 = $16, $s1 = $17 000000 10000 10001 01000 00000 100000 op rs rt rd shamt func Apr. 10, 2000 Systems Architecture I

Representing Instructions in the Computer September 4, 1997 Representing Instructions in the Computer Instruction formats: R format (register format - add, sub, …) I format (immediate format - lw, sw, …) Example: lw $s1, 100($s2) op rs rt rd shamt func op rs rt address 35 18 17 100 Apr. 10, 2000 Systems Architecture I

Systems Architecture I September 4, 1997 Design Principles Simplicity favors regularity Smaller is faster Good design demands good compromises Make common cases fast Apr. 10, 2000 Systems Architecture I