R EPRESENTATION OF REAL NUMBER Presented by: Pawan yadav Puneet vinayak.

Slides:



Advertisements
Similar presentations
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Advertisements

Floating Point Numbers
Faculty of Computer Science © 2006 CMPUT 229 Floating Point Representation Operating with Real 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.
Computer ArchitectureFall 2007 © September 5, 2007 Karem Sakallah CS 447 – Computer Architecture.
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.
Booth’s Algorithm.
Signed Numbers.
Floating Point Numbers
Representing Real Numbers Using Floating Point Notation Lecture 6 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
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.
Binary Representation and Computer Arithmetic
The Binary Number System
Data Representation Number Systems.
Simple Data Type Representation and conversion of numbers
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
Computer Organization and Architecture Computer Arithmetic Chapter 9.
Computer Arithmetic Nizamettin AYDIN
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
1 Lecture 5 Floating Point Numbers ITEC 1000 “Introduction to Information Technology”
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Negative and Floating Point.
Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park.
Introduction to Numerical Analysis I
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,
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Floating Point Representation.
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
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.
Floating Point Numbers Dr. Mohsen NASRI College of Computer and Information Sciences, Majmaah University, Al Majmaah
Chapter 9 Computer Arithmetic
William Stallings Computer Organization and Architecture 8th Edition
Floating Point Numbers
Computer Science 210 Computer Organization
Introduction To Computer Science
Number Systems and Binary Arithmetic
Floating Point Number system corresponding to the decimal notation
CS 232: Computer Architecture II
William Stallings Computer Organization and Architecture 7th Edition
Data Structures Mohammed Thajeel To the second year students
Computer Science 210 Computer Organization
ECEG-3202 Computer Architecture and Organization
Chapter 8 Computer Arithmetic
Representation of real numbers
Numbers with fractions Could be done in pure binary
Presentation transcript:

R EPRESENTATION OF REAL NUMBER Presented by: Pawan yadav Puneet vinayak

C ONTENTS :-  Floating Point Numbers  Decimal  Binary conversion  Floating point representation  Mantissa  Exponent  Normalization  IEEE Floating Point Representation  Floating point airhtematic  Error in floating point airthematic

F LOATING P OINT N UMBERS In computer science real number is also called floating point number. In the decimal system, a decimal point ( radix point ) separates the whole numbers from the fractional part Examples: ( whole=37, fraction = 25)

F LOATING P OINT N UMBERS For example, can be analyzed as: TensUnitsTenths Hundredths = 3 x x x 1/ x 1/100

B INARY E QUIVALENT In the binary representation of a floating point number the column values will be as follows: … … … /2 1/4 1/8 1/16 … … …

D ECIMAL  B INARY CONVERSION Repeatedly multiply fraction by two until fraction becomes zero     1.0

S CIENTIFIC NOTATION OF FLOATING NUMBERS Decimal: -123,000,000,000,000  ×  +1.23× Binary:  ×  × 2 -16

F LOATING P OINT N UMBER R EPRESENTATION If x is a real number then its normal form representation is: x = f Base E where f : mantissa E : exponent exponent Example: = mantissa = = –1

N ORMALIZED AND U NNORMALIZED

N ORMALIZATION P ROCESS

F LOATING P OINT F ORMAT FOR B INARY N UMBERS

IEEE F LOATING P OINT R EPRESENTATION – more exponent bits  greater range – more significant bits  greater accuracy

IEEE F LOATING P OINT R EPRESENTATION The first, or leftmost, field of our floating point representation will be the sign bit: 0 for a positive number, 1 for a negative number.

IEEE F LOATING P OINT R EPRESENTATION The second field of the floating point number will be the exponent. Since we must be able to represent both positive and negative exponents, we will use a convention which uses a value known as a bias of 127 to determine the representation of the exponent. An exponent of 5 is therefore stored as or 132; an exponent of -5 is stored as (-5) OR 122. The biased exponent, the value actually stored, will range from 0 through 255. This is the range of values that can be represented by 8-bit, unsigned binary numbers.

IEEE F LOATING P OINT R EPRESENTATION The mantissa is the set of 0’s and 1’s to the left of the radix point of the normalized (when the digit to the left of the radix point is 1) binary number. ex: X 2 3 The mantissa is stored in a 23 bit field,

N ORMALIZING N UMBERS Example: = x = 0.21 x B =.1011 x 2 3 or x 2 2 (hidden1) B =.11 x 2 -1 or 1.1 x 2 -2 (hidden1) AB.CD H =.ABCD x AC H =.AC x Note that the concept of a hidden 1 only applied to binary.

C ONVERTING DECIMAL FLOATING POINT VALUES TO STORED IEEE STANDARD VALUES. Example : Find the IEEE FP representation of Step 1. Compute the binary equivalent of the whole part and the fractional part. ( convert 40 and to their binary equivalents) =

C ONVERTING DECIMAL FLOATING POINT VALUES TO STORED IEEE STANDARD VALUES. Step 2. Normalize the number by moving the decimal point to the right of the leftmost one = x 2 5 Step 3. Convert the exponent to a biased exponent = 132 ==> =

C ONVERTING DECIMAL FLOATING POINT VALUES TO STORED IEEE STANDARD VALUES. Step 4. Store the results from above Sign Exponent (from step 3) Mantissa ( from step 2)

C ONVERT TO SINGLE PRECISION FLOATING POINT

F LOATING -P OINT A DDITION 23 Assume 4 decimal digit for mantissa

FLOATING POINT SUBTRACTION ( USING 4 DIGIT MANTISSA ) Addition must be of terms of the same scale:     10 6 {both10 6 } ( )     10 6 {4 digit mantissa}

R EAL N UMBER M ULTIPLICATION ( USING 4 DIGIT MANTISSA ) Multiplication problem is in the mantissa (  10 2 )  (  10 4 )   {add indices}  10 6 =   10 5 {4 digit mantissa} Notice that multiplication must work from the largest digit downwards since at some point the number is going to have to be truncated.

R EAL N UMBER DIVISION ( USING 4 DIGIT MANTISSA ) (  10 2 ) /(  10 4 ) ( /0.1455)  {sub indices}  =    {4 digit mantissa}

E RRORS IN FLOATING POINT ARITHMETIC Round off error Ex = =7.24 Truncation error = =5.4567