COMPUTER ARCHITECTURE & OPERATIONS I

Slides:



Advertisements
Similar presentations
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.
Advertisements

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.
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.
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.
MIPS Architecture CPSC 321 Computer Architecture Andreas Klappenecker.
Computer Architecture CPSC 321 E. J. Kim. Overview Logical Instructions Shifts.
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.
ECE 15B Computer Organization Spring 2010 Dmitri Strukov Lecture 6: Logic/Shift Instructions Partially adapted from Computer Organization and Design, 4.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.
ISA-2 CSCE430/830 MIPS: Case Study of Instruction Set Architecture CSCE430/830 Computer Architecture Instructor: Hong Jiang Courtesy of Prof. Yifeng Zhu.
Lecture Objectives: 1)Define the terms least significant bit and most significant bit. 2)Explain how unsigned integer numbers are represented in memory.
CSE378 Instr. encoding.1 Instruction encoding The ISA defines –The format of an instruction (syntax) –The meaning of the instruction (semantics) Format.
Lecture 4: MIPS Instruction Set
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.
IFT 201: Unit 1 Lecture 1.3: Processor Architecture-3
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /08/2013 Lecture 10: MIPS Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE CENTRAL STATE.
CHAPTER 6 Instruction Set Architecture 12/7/
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.
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 9 Binary Representation and Logical Operations.
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 7, 8 Instruction Set Architecture.
CS Computer Organization Numbers and Instructions Dr. Stephen P. Carl.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
Computer Architecture & Operations I
CS 230: Computer Organization and Assembly Language
Instruction Set Architecture
Morgan Kaufmann Publishers
MIPS Coding Continued.
Lecture 4: MIPS Instruction Set
ELEN 468 Advanced Logic Design
The University of Adelaide, School of Computer Science
Computer Architecture & Operations I
Super Quick Architecture Review
CS170 Computer Organization and Architecture I
Lecture 4: MIPS Instruction Set
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
MISP Assembly.
CSCI206 - Computer Organization & Programming
The University of Adelaide, School of Computer Science
Systems Architecture Lecture 5: MIPS Instruction Set
Computer Architecture & Operations I
MIPS Instruction Encoding
The University of Adelaide, School of Computer Science
ECE232: Hardware Organization and Design
The University of Adelaide, School of Computer Science
Rocky K. C. Chang 6 November 2017
MIPS Instruction Encoding
Chapter 2 Instructions: Language of the Computer
Instruction encoding The ISA defines Format = Encoding
The University of Adelaide, School of Computer Science
Computer Architecture
Instruction encoding The ISA defines Format = Encoding
COMP541 Datapaths I Montek Singh Mar 18, 2010.
UCSD ECE 111 Prof. Farinaz Koushanfar Fall 2018
Instruction encoding The ISA defines Format = Encoding
MIPS Assembly.
Instruction encoding The ISA defines Format = Encoding
MIPS Coding Continued.
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Presentation transcript:

COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Ryan Florin

Representing Instructions The University of Adelaide, School of Computer Science 11 June 2018 Representing Instructions Instructions are encoded in binary Called machine code MIPS instructions Encoded as 32-bit instruction words Small number of formats encoding operation code (opcode), register numbers, … Regularity! Register numbers $t0 – $t7 are reg’s 8 – 15 $t8 – $t9 are reg’s 24 – 25 $s0 – $s7 are reg’s 16 – 23 §2.5 Representing Instructions in the Computer Chapter 2 — Instructions: Language of the Computer

R-Format and I-Format

MIPS R-format Instructions The University of Adelaide, School of Computer Science 11 June 2018 MIPS R-format Instructions op rs rt rd shamt funct 6 bits 5 bits Instruction fields op: operation code (opcode) rs: first source register number rt: second source register number rd: destination register number shamt: shift amount (00000 for now) funct: function code (extends opcode) Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 11 June 2018 R-format Example op rs rt rd shamt funct 6 bits 5 bits add $t0, $s1, $s2 R-format $s1 $s2 $t0 add 17 18 8 32 000000 10001 10010 01000 00000 100000 000000100011001001000000001000002 = 0232402016 Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 11 June 2018 Example What is: 012a 8020 ? add $s0, $t1, $t2 Chapter 2 — Instructions: Language of the Computer

MIPS I-format Instructions The University of Adelaide, School of Computer Science 11 June 2018 MIPS I-format Instructions op rs rt constant or address 6 bits 5 bits 16 bits Immediate arithmetic and load/store instructions rt: destination register number Constant: –215 to +215 – 1 Address: offset added to base address in rs *** This slide is VERY important *** ** Use this slide to figure which is rs and which is rt ** Chapter 2 — Instructions: Language of the Computer

MIPS I-format Instructions The University of Adelaide, School of Computer Science 11 June 2018 MIPS I-format Instructions Which is rs and which is rt? addi $t5, $s4, 5 lw $t0, 24 ($s0) sw $t1, 16 ($t8) addi $t0, $t1, -191 Chapter 2 — Instructions: Language of the Computer

In Class Exercises Convert the following MIPS instructions into Machine Instructions add $t1, $t2, $t3 addi $t5, $s3, 5 lw $t4, 200($s3)

In Class Exercises (Answers) Convert the following MIPS instructions into Machine Instructions add $t1, $t2, $t3 R-format $t2 $t3 $t1 add 10 11 9 32 000000 01010 01011 01001 00000 100000

In Class Exercises (Answers) Convert the following MIPS instructions into Machine Instructions addi $t5, $s3, 5 I-format $s3 $t5 5 8 19 13 5 001000 10011 01101 0000000000000101

In Class Exercises (Answers) Convert the following MIPS instructions into Machine Instructions lw $t4, 200($s3) I-format $s3 $t4 200 35 19 12 200 100011 10011 01100 0000000011001000

Design Principle 4: Good design demands good compromises Different formats complicate decoding, but allow 32-bit instructions uniformly Keep formats as similar as possible

Stored Program Computers The University of Adelaide, School of Computer Science 11 June 2018 Stored Program Computers Instructions represented in binary, just like data Instructions and data stored in memory Programs can operate on programs e.g., compilers, linkers, … Binary compatibility allows compiled programs to work on different computers Standardized ISAs The BIG Picture Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 11 June 2018 Logical Operations Instructions for bitwise manipulation §2.6 Logical Operations Operation C Java MIPS Shift left << sll Shift right >> >>> srl Bitwise AND & and, andi Bitwise OR | or, ori Bitwise NOT ~ nor Useful for extracting and inserting groups of bits in a word Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 11 June 2018 Shift Operations op rs rt rd shamt funct 6 bits 5 bits shamt: how many positions to shift Shift left logical Shift left and fill with 0 bits sll by i bits multiplies by 2i Shift right logical Shift right and fill with 0 bits srl by i bits divides by 2i (unsigned only) Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 11 June 2018 AND Operations Useful to mask bits in a word Select some bits, clear others to 0 and $t0, $t1, $t2 $t2 0000 0000 0000 0000 0000 1101 1100 0000 $t1 0000 0000 0000 0000 0011 1100 0000 0000 $t0 0000 0000 0000 0000 0000 1100 0000 0000 Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 11 June 2018 OR Operations Useful to include bits in a word Set some bits to 1, leave others unchanged or $t0, $t1, $t2 $t2 0000 0000 0000 0000 0000 1101 1100 0000 $t1 0000 0000 0000 0000 0011 1100 0000 0000 $t0 0000 0000 0000 0000 0011 1101 1100 0000 Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 11 June 2018 NOT Operations Useful to invert bits in a word Change 0 to 1, and 1 to 0 MIPS has NOR 3-operand instruction a NOR b == NOT ( a OR b ) nor $t0, $t1, $zero Register 0: always read as zero $t1 0000 0000 0000 0000 0011 1100 0000 0000 $t0 1111 1111 1111 1111 1100 0011 1111 1111 Chapter 2 — Instructions: Language of the Computer

What I want you to do Review Chapter 2