Lecture 2: Instruction Set Architecture part 1 (Introduction) Mehran Rezaei.

Slides:



Advertisements
Similar presentations
CS/COE1541: Introduction to Computer Architecture Datapath and Control Review Sangyeun Cho Computer Science Department University of Pittsburgh.
Advertisements

Instruction Set Design
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
ISA Issues; Performance Considerations. Testing / System Verilog: ECE385.
1 ECE462/562 ISA and Datapath Review Ali Akoglu. 2 Instruction Set Architecture A very important abstraction –interface between hardware and low-level.
CML CML CS 230: Computer Organization and Assembly Language Aviral Shrivastava Department of Computer Science and Engineering School of Computing and Informatics.
©UCB CS 161 Lecture 4 Prof. L.N. Bhuyan
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 5 MIPS ISA & Assembly Language Programming.
ELEN 468 Advanced Logic Design
CS3350B Computer Architecture Winter 2015 Lecture 4
Chapter 2 Instructions: Language of the Computer
Chapter 2.
CSE 340 Computer Architecture Spring 2014 MIPS ISA Review
Instruction Set Architecture Classification According to the type of internal storage in a processor the basic types are Stack Accumulator General Purpose.
Chapter 2 Instructions: Language of the Computer Part III.
1 Registers and MAL - Part I. Motivation So far there are some details that we have ignored instructions can have different formats most computers have.
CSE331 W02.1Irwin&Li 2006 PSU CSE 331 Computer Organization and Design Fall 2006 Adaptado a DSD. R. Pereira Section 1: Mary Jane Irwin (
Execution of an instruction
ENEE350 Spring07 1 Ankur Srivastava University of Maryland, College Park Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005.”
331 W02.1Spring 05 Announcements  HW1 is due on this Friday  Appendix A (on CD) is very helpful to HW1.
1 CSE SUNY New Paltz Chapter 3 Machine Language Instructions.
OK, we are now ready to begin Chapter 2 of our text
S. Barua – CPSC 440 CHAPTER 2 INSTRUCTIONS: LANGUAGE OF THE COMPUTER Goals – To get familiar with.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
331 W02.1Fall 2003 Announcements  HW1 is due on this Friday (Sept 12 th )  Appendix A is very helpful to HW1. Check out system calls on Page A-48. 
331 Practice Exam.1Fall 2003 Naming Conventions for Registers 0$zero constant 0 (Hdware) 1$atreserved for assembler 2$v0expression evaluation & 3$v1function.
Some material taken from Assembly Language for x86 Processors by Kip Irvine © Pearson Education, 2010 Slides revised 2/2/2014 by Patrick Kelley.
Topic IIa Instruction Set Architecture and MIPS
Computer Engineering IntroLab1 page 1 Beginners explanation on how a processor works! The labs will teach you the truth.
CSE331 W02.1Irwin Fall 2001 PSU Computer Architecture Discussion Lecture # 2 MIPS Programming.
Computer architecture Lecture 11: Reduced Instruction Set Computers Piotr Bilski.
Lecture 4: MIPS Subroutines and x86 Architecture Professor Mike Schulte Computer Architecture ECE 201.
1 CS/EE 362 Hardware Fundamentals Lecture 10 (Chapter 3: Hennessy and Patterson) Winter Quarter 1998 Chris Myers.
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
Computer Organization and Design Computer Abstractions and Technology
Computer Architecture Mehran Rezaei
1 Computer Architecture COSC 3430 Lecture 3: Instructions.
6.S078 - Computer Architecture: A Constructive Approach Introduction to SMIPS Li-Shiuan Peh Computer Science & Artificial Intelligence Lab. Massachusetts.
Execution of an instruction
Module : Algorithmic state machines. Machine language Machine language is built up from discrete statements or instructions. On the processing architecture,
Computer Organization CS224 Fall 2012 Lesson 22. The Big Picture  The Five Classic Components of a Computer  Chapter 4 Topic: Processor Design Control.
MicroComputer Engineering IntroLab1 page 1 Introduction Lab1  A crash course in assembler programming  Learn how a processor works!  Decode a coded.
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.
CDA 3101 Fall 2013 Introduction to Computer Organization
Computer Organization & Programming Chapter 6 Single Datapath CPU Architecture.
Computer Architecture CSE 3322 Lecture 3 Assignment: 2.4.1, 2.4.4, 2.6.1, , Due 2/3/09 Read 2.8.
1 chapter 1 Computer Architecture and Design ECE4480/5480 Computer Architecture and Design Department of Electrical and Computer Engineering University.
Computer Organization Rabie A. Ramadan Lecture 3.
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 7, 8 Instruction Set Architecture.
Computer Organization Instructions Language of The Computer (MIPS) 2.
MIPS Lab CMPE 142 – Operating Systems. MIPS Simulator First Time Startup Setting Options.
MIPS Processor.
CS35101 Computer Architecture Spring 2006 Week 2.
Electrical and Computer Engineering University of Cyprus
ELEN 468 Advanced Logic Design
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
Computer Architecture (CS 207 D) Instruction Set Architecture ISA
Instructions - Type and Format
Lecture 4: MIPS Instruction Set
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
The University of Adelaide, School of Computer Science
The University of Adelaide, School of Computer Science
ECE232: Hardware Organization and Design
Computer Instructions
COMS 361 Computer Organization
COMS 361 Computer Organization
CPU Structure CPU must:
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Presentation transcript:

Lecture 2: Instruction Set Architecture part 1 (Introduction) Mehran Rezaei

2 Overview Last Lecture’s Review Execution Cycle Levels of Computer Languages Stored Program Computer/Instruction Execution Cycle SPIM, a MIPS Interpreter MIPS Arithmetic Instructions Register File and Register Naming Convention

3 Review Intro to Computer Architecture Course Style, Philosophy and Structure High Level, Assembly, Machine Language Anatomy of computer system

4 Execution Cycle Instruction Fetch Instruction Decode Operand Fetch Execute Result Store Next Instruction Obtain instruction from program storage Determine required actions and instruction size Locate and obtain operand data Compute result value or status Deposit results in storage for later use Determine successor instruction

5 Stored Program Computer

6 Stored Program Computer (object code in memory)

7 The process of executing instructions Instruction Fetch PC has the address of the next instruction to be fetched so the control unit fetches the instruction whose address is in PC, and puts it into IR.

8 Next Cycle: ? Control unit decodes the instruction and fetches the operands

9 Execute Data path executes the instruction as directed by the Control unit

10 Instruction formats in R3000 Instruction Categories –Load/Store –Computational –Jump and Branch –Floating Point coprocessor –Memory Management –Special R0 - R31 PC HI LO OP rs rt rdsafunct rs rt immediate jump target 3 Instruction Formats: all 32 bits wide Registers R-format I-format J-format

11 Executes (Reg – Reg) Data path executes the instruction as directed by the Control unit

12 Mem (Reg – Reg) No operation takes place in this cycle

13 WB (Reg – Reg) Result will be put into Reg #2

14 Question What if the CPU executes a load instruction lw $2,504($1) what happens in Exe, Mem, and WB

15 RISC: Reduced Instruction Set Computer RISC philosophy –Fixed instruction length –Load/store instruction set –Limited addressing modes –Limited operations Examples –Alpha processor, Sun SPARC, SGI MIPS, … Design a good instruction set –How well compilers use it; compiler optimization

16 Homework Assignment SPIM a MIPS Interpreter You should have it on the CD; you can also download it off the web, follow the resources page of the course web site. Please read about SPIM and download some programs - you can find a zillion of sample MIPS programs on line – and run them using SPIM.

17 MIPS Arithmetic Instructions Assembly arithmetic statement add $3, $1, $2 sub$3, $1, $2 Each arithmetic instruction performs only one operation Each arithmetic instruction specifies exactly three operands Destination  source1 op source2 The operands should be the contents of the datapath’s register files The operand’s order is fix: Destination first

18 An example If b is in register $1, c in $2, d in $3, and the result supposed to be in $4 h = (b – c) + d sub$5, $1, $2 add$4, $5, $3

19 MIPS Register file Operands of arithmetic instructions must be from a limited number of special locations contained in the datapath’s register file –Holds thirty-two 32-bit registers 2 read ports 1 write port Registers are –Faster than main memory –Easier for compiler to use (a * b) – (c * d) – (e * f) any order of these multiplication –Can hold variables so that Code density is improved (fewer bits used to address registers than memory locations)

20 Register file (Cont’d) R#0 R#1 R#2 R#31 32 bits src1 addr src2 addr dest addr Write Back data 32 src1 data 32 src2 data interface

21 Register file (Cont’d)

22 Naming Convention for registers 0zero constant 0 1atreserved for assembler 2v0expression evaluation & 3v1function results 4a0arguments 5a1 6a2 7a3 8t0temporary: caller saves...(callee can clobber) 15t7 16s0callee saves... (caller can clobber) 23s7 24t8 temporary (cont’d) 25t9 26k0reserved for OS kernel 27k1 28gpPointer to global area 29spStack pointer 30fpframe pointer 31raReturn Address (HW)

23 example Compile f = g + h + i if f is in $s0, g in $s1, h in $s2, i in $s3 add $s0,$s1,$s2 add $s0,$s0,$s3 f = (g + h) – (i + j)if f is in $s0, g in $s1, h in $s2, i in $s3, and j in $s4

24 Data transfer instructions Compile G = h - A[7];address of A[0] is in $s1, G in $s2, and h in $s3

25 Example Compile A[20] += A[8];address of A[0] is in $s1

26 Anatomy of data transfer inst. lw $t0, 5($s1) offset Base register Index register (why?)

27 Translate to machine code A[20] +=A[8]; Instructions, so far