1 CS 430 Computer Architecture Clap if you like pizza! Pointless Poll.

Slides:



Advertisements
Similar presentations
Solution 2nd Exam.
Advertisements

ECE 15B Computer Organization Spring 2010 Dmitri Strukov Lecture 5: Data Transfer Instructions / Control Flow Instructions Partially adapted from Computer.
Statement Format MIPS assembly language statements have the following format label: opcode operand,operand,operand # comment Label identifies the statement.
1 Nested Procedures Procedures that don't call others are called leaf procedures, procedures that call others are called nested procedures. Problems may.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 08 MIPS Instruction Representation I Lecturer SOE Dan Garcia
1 CS61C L6 Machine Rep Clap if you like pizza! Pointless Poll.
1 CS 430 Computer Architecture Clap if you like pizza! Pointless Poll.
ECE 15B Computer Organization Spring 2010 Dmitri Strukov Lecture 4: Arithmetic / Data Transfer Instructions Partially adapted from Computer Organization.
ECE 15B Computer Organization Spring 2010 Dmitri Strukov Lecture 7: Procedures I Partially adapted from Computer Organization and Design, 4 th edition,
MIPS Assembler Programming
ECE 15B Computer Organization Spring 2010 Dmitri Strukov Lecture 6: Logic/Shift Instructions Partially adapted from Computer Organization and Design, 4.
Instruction Representation I (1) Fall 2005 Lecture 05: INSTRUCTION REPRESENTATION.
MIPS on FLEET Amir Kamil. Goals Run most MIPS assembly code on FLEET  Attempt to duplicate level of support in SPIM interpreter  MIPS assembly translated.
CS61C L11 Introduction to MIPS : Procedures I (1) Garcia, Fall 2006 © UCB Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
Lecture 5: Procedures. Function call book-keeping in C main() { int i,j,k,m;... i = mult(j,k);... m = mult(i,i);... } /* really dumb mult function */
VHDL Synthesis of a MIPS-32 Processor Bryan Allen Dave Chandler Nate Ransom.
9/29: Lecture Topics Memory –Addressing (naming) –Address space sizing Data transfer instructions –load/store on arrays on arrays with variable indices.
Arithmetic for Computers
IT253: Computer Organization Lecture 5: Assembly Language and an Introduction to MIPS Tonga Institute of Higher Education.
Computer Organization and Design Instruction Sets Montek Singh Wed, Sep 12, 2012 Lecture 5.
Lec 13Systems Architecture1 Systems Architecture Lecture 13: Integer Multiplication and Division Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan.
FAMU-FSU College of Engineering 1 Computer Architecture EEL 4713/5764, Spring 2006 Dr. Michael Frank Module #7 – MIPS ISA, part 2: Procedures and Data.
IT 251 Computer Organization and Architecture More MIPS Control Instructions Chia-Chi Teng.
Chapter 10 The Assembly Process. What Assemblers Do Translates assembly language into machine code. Assigns addresses to all symbolic labels (variables.
Procedure (Method) Calls Ellen Spertus MCS 111 September 25, 2003.
Informationsteknologi Friday, September 28, 2007Computer Architecture I - Class 21 Today’s class More assembly language programming.
True Assembly Language Part I. The Assembly Process The process of translating a MAL code (an assembly language program) into machine code (a sequence.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 07 Introduction to MIPS : Decisions II Guest Lecturer Alan Christopher.
CENG 311 Instruction Representation
1 CS61C L6 Machine Rep CENG 311 Procedure Conventions & The Stack.
MIPS Assembly Language Chapter 13 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer,
EEL5708/Bölöni Lec 3.1 Fall 2006 Sept 1, 2006 Lotzi Bölöni EEL 5708 High Performance Computer Architecture Lecture 3 Review: Instruction Sets.
Integer Multiplication, Division Arithmetic shift Twice the number of places MIPS multiply unit. mult, multu Significant bits Mfhi, mflo, div, divu Arithmetic.
CMPUT Computer Organization and Architecture I1 CMPUT229 - Fall 2003 Topic6: Logic, Multiply and Divide Operations José Nelson Amaral.
MIPS Assembly Language Chapter 15 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer, 2003.
CDA 3101 Spring 2016 Introduction to Computer Organization
MIPS Instruction Set Architecture Prof. Sirer CS 316 Cornell University.
COMPUTER ORGANIZATION ARITHMETIC YASSER MOHAMMAD.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 08 MIPS Instruction Representation I Guest Lecturer Alan Christopher
Instructor: Prof. Hany H Ammar, LCSEE, WVU
MIPS Programming.
Integer Multiplication, Division Arithmetic shift
Rocky K. C. Chang Version 0.1, 25 September 2017
CSCI206 - Computer Organization & Programming
Prof. Hsien-Hsin Sean Lee
CS2100 Computer Organisation
Integer Multiplication and Division
Computer Organization and Design Instruction Sets - 2
Chapter Three : Arithmetic for Computers
CS 314 Computer Organization Fall Chapter 3: Arithmetic for Computers
Instructions: Language of the Computer
Computer Organization and Design Instruction Sets - 2
32-bit MIPS ISA.
CDA 3101 Summer 2007 Introduction to Computer Organization
ENGR 3410 – Computer Architecture Mark L. Chang Fall 2006
Computer Organization and Design Instruction Sets
CSCI206 - Computer Organization & Programming
Instructions - Type and Format
“so many gadgets, so many aches” - NYT
Systems Architecture I
ECE232: Hardware Organization and Design
There is one handout today at the front and back of the room!
Part II Instruction-Set Architecture
Flow of Control -- Conditional branch instructions
MIPS Instruction Set Architecture
Flow of Control -- Conditional branch instructions
CS352H Computer Systems Architecture
Reduced Instruction Set Computer (RISC)
Pointless Poll Clap if you like pizza!.
9/27: Lecture Topics Memory Data transfer instructions
Presentation transcript:

1 CS 430 Computer Architecture Clap if you like pizza! Pointless Poll

2 CS 430 Computer Architecture CS430 – Computer Architecture More Operations William J. Taffe using slides by David Oppenheimer & Steve Tu

3 CS 430 Computer Architecture Instructions Potpourri 9 new instructions in 9 minutes! Multiplication and Division: mult, multu, div, divu, mfhi, mflo Accessing Individual Bytes Instead of Words: lb, lbu, sb

4 CS 430 Computer Architecture Hi Lo X $t $t1 Multiplication mult $t1, $t2 # t1 * t2 No dest register: Product could be ~2^64; need two special registers to hold it 3-step process $t $t4mflo $t4 mfhi $t3

5 CS 430 Computer Architecture Division div $t1, $t2 # t1 / t2 Quotient stored in Lo Bonus prize: Remainder stored in Hi mflo $t3 #copy quotient to t3 mfhi $t4 #copy remainder to t4 3-step process

6 CS 430 Computer Architecture Unsigned Multiplication and Division multu $t1, $t2 # t1 * t2 divu $t1, $t2 # t1 / t2 Just like mult, div, except now interpret t1, t2 as unsigned integers instead of signed Answers are also unsigned, use mfhi, mflo to access

7 CS 430 Computer Architecture Data Types in MAL What if t1, t2 are signed ints, and you try to do multu, divu? a) Segmentation fault? b) Bus error? c) Green gecko? NO! None of the above! BIG IDEA: registers contain TYPELESS, MEANINGLESS BIT PATTERNS! Signed/unsigned/char/color is determined by instruction or operation

8 CS 430 Computer Architecture Load byte, store byte lb $t0, 0($t1) ‘s’‘o’‘d’‘a’‘\0’‘y’‘e’‘h’ ‘o’ sb $t0, 0($t2) t1 t2t0 ‘o’ Similar to lw, sw, except bytes instead of words ‘o’

9 CS 430 Computer Architecture Load byte unsigned lb $t1, 0($t0) F7Sign-extended lbu $t2, 0($t0) F7 t0 t1 t2 F7F012…… F7 FFFFFF Zero-extended

10 CS 430 Computer Architecture Big Ideas Follow the procedure conventions and nobody gets hurt. Data is just 1’s and 0’s, what it represents depends on what you do with it M’Piero has returned to find Prof. Patterson, if he still lives!

11 CS 430 Computer Architecture Summary of Instructions & Registers Registers we know so far $0, $at, $ra, $v_, $a_, $t_, $s_, $gp, $sp Instructions we know so far Arithmetic: add, addu, addi, addiu, sub, subu, mult, multu, div, divu, mflo, mfhi Memory: lw, sw, lb, lbu, sb Decision/Comparison: beq, bne, slt, sltu, slti, sltiu Unconditional Branches (Jumps): j, jal, jr