Floating Point Numbers. CMPE12cCyrus Bazeghi 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or 2 64.

Slides:



Advertisements
Similar presentations
Spring 2013 Advising Starts this week! CS2710 Computer Organization1.
Advertisements

Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Topics covered: Floating point arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Lecture 16: Computer Arithmetic Today’s topic –Floating point numbers –IEEE 754 representations –FP arithmetic Reminder –HW 4 due Monday 1.
Floating Point (FLP) Representation A Floating Point value: f = m*r**e Where: m – mantissa or fractional r – base or radix, usually r = 2 e - exponent.
Floating Point Numbers
1 IEEE Floating Point Revision Guide for Phase Test Week 5.
CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (2)
Floating Point Numbers
Floating Point Numbers. CMPE12cGabriel Hugh Elkaim 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or.
Booth’s Algorithm.
CMPE12cCyrus Bazeghi 1 What do floating-point numbers represent? Rational numbers with non-repeating expansions in the given base within the specified.
Chapter 5 Floating Point Numbers. Real Numbers l Floating point representation is used whenever the number to be represented is outside the range of integer.
1 Lecture 3 Bit Operations Floating Point – 32 bits or 64 bits 1.
Floating Point Numbers
1 Module 2: Floating-Point Representation. 2 Floating Point Numbers ■ Significant x base exponent ■ Example:
Floating Point Numbers
Computer ArchitectureFall 2008 © August 27, CS 447 – Computer Architecture Lecture 4 Computer Arithmetic (2)
Computer Science 210 Computer Organization Floating Point Representation.
The IEEE Format for storing float (single precision) data type Use the “enter” key to proceed through the show.
Lecture 8 Floating point format
Binary Number Systems.
School of Computer Science G51CSA 1 Computer Arithmetic.
Binary Representation and Computer Arithmetic
The Binary Number System
Simple Data Type Representation and conversion of numbers
Ch. 2 Floating Point Numbers
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
Information Representation (Level ISA3) Floating point numbers.
Computer Arithmetic Nizamettin AYDIN
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Negative and Floating Point.
Data Representation - Part II. Characters A variable may not be a non-numerical type Character is the most common non- numerical type in a programming.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
S. Rawat I.I.T. Kanpur. Floating-point representation IEEE numbers are stored using a kind of scientific notation. ± mantissa * 2 exponent We can represent.
Binary Fractions. Fractions A radix separates the integer part from the fraction part of a number Columns to the right of the radix have negative.
Fixed and Floating Point Numbers Lesson 3 Ioan Despi.
CSC 221 Computer Organization and Assembly Language
ITEC 1011 Introduction to Information Technologies 4. Floating Point Numbers Chapt. 5.
Integer & Floating Point Representations CDA 3101 Discussion Session 05.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Floating Point Representation.
COMP201 Computer Systems Floating Point Numbers. Floating Point Numbers  Representations considered so far have a limited range dependent on the number.
1 Number Systems Lecture 10 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: November 08, 2004 Lecture Number: 30.
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Floating Point in Binary 1.Place Value Chart:
Data Representation: Floating Point for Real Numbers Computer Organization and Assembly Language: Module 11.
Lecture 6: Floating Point Number Representation Information Representation: Floating Point Number Representation Lecture # 7.
Fixed-point and floating-point numbers Ellen Spertus MCS 111 October 4, 2001.
Floating Point Numbers
Fundamentals of Computer Science
Binary Fractions.
Introduction To Computer Science
Floating Point Representations
Lecture 9: Floating Point
Floating Point Number system corresponding to the decimal notation
Topic 3d Representation of Real Numbers
Luddy Harrison CS433G Spring 2007
Number Representations
(Part 3-Floating Point Arithmetic)
Cosc 2P12 Week 2.
COMS 161 Introduction to Computing
Topic 3d Representation of Real Numbers
Numbers with fractions Could be done in pure binary
Cosc 2P12 Week 2.
Number Representations
Presentation transcript:

Floating Point Numbers

CMPE12cCyrus Bazeghi 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or 2 64 numbers to be represented. Which reals to represent? There are an infinite number between 2 adjacent integers. (or two reals!!) Which bit patterns for reals selected? Answer: use scientific notation

CMPE12cCyrus Bazeghi 3 ABA x 10 B 0any Consider: A x 10 B, where A is one digit How to do scientific notation in binary? Standard: IEEE 754 Floating-Point Floating Point Numbers

CMPE12cCyrus Bazeghi 4 IEEE 754 Single Precision Floating Point Format Representation: SEF S is one bit representing the sign of the number E is an 8 bit biased integer representing the exponent F is an unsigned integer The true value represented is:(-1) S x f x 2 e S = sign bit e = E – bias f = F/2 n + 1 for single precision numbers n=23, bias=127

CMPE12cCyrus Bazeghi 5 S, E, F all represent fields within a representation. Each is just a bunch of bits. S is the sign bit (-1) S  (-1) 0 = +1 and (-1) 1 = -1 Just a sign bit for signed magnitude E is the exponent field The E field is a biased-127 representation. True exponent is (E – bias) The base (radix) is always 2 (implied). Some early machines used radix 4 or 16 (IBM) IEEE 754 Single Precision Floating Point Format

CMPE12cCyrus Bazeghi 6 F (or M) is the fractional or mantissa field. It is in a strange form. There are 23 bits for F. A normalized FP number always has a leading 1. No need to store the one, just assume it. This MSB is called the HIDDEN BIT. IEEE 754 Single Precision Floating Point Format

CMPE12cCyrus Bazeghi 7 How to convert 64.2 into IEEE SP 1.Get a binary representation for 64.2 Binary of left of radix pointis: Binary of right of radix.2 x 2 = x 2 = x 2 = x 2 = 1.21 Binary for.2: 64.2 is: 2.Normalize binary form Produces:

CMPE12cCyrus Bazeghi 8 Floating Point Since floating point numbers are always stored in normal form, how do we represent 0? 0x and 0x represent 0. What numbers cannot be represented because of this? 3. Turn true exponent into bias Put it together: 23-bit F is: S E F is: In hex:

CMPE12cCyrus Bazeghi 9 IEEE Floating Point Format Other special values: + 5 / 0 = + + = … (0x7f ) -7/0 = - - = … (0xff ) 0/0 or = NaN (Not a number) NaN ? ?????… (S is either 0 or 1, E=0xff, and F is anything but all zeroes) Also de-normalized numbers (beyond scope)

CMPE12cCyrus Bazeghi 10 IEEE Floating Point What is the decimal value for this SP FP number 0x ?

CMPE12cCyrus Bazeghi 11 IEEE Floating Point What is in SP FP format?