4. Floating Point Numbers. Exponential Notation The representations differ in that the decimal place – the “point” -- “floats” to the left or right (with.

Slides:



Advertisements
Similar presentations
© 2005 Microchip Technology Incorporated. All Rights Reserved. Slide 1 NUM 1019 Numerical Methods on the PIC Micro.
Advertisements

MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
1 Floating Point Representation and Arithmetic (see Patterson Chapter 4)
Monika Gope Lecturer IICT, KUET
Binary Values and Number Systems
Fixed-point and floating-point numbers CS370 Fall 2003.
COMP3221 lec19-fp-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 19 : Floating Point Number Representation – I
Properties of Exponents
Nat 4/5 Computing Science Lesson 1: Binary
Binary Lesson 3 Hexadecimal. Counting to 15 Base Base Base 16 Base Base Base 16 Two Ten (Hex) Two Ten (Hex)
The Radical Square Root
14-1 Bard, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 14: Gaming Engines, Coding Style, Floating Point.
COMP2130 Winter 2015 Storing signed numbers in memory.
1 IEEE Floating Point Revision Guide for Phase Test Week 5.
CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (2)
Floating Point Numbers. CMPE12cGabriel Hugh Elkaim 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or.
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.
1 Lecture 3 Bit Operations Floating Point – 32 bits or 64 bits 1.
Floating Point Numbers
Representing Real Numbers Using Floating Point Notation Lecture 6 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
Floating Point Numbers
Computer Science 210 Computer Organization Floating Point Representation.
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
The IEEE Format for storing float (single precision) data type Use the “enter” key to proceed through the show.
Binary Number Systems.
School of Computer Science G51CSA 1 Computer Arithmetic.
The Binary Number System
Simple Data Type Representation and conversion of numbers
1 Lecture 5 Floating Point Numbers ITEC 1000 “Introduction to Information Technology”
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Negative and Floating Point.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
Floating Point (a brief look) We need a way to represent –numbers with fractions, e.g., –very small numbers, e.g., –very large numbers,
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.
CSC 221 Computer Organization and Assembly Language
ITEC 1011 Introduction to Information Technologies 4. Floating Point Numbers Chapt. 5.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Floating Point Representation.
Number Representation for
CSPP58001 Floating Point Numbers. CSPP58001 Floating vs. fixed point Floating point refers to a binary decimal representation where there is not a fixed.
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.
Floating Point Numbers
SCIENTIFIC NOTATION Expressing a quantity as: a number between 1 and 10 multiplied by 10 to the appropriate power.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.7 Instructor: Lin Chen Sept 2013.
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.
Learning Objectives 3.3.1f - Describe the nature and uses of floating point form 3.3.1h - Convert a real number to floating point form Learn how to normalise.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
FLOATING-POINT NUMBER REPRESENTATION
Floating Point Numbers
Introduction to Numerical Analysis I
Fundamentals of Computer Science
Data Representation Covering… Binary addition / subtraction
Binary Fractions.
Computer Science 210 Computer Organization
Introduction To Computer Science
Floating Point Representations
ECE 103 Engineering Programming Chapter 3 Numbers
CSCI206 - Computer Organization & Programming
Computer Science 210 Computer Organization
Storing Integers and Fractions
Representation of real numbers
Normalised Floating Point Numbers
COMS 161 Introduction to Computing
Numbers with fractions Could be done in pure binary
39 32 Exponent Sign 31 Mantissa 30 Operations are perfomred with an implied binary point between bits 31 and 30. When the implied most significant.
Presentation transcript:

4. Floating Point Numbers

Exponential Notation The representations differ in that the decimal place – the “point” -- “floats” to the left or right (with the appropriate adjustment in the exponent). p. 122 The following are equivalent representations of 1, ,400.0 x ,340.0 x ,234.0 x x x x x 10 4

Parts of a Floating Point Number x p. 123 Sign of mantissa Location of decimal point Mantissa Exponent Sign of exponent Base

IEEE 754 Standard Most common standard for representing floating point numbers Single precision: 32 bits, consisting of... Sign bit (1 bit) Exponent (8 bits) Mantissa (23 bits) Double precision: 64 bits, consisting of… Sign bit (1 bit) Exponent (11 bits) Mantissa (52 bits) p. 133

Single Precision Format 32 bits Mantissa (23 bits) Exponent (8 bits) Sign of mantissa (1 bit)

Normalization The mantissa is normalized Has an implied decimal place on left Has an implied “1” on left of the decimal place E.g., Mantissa  Represents… =

Excess Notation To include +ve and –ve exponents, “excess” notation is used Single precision: excess 127 Double precision: excess 1023 The value of the exponent stored is larger than the actual exponent E.g., excess 127, Exponent  Represents… – 127 = 8

Example Single precision – 127 = 3 0 = positive mantissa x 2 3 = =

Hexadecimal It is convenient and common to represent the original floating point number in hexadecimal The preceding example…

Converting from Floating Point E.g., What decimal value is represented by the following 32-bit floating point number? C17B

Step 1 Express in binary and find S, E, and M C17B = SEM 1 = negative 0 = positive

Step 2 Find “real” exponent, n n= E – 127 = – 127 = 130 – 127 = 3

Step 3 Put S, M, and n together to form binary result (Don’t forget the implied “1.” on the left of the mantissa.) x 2 n = x 2 3 =

Step 4 Express result in decimal = = = Answer:

Converting to Floating Point E.g., Express as a 32-bit floating point number (in hexadecimal)

Step 1 Express original value in binary =

Step 2 Normalize = x 2 5

Step 3 Determine S, E, and M x 2 5 S = 0 (because the value is positive) MS n E= n = = 132 =

Step 4 Put S, E, and M together to form 32-bit binary result SEM

Step 5 Express in hexadecimal = Answer: