CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.

Slides:



Advertisements
Similar presentations
MIPS Assembly Tutorial
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.
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
Lecture 5: MIPS Instruction Set
CS/COE0447 Computer Organization & Assembly Language
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.
10/9: Lecture Topics Starting a Program Exercise 3.2 from H+P Review of Assembly Language RISC vs. CISC.
ELEN 468 Advanced Logic Design
Chapter 2 Instructions: Language of the Computer
Datorteknik DatapathControl bild 1 Designing a Single Cycle Datapath & Datapath Control.
Chapter 2 Instructions: Language of the Computer Part III.
CS2100 Computer Organisation MIPS Part III: Instruction Formats (AY2014/2015) Semester 2.
Comp Sci instruction encoding 1 Instruction Encoding MIPS machine language Binary encoding of instructions MIPS instruction = 32 bits Three instruction.
Instructions Set Bo Cheng Instruction Set Design An Instruction Set provides a functional description of a processor. It is the visible.
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 4436ECE 5367 ISA I. ECE 4436ECE 5367 CPU = Seconds= Instructions x Cycles x Seconds Time Program Program Instruction Cycle CPU = Seconds= Instructions.
MIPS Instruction Set Advantages
Lecture Objectives: 1)Define the terms least significant bit and most significant bit. 2)Explain how unsigned integer numbers are represented in memory.
CSE331 W02.1Irwin Fall 2001 PSU Computer Architecture Discussion Lecture # 2 MIPS Programming.
April 23, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Assemblers, Linkers, and Loaders * Jeremy R. Johnson Mon. April 23,
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 Organization & Programming Chapter 6 Single Datapath CPU Architecture.
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/
Computer Architecture CSE 3322 Lecture 3 Assignment: 2.4.1, 2.4.4, 2.6.1, , Due 2/3/09 Read 2.8.
MS108 Computer System I Lecture 3 ISA Prof. Xiaoyao Liang 2015/3/13 1.
Computer Organization Rabie A. Ramadan Lecture 3.
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.
CHAPTER 2 Instruction Set Architecture 3/21/
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
MIPS Instruction Set Advantages
COMPUTER ARCHITECTURE & OPERATIONS I
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
Control Path Catholic University PUCRS.
MIPS coding.
Lecture 4: MIPS Instruction Set
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
The University of Adelaide, School of Computer Science
Computer Architecture & Operations I
MIPS Instruction Encoding
Datapath & Control MIPS
MIPS Instruction Encoding
Instruction encoding The ISA defines Format = Encoding
Computer Architecture
Instruction encoding The ISA defines Format = Encoding
COMP541 Datapaths I Montek Singh Mar 18, 2010.
COMS 361 Computer Organization
COMS 361 Computer Organization
Instruction encoding The ISA defines Format = Encoding
Instruction encoding The ISA defines Format = Encoding
MIPS Coding Continued.
MIPS coding.
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Presentation transcript:

CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions

Homework 3 Questions????

The lw and sw instructions lw r1, offset(r2) Load register r1 with the memory word at the location determined by adding the contents of r2 to the offset lw $r1,8($r2) The "sw" instruction moves data from register to memory: sw r1, offset(r2)

Byte Addressable Memories In a MIPS, each word is divided into 4 bytes. Each byte has its own address. Words MUST be aligned: that is, the lower 2 bits must be 00. Remember that memory is just a BIG array – we need to partition this specific program level structures.

Constants Constants come from two places: * The memory: values that are "pre-loaded" when the program starts and available as needed. * The instruction stream: small constants can be embedded directly into instructions

The "addi" instruction addi r1, r2, c Here, "c" is a constant that is added to r2 r1 = r2 + c The range of the constant is determined by the instruction format. Note that "lw" and "sw" also used constants embedded in the instruction.

Encoding MIPS Instructions Registers (32): 5 bits op (6) rs (5) rt (5) rd (5) shamt (5) funct (6) Op Code add, sub Shift Amount (not used yet) Function code

Encoding MIPS Instructions Registers (32): 5 bits op (6) rs (5) rt (5) Constant (16) Op Code: addi, lw, sw

Digression: 2's Complement How do we represent negative numbers? To negate: complement and add 1 So: -1 = (all 1's) Let's look at some examples

Getting the Binary We need to understand the encoding of each field to determine the overall instruction encoding. The register encoding is given in the book Op codes are usually given in a table Constants are binary numbers