MIPS floating point instructions

Slides:



Advertisements
Similar presentations
Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
Advertisements

Introduction to SPIM Simulator
– © Yohai Devir 2007 Technion - IIT Tutorial #10 MIPS commands.
Spring 2013 Advising Starts this week! CS2710 Computer Organization1.
MIPS Assembly Language CPSC 321 Computer Architecture Andreas Klappenecker.
Comp Sci Floating Point Arithmetic 1 Ch. 10 Floating Point Unit.
Computer Organization CS224 Fall 2012 Lesson 19. Floating-Point Example  What number is represented by the single-precision float …00 
05/03/2009CA&O Lecture 8,9,10 By Engr. Umbreen sabir1 Computer Arithmetic Computer Engineering Department.
Arithmetic in Computers Chapter 4 Arithmetic in Computers2 Outline Data representation integers Unsigned integers Signed integers Floating-points.
SPIM and MIPS programming
MIPS Function Continued
Lecture 16: Computer Arithmetic Today’s topic –Floating point numbers –IEEE 754 representations –FP arithmetic Reminder –HW 4 due Monday 1.
Microprocessors The MIPS Architecture (Floating Point Instruction Set) Mar 26th, 2002.
1 Lecture 9: Floating Point Today’s topics:  Division  IEEE 754 representations  FP arithmetic Reminder: assignment 4 will be posted later today.
1 Lecture 10: FP, Performance Metrics Today’s topics:  IEEE 754 representations  FP arithmetic  Evaluating a system Reminder: assignment 4 due in a.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Ellen Spertus MCS 111 October 11, 2001 Floating Point Arithmetic.
COSC 2021: Computer Organization Instructor: Dr. Amir Asif Department of Computer Science York University Handout # 5 Unsigned integer and floating point.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /14/2013 Lecture 16: Floating Point Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE.
Registers and MAL Lecture 12. The MAL Architecture MAL is a load/store architecture. MAL supports only those addressing modes supported by the MIPS RISC.
MIPS I/O and Interrupt. .data val1:.float 0.6 val2:.float 0.8 msg_done:.asciiz "done\n".text.globl main main: li.s $f0, mfc1 $a0, $f0 jal calsqrt.
Lecture 9: Floating Point
1 Compilers Modern Compiler Design Supplementary Note 2 SPIM Overview NCYU C. H. Wang.
In Class Execise. .data A:.word 0,1,2,3,4,5,6,7,8,9.text.globl main main: la $a0,A li $a1,6 li $a2,5 jal onUpStream done: li $v0, 10# exit syscall onUpStream:
Fall EE 333 Lillevik 333f06-l5 University of Portland School of Engineering Computer Organization Lecture 5 MIPS Instructions Loops Machine Instructions.
1 Lecture 10: Floating Point, Digital Design Today’s topics:  FP arithmetic  Intro to Boolean functions.
MIPS mul div, and MIPS floating point instructions.
Rounding Modes 3 Rounding: the process to obtain the best possible floating-point representation for a given real value. ANSI/IEEE standard:
Computer Organization Rabie A. Ramadan Lecture 3.
Pseudo instructions. MIPS supports pseudo instructions. We have seen some like – li $t0, 4 which set $t0 to 4. – la $t0, A which puts the address of label.
Floating Point Processor Condition Bit The MIPS Floating Point Accelerator (FPA) chip (now, usually part of the processor chip) has a condition bit that.
10/7/2004Comp 120 Fall October 7 Read 5.1 through 5.3 Register! Questions? Chapter 4 – Floating Point.
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
Review. Interger Number Representations To convert an unsigned decimal number to binary: you divide the number N by 2, let the remainder be the first.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
CS 312 Computer Architecture & Organization
MIPS Programming.
System Calls & Arithmetic
Overview of Instruction Set Architectures
Morgan Kaufmann Publishers Arithmetic for Computers
Computer Architecture & Operations I
CS 286 Computer Architecture & Organization
1. Introduction A microprocessor executes instructions given by the user Instructions should be in a language known to the microprocessor Microprocessor.
Pseudo instructions.
Lecture 10: Floating Point, Digital Design
Assembly Programming using MIPS R3000 CPU
Floating Point ICS 233 Computer Architecture & Assembly Language
MIPS I/O and Interrupt.
Final Review.
SPIM Syscalls.
Chapter 11 © 2011, The McGraw-Hill Companies, Inc.
Review.
Floating Point Arithmetic
Pseudo instructions.
Review.
Programmer’s View of the EAGLE
Review.
October 17 Chapter 4 – Floating Point Read 5.1 through 5.3 1/16/2019
MIPS Assembly.
Floating Point Arithmetic
Floating Point Arithmetic
Branching instructions
Assembly Programming using MIPS R3000 CPU
MIPS Assembly.
Floating Point Arithmetic
CNET 315 Microprocessor & Assembly Language
Floating Point Faculty of Information Technology University of Petra
Introduction to the ARM Instruction Set. Data Processing Instructions Move Instructions Syntax: { }{S} Rd, N.
CS 286 Computer Architecture & Organization
MIPS Assembly.
Presentation transcript:

MIPS floating point instructions

Load and Store Load or store from a memory location (pseudoinstruction ). Just load the 32 bits into the register. l.s $f0, val s.s $f0, val Load immediate number (pseudoinstruction ) li.s $f0, 0.5

Print and load Print: Read li $v0, 2 li $f12, 0.5 syscall li $v0, 6 (the read will be in $f0)

Arithmetic Instructions abs.s $f0, $f1 add.s $f0, $f1, $f2 sub.s $f0, $f1, $f2 mul.s $f0, $f1, $f2 div.s $f0, $f1, $f2 neg.s $f0, $f1

Data move mov.s $f0, $f1 mfc1 $t0, $f0 mtc1 $t0, $f0

Convert to integer and from integer cvt.s.w $f0, $f0 # convert the 32 bit in $f0 currently representing an integer to float of the same value cvt.w.s $f0, $f0 # the reverse

Comparison instructions c.lt.s $f0,$f1 #set a flag in coprocessor 1if $f0 < $f1, else clear it. The flag will stay until set or cleared next time c.le.s $f0,$f1 #set flag if $f0 <= $f1, else clear it bc1t L1 # branch to L1 if the flag is set bc1f L1 # branch to L1 if the flag is 0 Where does the bc1t instruction take place? The main processor or the coprocessor?

Computing the square root of a number n The Newton’s method x’=(x+n/x)/2 The code we used in the class is: http://www.cs.fsu.edu/~zzhang/CDA3100_Spring_2009_files/float2.asm