CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Winter 2004 Lecture 9.

Slides:



Advertisements
Similar presentations
Fixed Point Numbers The binary integer arithmetic you are used to is known by the more general term of Fixed Point arithmetic. Fixed Point means that we.
Advertisements

CSCE 212 Chapter 3: Arithmetic for Computers Instructor: Jason D. Bakos.
Fabián E. Bustamante, Spring 2007 Floating point Today IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Next time.
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Carnegie Mellon Instructors: Dave O’Hallaron, Greg Ganger, and Greg Kesden Floating Point : Introduction to Computer Systems 4 th Lecture, Sep 6,
1 Binghamton University Floating Point CS220 Computer Systems II 3rd Lecture.
Carnegie Mellon Instructors: Randy Bryant & Dave O’Hallaron Floating Point : Introduction to Computer Systems 3 rd Lecture, Aug. 31, 2010.
Floating Point in computers Comply with standards: IEEE 754 ISO/IEC 559.
Datorteknik FloatingPoint bild 1 Floating point Number system corresponding to the decimal notation 1,837 * 10 significand exponent a great number of corresponding.
Representing fractions – Fixed point The problem: How to represent fractions with finite number of bits ?
University of Washington Today Topics: Floating Point Background: Fractional binary numbers IEEE floating point standard: Definition Example and properties.
1 Lecture 9: Floating Point Today’s topics:  Division  IEEE 754 representations  FP arithmetic Reminder: assignment 4 will be posted later today.
1 CSE1301 Computer Programming Lecture 30: Real Number Representation.
CSE1301 Computer Programming Lecture 33: Real Number Representation
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Winter 2004 Lecture 10 Thursday 02/19/02.
Integer Arithmetic Floating Point Representation Floating Point Arithmetic Topics.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Fall 2006 Lecture 10 Floating Point Number Rounding, Polynomial.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Fall 2006 Lecture 9: Floating Point Numbers.
CSE 378 Floating-point1 How to represent real numbers In decimal scientific notation –sign –fraction –base (i.e., 10) to some power Most of the time, usual.
Copyright 2008 Koren ECE666/Koren Part.4c.1 Israel Koren Spring 2008 UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Digital Computer.
FLOATING POINT COMPUTER ARCHITECTURE AND ORGANIZATION.
Computer Organization and Architecture Computer Arithmetic Chapter 9.
Fixed-Point Arithmetics: Part II
ECE232: Hardware Organization and Design
Floating Point Numbers Topics –IEEE Floating Point Standard –Rounding –Floating Point Operations –Mathematical properties.
Computer Arithmetic II Instructor: Mozafar Bag-Mohammadi Spring 2006 University of Ilam.
Instructor: Andrew Case Floating Point Slides adapted from Randy Bryant & Dave O’Hallaron.
Carnegie Mellon Instructors: Greg Ganger, Greg Kesden, and Dave O’Hallaron Floating Point : Introduction to Computer Systems 4 th Lecture, Sep 4,
Bryant and O’Hallaron, Computer Systems: A Programmer’s Perspective, Third Edition Carnegie Mellon Instructor: San Skulrattanakulchai Floating Point MCS-284:
Lecture 9: Floating Point
1 Floating Point Operations - Part II. Multiplication Do unsigned multiplication on the mantissas including the hidden bits Do unsigned multiplication.
Computer Arithmetic Floating Point. We need a way to represent –numbers with fractions, e.g., –very small numbers, e.g., –very large.
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Floating Point Numbers Representation, Operations, and Accuracy CS223 Digital Design.
Carnegie Mellon Instructors: Randy Bryant, Dave O’Hallaron, and Greg Kesden Floating Point : Introduction to Computer Systems 4 th Lecture, Sep 5,
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
Number Representation Fixed and Floating Point
Floating Point Carnegie Mellon /18-243: Introduction to Computer Systems 4 th Lecture, 26 May 2011 Instructors: Gregory Kesden.
Lecture 4 IEEE 754 Floating Point Topics IEEE 754 standard Tiny float January 25, 2016 CSCE 212 Computer Architecture.
Floating Point CSE 238/2038/2138: Systems Programming
Floating Point Borrowed from the Carnegie Mellon (Thanks, guys!)
Floating Point Numbers
Part III The Arithmetic/Logic Unit
2.4. Floating Point Numbers
Integer Division.
Lecture 9: Floating Point
Topics IEEE Floating Point Standard Rounding Floating Point Operations
Floating Point Number system corresponding to the decimal notation
CS 232: Computer Architecture II
IEEE floating point format
CS 367 Floating Point Topics (Ch 2.4) IEEE Floating Point Standard
PRESENTED BY J.SARAVANAN. Introduction: Objective: To provide hardware support for floating point arithmetic. To understand how to represent floating.
Arithmetic for Computers
ECE/CS 552: Floating Point
Number Representations
CSCI206 - Computer Organization & Programming
CS 105 “Tour of the Black Holes of Computing!”
How to represent real numbers
Floating Point Arithmetic August 31, 2009
CS 105 “Tour of the Black Holes of Computing!”
Faculty of Cybernetics, Statistics and Economic Informatics –
UNIVERSITY OF MASSACHUSETTS Dept
UNIVERSITY OF MASSACHUSETTS Dept
UNIVERSITY OF MASSACHUSETTS Dept
UNIVERSITY OF MASSACHUSETTS Dept
CS 105 “Tour of the Black Holes of Computing!”
Number Representations
CSE 140: Computer Arithmetic Algorithms and Hardware Design
CSE140 Final Review Xinyuan Wang 06/06/2019.
Presentation transcript:

CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Winter 2004 Lecture 9

CSE 2462 Topics:  Floating Point Numbers (IEEE P754)  Standard  Operations  Exceptional Situations  Rounding Modes

CSE 2463 Standard 2 32  Typically  Goal: Dynamic Range: largest #/ smallest #  If too large, holes between # ’ s

CSE 2464 Standard  ulp (unit in the last place)  Difference between two consecutive values of the significand. 3 Parts  x =  s  b e Sign Bit 8-bit exponent Significand

CSE 2465 Standard   a 1 a 2 a 3 a 4 a 5 a 6 a 7 a 8 b 1 b 2 b 3  b 22 b 23 1.* normalized number 0.* denormalized number 0 0.b 1 b 2 b 3  b 22 b 23  b 1 b 2 b 3  b 22 b 23  b 1 b 2 b 3  b 22 b 23    if b i = 0 for all i = 1,2, …,23, NaN otherwise NaN  Not a Number

CSE 2466 Standard 0.01x2 -3 = 0.00x2 -2  Same number, so normalize to remove redundancy  Smallest Number 0.00 … 01x = 1.0x2 -23 x = 1x   Difference between 2 # ’ s small for normalized times compared to magnitudes

CSE 2467 Standard - Example s. eeeeeeee nnnnnnnnnnnnnnnnnnnnnnn = … 0x = = … 0x minimal normalized # = … 1x = … 1x = … 0x2 1

CSE 2468 Standard – Example Cont = … 1x = … 1x Normalized Maximum =  N min = 1.0 x N max = (2 – )2 127

CSE 2469 Double Floating Point  a 1 a 2 … a 11 b 1 b 2 … b … b 1 b 2 … b 52 x … b 1 b 2 … b 52 x … b 1 b 2 … b 52 x … b 1 b 2 … b 52 x … b 1 b 2 … b 52 x … 11 =  if b i = 0 for all i = 1,2, …,52

CSE Overflow/Underflow N max N min SparserDenser Overflow Underflow

CSE Addition/Multiplication  s 1 xb e1 + (  s 2 xb e2 ) =  sxb e =  s 1 xb e1 +  s 2 /b e1-e2 x b e1 = (  s 1  s 2 /b e1-e2 ) x b e1  (  s 1 xb e1 ) x (  s 2 xb e2 ) =  (s 1 xs 2 )b e1+e2

CSE Exceptions a/0 =  if a > 0 a/  = 0if a != 0 a · 0 = 0 a ·  =  if a > 0 0 ·  = invalid operation (NaN) 0/0 = invalid operation (NaN) NaP op a = NaN a +  =   -  = NaN

CSE Rounding Mode  Adder Output = Cout z 1 z 0.z -1 z -2 … z - l GRS Guard Bit Round Bit Sticky Bit, OR of all bits below bit R x x x x2 4 Normalize – need to round or

CSE Rouding x x x x 2 0 normalize x x x x x x 2 2 Guard bit

CSE Rounding  Round to the nearest even toward Toward +  Toward - 

CSE Conventional Rounding Error Rounding Error  1.101=  1.101=  =  = Average Error = 0.5/4 = 0.125