CHAPTER 6 Instruction Set Architecture 12/7/2015 1.

Slides:



Advertisements
Similar presentations
Henk Corporaal TUEindhoven 2011
Advertisements

1 Lecture 3: MIPS Instruction Set Today’s topic:  More MIPS instructions  Procedure call/return Reminder: Assignment 1 is on the class web-page (due.
Goal: Write Programs in Assembly
Lecture 5: MIPS Instruction Set
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.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 5 MIPS ISA & Assembly Language Programming.
ELEN 468 Advanced Logic Design
Systems Architecture Lecture 5: MIPS Instruction Set
Chapter 2 Instructions: Language of the Computer
Chapter 2.
Informationsteknologi Saturday, September 29, 2007 Computer Architecture I - Class 41 Today’s class More assembly language programming.
1 Warning! Unlike the previous lessons, for today's lesson you will have to listen, think and even understand (for the exam, of course). Individuals with.
Instructions Set Bo Cheng Instruction Set Design An Instruction Set provides a functional description of a processor. It is the visible.
MIPS Architecture CPSC 321 Computer Architecture Andreas Klappenecker.
MIPS Assembly Language I Computer Architecture CPSC 321 Andreas Klappenecker.
ENEE350 Spring07 1 Ankur Srivastava University of Maryland, College Park Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005.”
Computer Architecture CPSC 321 E. J. Kim. Overview Logical Instructions Shifts.
S. Barua – CPSC 440 CHAPTER 2 INSTRUCTIONS: LANGUAGE OF THE COMPUTER Goals – To get familiar with.
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 - The Instruction Set The Course’s Goals  To be interesting and fun. An interested student learns more.  To answer questions that.
CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.
MIPS Instruction Set Advantages
ISA-2 CSCE430/830 MIPS: Case Study of Instruction Set Architecture CSCE430/830 Computer Architecture Instructor: Hong Jiang Courtesy of Prof. Yifeng Zhu.
CHAPTER 2 ISA Instructions (logical + procedure call)
CDA 3101 Fall 2012 Introduction to Computer Organization Instruction Set Architecture MIPS Instruction Format 04 Sept 2013.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
COSC 2021: Computer Organization Instructor: Dr. Amir Asif Department of Computer Science York University Handout # 3: MIPS Instruction Set I Topics: 1.
1  1998 Morgan Kaufmann Publishers Machine Instructions: Language of the Machine Lowest level of programming, control directly the hardware Assembly instructions.
Lecture 4: MIPS Instruction Set
Computer Architecture CSE 3322 Lecture 2 NO CLASS MON Sept 1 Course WEB SITE crystal.uta.edu/~jpatters.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /08/2013 Lecture 10: MIPS Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE CENTRAL STATE.
Computer Architecture CSE 3322 Lecture 3 Assignment: 2.4.1, 2.4.4, 2.6.1, , Due 2/3/09 Read 2.8.
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.
EET 4250 Instruction Representation & Formats Acknowledgements: Some slides and lecture notes for this course adapted from Prof. Mary Jane Penn.
Computer Architecture CSE 3322 Lecture 4 Assignment: 2.4.1, 2.4.4, 2.6.1, , Due 2/10/09
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 7, 8 Instruction Set Architecture.
CDA 3101 Spring 2016 Introduction to Computer Organization
COMPUTER ORGANIZATION LECTURE 3: ISA YASSER MOHAMMAD.
CHAPTER 2 Instruction Set Architecture 3/21/
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Computer Architecture & Operations I
MIPS Assembly.
MIPS Instruction Set Advantages
COMPUTER ARCHITECTURE & OPERATIONS I
Instruction Set Architecture
Morgan Kaufmann Publishers
Lecture 4: MIPS Instruction Set
ELEN 468 Advanced Logic Design
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
Computer Architecture (CS 207 D) Instruction Set Architecture ISA
Super Quick Architecture Review
ECE/CS 552: Instruction Sets – MIPS
Instructions - Type and Format
Lecture 4: MIPS Instruction Set
Systems Architecture Lecture 5: MIPS Instruction Set
Logical and Decision Operations
Computer Architecture & Operations I
The University of Adelaide, School of Computer Science
ECE232: Hardware Organization and Design
Logical and Decision Operations
Computer Architecture
3.
COMS 361 Computer Organization
UCSD ECE 111 Prof. Farinaz Koushanfar Fall 2018
COMS 361 Computer Organization
CPU Structure CPU must:
Instruction Set Architecture
Presentation transcript:

CHAPTER 6 Instruction Set Architecture 12/7/2015 1

Topics for Discussion Instruction set architecture  Stored program computer  Interface between software and hardware  Instructions  Design principles  Instructions, registers, and memory  Simple instructions types and formats 12/7/2015 2

Where do you go from here (CSE241): Computer Organization Is the study of major components of a modern digital computer, their organization and assembly, and the architecture and inner workings of these components. It also deals with design principles for a good performance. 12/7/2015 3

Mother Board Contains packages of integrated circuit chips (IC chips) including a processor, cache (several), memory (DRAM), connections for IO devices (networks, disks) 12/7/2015 4

Central Processing Unit (CPU) Example: Intel   Pentium Main components of a CPU are datapath and control unit Datapath is the component of the processor that performs (arithmetic) operations Control is the component of the processor that commands the datapath, memory, IO device according to instruction of the program Cache provides but fast memory that acts as a buffer for slower /larger memory outside the chip. 12/7/2015 5

Instruction set Architecture An important abstraction between hardware and software. Lets discuss this concept. Computer operation is historically called an instruction. Instructions stored similar to data in a memory give rise to an important foundational concept called the stored program computer. Lets look at MIPS: Microprocessor without Interlocked Pipelined Stages 12/7/2015 6

C to MIPS instruction Consider a C language statement: f = (g + h) – ( i + j)Compile add t0, g, h add t1,i, j sub f,t0,t1 Design principle 1: simplicity favors regularity In the above example: all instructions have 3 operands 12/7/2015 7

Register set Where do the data get stored in the CPU? Named locations called registers? How many? Typical small compared to memory sizes. Registers: MIPS-32 has 32 register Denoted by s0, s1, etc. $s0, $s5 Temporary registers are denoted by $t0, $t1 12/7/2015 8

C to MIPS instruction (Take 2 with registers) Consider a C language statement: f = (g + h) – ( i + j) Compile add $t0, $s1, $s2 add $t1,$s3,$s4 sub $s0,$t0,$t1 Design principle 2: Smaller is faster Memory available as registers is 32 in number 12/7/2015 9

Memory Operations Data and instructions are stored in memory outside the CPU. Data is loaded from memory and stored in memory. Load word (lw) Store word (sw) 32 resgiters 2 30 words or 2 32 addressable locations or bytes 12/7/

C language to Memory instructions g = h + A[8]Compile lw $t0, 32($s3) add $s1, $s2, $t0 sw $t0,48($s3) Base register concept: base register is $s3 and Offset of 32 for 8 words and offset of 48 for 12 words 12/7/

Instruction Types add and sub lw and sw Now lets see how we can deal with a constant value data. Consider C language statement: x = x +4 Too complex: lw $t0, AddrConst($s1) add $s3,$s3,$t0 Instead how about: addi $s3,$s3,4 Design principle 3: Make the common case fast. Example “addi” instead of add an constant from memory. 12/7/

Instruction format –R type Op 6 bits RS 5 bits Rt 5 bits Rd 5 bits Shamt 5 bits funct 6 bits Can we use the same format for addi and add? Then we will Have only 11 bit constant 12/7/

Instruction format – I type Op 6 bits Rs 5 bits Rt 5 bits Constant or address 16 bits Design principle 4: good design demands good compromise; Keep instruction length same needing different formats ; I and R type are examples 12/7/

Logical operations Shift left  Example: sll $t2,$so,4  Reg t2 = $so << 4 Shift right  Example: srl $t2,$so,4  Reg t2 = $so >> 4 Bit-wise AND  Example: and $t0,$t1, $t2  Reg t0 = reg t1 & reg t2 Bit-wise OR  Example: or $t0,$t1,$t2  Reg $t0 = $t1 | $t2

Instructions for Selection (if..else) If (i == j) then f = g + h; else f = g – h; bne $s3,$s4, else add $s0,$s1,$s2 j done else: sub $s0,$s1,$s2 done:

Instructions for Iteration (while) while (save[i] == k) i = i + 1; Let i be in reg $s3 Let k be in reg $s5 Let $t1 have the address of Save array element Loop: sll $t1,$s3,2 add $t1,$t1$s6 lw $t0,0($t1) bne $t0,$s5,Exit addi $s3,$s3,1 j Loop

Compiling C procedures int leaf_example (int g, int h, int i, int j) { int f; f = (g + h) – (i + j); return f; } How do you pass the parameters? How does compiler transport the parameters?

Passing Parameters/arguments Special registers for arguments: a0, a1, a2, a3 Save temp register on the stack Perform operations And return value Restore values stored on the stack Jump back to return address

Summary MIPS operands MIPS memory MIPS Assembly language MIPS instructions type and formats And of course, the four design principles. 12/7/