Computer Organization and Architecture Instructions: Language of the Machine Hennessy Patterson 2/E chapter 3. Notes are available with photocopier 24.

Slides:



Advertisements
Similar presentations
MIPS Assembly Tutorial
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
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.
MIPS processor continued. Review Different parts in the processor should be connected appropriately to be able to carry out the functions. Connections.
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.
Datorteknik DatapathControl bild 1 Designing a Single Cycle Datapath & Datapath Control.
Chapter 2 Instructions: Language of the Computer Part III.
Instructions Set Bo Cheng Instruction Set Design An Instruction Set provides a functional description of a processor. It is the visible.
S. Barua – CPSC 440 CHAPTER 2 INSTRUCTIONS: LANGUAGE OF THE COMPUTER Goals – To get familiar with.
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
ECE 4436ECE 5367 ISA I. ECE 4436ECE 5367 CPU = Seconds= Instructions x Cycles x Seconds Time Program Program Instruction Cycle CPU = Seconds= Instructions.
CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.
MIPS assembly. Computer What’s in a computer? Processor, memory, I/O devices (keyboard, mouse, LCD, video camera, speaker), disk, CD drive, …
CSE331 W02.1Irwin Fall 2001 PSU Computer Architecture Discussion Lecture # 2 MIPS Programming.
COSC 2021: Computer Organization Instructor: Dr. Amir Asif Department of Computer Science York University Handout # 3: MIPS Instruction Set I Topics: 1.
Computer Architecture CSE 3322 Lecture 2 NO CLASS MON Sept 1 Course WEB SITE crystal.uta.edu/~jpatters.
Computer Organization & Programming Chapter 6 Single Datapath CPU Architecture.
CHAPTER 6 Instruction Set Architecture 12/7/
Computer Architecture CSE 3322 Lecture 3 Assignment: 2.4.1, 2.4.4, 2.6.1, , Due 2/3/09 Read 2.8.
Computer Organization Rabie A. Ramadan Lecture 3.
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.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Lecture 2: Instruction Set Architecture part 1 (Introduction) Mehran Rezaei.
Computer Organization Instructions Language of The Computer (MIPS) 2.
MIPS assembly. Computer  What’s in a computer?  Processor, memory, I/O devices (keyboard, mouse, LCD, video camera, speaker), disk, CD drive, …
CMPUT Computer Organization and Architecture I1 CMPUT229 - Fall 2003 Topic3: Instructions, The Language of the Machine José Nelson Amaral.
CHAPTER 2 Instruction Set Architecture 3/21/
MIPS Assembly.
MIPS Instruction Set Advantages
COMPUTER ARCHITECTURE & OPERATIONS I
Instruction Set Architecture
Morgan Kaufmann Publishers
ELEN 468 Advanced Logic Design
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
Computer Architecture (CS 207 D) Instruction Set Architecture ISA
Computer Architecture & Operations I
MIPS Assembly.
CS170 Computer Organization and Architecture I
Instructions - Type and Format
Lecture 4: MIPS Instruction Set
Computer Programming Machine and Assembly.
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
The University of Adelaide, School of Computer Science
MIPS assembly.
Computer Architecture & Operations I
MIPS Instruction Encoding
The University of Adelaide, School of Computer Science
ECE232: Hardware Organization and Design
September 24 Test 1 review More programming
Rocky K. C. Chang 6 November 2017
MIPS Instruction Encoding
Computer Architecture
September 17 Test 1 pre(re)view Fang-Yi will demonstrate Spim
COMP541 Datapaths I Montek Singh Mar 18, 2010.
UCSD ECE 111 Prof. Farinaz Koushanfar Fall 2018
COMS 361 Computer Organization
COMS 361 Computer Organization
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
MIPS Assembly.
Presentation transcript:

Computer Organization and Architecture Instructions: Language of the Machine Hennessy Patterson 2/E chapter 3. Notes are available with photocopier 24 th March, 2008

Hw 1 Due in next class. Available on Punjab in Farhan Iqbal folder.

Quiz Suppose we have made the following measurements: Frequency of FP operations = 25 % Average CPI of FP operations = 4.0 Average CPI of other Instructions = 1.33 Frequency of FPSQR = 2% CPI of FPSQR = 20 Assume that the two design are to decrease the CPI for FPSQR to 2 or to decrease the average CPI of all FP operations to 2.5. Compare these two design alternatives using the processor performance equation. Hint: Do not use Ahmdel’s law BLINDLY.

Operations Fundaments Arithmetic operations always needed. In MIPS add, subtract add a, b, c # add b and c and store in a sub a, b, c # subtract c from b and store in a Requires 3 operands i.e. fixed Operands. Why???? Arithmetic operation is performed on two operands and result is stored in third.

Example a = b + c + d + e

Example Just like C temporary variables can also be used f = (g + h) – (i + j)

add t0, g, h add t1, i, j sub f, t0, t1

Operands Variables – registers Typically 32 In MIPS 32 registers of 32 bits (word) Why limited?? MIPS convention is using $s0, $s1.. $s31 Redoing the example f = (g + h) – (i + j) ;

Data structure of programming languages can contain many more data elements than register. How will computer represent/access these large structures? Large data structures are stored in … ?

Data Transfer Instructions Arithmetic operations only occur in registers Data is stored in memory Instructions that transfer data between memory and registers are required. Operand, Address Load, store lw, sw

Example lw $t0, 100($s2) # $t0 = Mem[100+$2] offset??, base register ?? Lets assume that A is an array of 100 words and that the compiler has associated the variables g and h with the registers $s1 and $s2 as before. Lets also assume that the starting address, or base address of the arrary is in $s3. Translate this C assignment statement: g = h + A[8]

Byte addressing For MIPS a word is 32 bits or 4 bytes Register holds 32 bits of data 2 32 bytes with byte addresses from 0 to 2 32 – words with byte address from 0 to Big Endian, Little Endian Offset to be the added to the base register is re- calculated.

Example Assume variable h is associated with register $s2 and the base address of the array A is in $s3. What is the MIPS assembly code for the C assignment statement below? A[12] = h + A [8]

lw $t0, 32 ($s3) add $t0, $s2, $t0 sw $t0, 48($s3)

Example Assume A is in array of 100 elements whose base is in register $s3 and that the compiler associates the variables g, h and i with register $s1, $s2 and $s4 respectively. What is the MIPS assembly code corresponding to this C segment? g = h + A [i]

add $t1, $s4, $s4 add $t1, $t1, $t1 add $t1, $t1, $s3 lw $t0, 0 ($t1) add $s1, $s2, $t0

Representing Instructions in the Computer MIPS fields R Type Format op: Basic operation, opcode rs: first register source operand rt: the second register source operand rd: destination operand shamt: Shift Amount funct: function code oprsrtrdshamtfunt 6 bits5 bits 6 bits

Load requires two operands and a constant. Constant limited to 5 bit fields only?? I- Type Format oprsrtAddress 6 bits5 bits 16 bits