Floating Point Representations

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

Lecture 16: Computer Arithmetic Today’s topic –Floating point numbers –IEEE 754 representations –FP arithmetic Reminder –HW 4 due Monday 1.
Binary Arithmetic Binary addition Binary subtraction
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.
Faculty of Computer Science © 2006 CMPUT 229 Floating Point Representation Operating with Real Numbers.
1 Lecture 9: Floating Point Today’s topics:  Division  IEEE 754 representations  FP arithmetic Reminder: assignment 4 will be posted later today.
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.
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.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Floating-Point.
Integer Arithmetic Floating Point Representation Floating Point Arithmetic Topics.
Floating Point Numbers
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.
Ch. 2 Floating Point Numbers
Number Systems II Prepared by Dr P Marais (Modified by D Burford)
Computer Architecture
1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU1 IEEE Floating Point The IEEE Floating Point Standard and execution.
Floating Point Numbers Topics –IEEE Floating Point Standard –Rounding –Floating Point Operations –Mathematical properties.
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.
Floating Point Representations CDA 3101 Discussion Session 02.
Fixed and Floating Point Numbers Lesson 3 Ioan Despi.
Lecture 9: Floating Point
ITEC 1011 Introduction to Information Technologies 4. Floating Point Numbers Chapt. 5.
Integer & Floating Point Representations CDA 3101 Discussion Session 05.
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 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 in Binary 1.Place Value Chart:
Floating Point Numbers Representation, Operations, and Accuracy CS223 Digital Design.
Data Representation: Floating Point for Real Numbers Computer Organization and Assembly Language: Module 11.
IT11004: Data Representation and Organization Floating Point Representation.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
CH.3 Floating Point Hardware and Algorithms 3/10/
Fixed-point and floating-point numbers Ellen Spertus MCS 111 October 4, 2001.
Floating Point (FLP) Representation
CSCI206 - Computer Organization & Programming
Floating Points & IEEE 754.
Floating Point Numbers
Introduction to Numerical Analysis I
Floating Point Representations
Computer Science 210 Computer Organization
Computer Architecture & Operations I
2.4. Floating Point Numbers
CSCI206 - Computer Organization & Programming
Recitation 4&5 and review 1 & 2 & 3
Lecture 9: Floating Point
Floating Point Number system corresponding to the decimal notation
CS 232: Computer Architecture II
IEEE floating point format
ECE 103 Engineering Programming Chapter 3 Numbers
PRESENTED BY J.SARAVANAN. Introduction: Objective: To provide hardware support for floating point arithmetic. To understand how to represent floating.
Outline Introduction Floating Point Arithmetic Adder Multiplier.
Luddy Harrison CS433G Spring 2007
CSCI206 - Computer Organization & Programming
Number Representations
Floating Point Representation
CSCI206 - Computer Organization & Programming
The IEEE Floating Point Standard and execution units for it
Computer Science 210 Computer Organization
Chapter 2 Representing and Manipulating Information
The IEEE Floating Point Standard and execution units for it
Normalised Floating Point Numbers
CS 286 Computer Architecture & Organization
Chapter 2 Representing and Manipulating Information
Numbers with fractions Could be done in pure binary
Number Representations
Presentation transcript:

Floating Point Representations CDA 3101 Discussion Session 02

Question 1 Converting the binary number 1100 0000 1101 1001 1001 1001 1001 10102 to decimal, if the binary is single precision floating-point?

Question 1 Converting bin (Single precision FP) to decimal 1100 0000 1101 1001 1001 1001 1001 10102 Sign bit : 1 Exponent : 10000001 = 129 Fraction : 10110011001100110011010 =1*2-1 + 1*2-3 + … + 1*2-19 + 1*2-20 + 1*2-22 =0.7000000476837158 (-1)S * (1.Fraction) * 2(Exponent - 127) =(-1)1 * (1.7000000476837158) * 2(129 - 127) =- 1.7000000476837158 * 2(129 - 127) =-6.80000019073486328125 S(1) Biased Exponent(8) Fraction (23)

Question 2 Show the IEEE 754 binary representation for the floating-point number 0.110 in single­precision and double­precision

Question 2.1 Converting 0.110 to single-precision FP Step1: Covert fraction 0.1 to binary (multiplying by 2) 0.1*2 = 0.2, 0.2*2 = 0.4, 0.4*2 = 0.8, 0.8*2 = 1.6, 0.6*2 = 1.2, 0.2*2 = 0.4, 0.4*2 = 0.8, 0.8*2 = 1.6, 0.6*2 = 1.2, … 000110011… 1.10011… * 2-4 Step2: Express in single precision format (-1)S * (1.Fraction) * 2(Exponent +127) =(-1)0 * (1.10011001100110011001100) * 2(-4+127) 01111011 10011001100110011001100

Question 2.2 Converting 0.110 to double-precision FP Step1: Covert fraction 0.1 to binary (multiplying by 2) 0.1*2 = 0.2, 0.2*2 = 0.4, 0.4*2 = 0.8, 0.8*2 = 1.6, 0.6*2 = 1.2, 0.2*2 = 0.4, 0.4*2 = 0.8, 0.8*2 = 1.6, 0.6*2 = 1.2, … 000110011… 1.10011… * 2-4 Step2: Express in double precision format (-1)S * (1.Fraction) * 2(Exponent +1023) =(-1)0 * (1.1001100110011001100110) * 2(-4+1023) 01111111011 1001100110011001100110011001100110011001100110011001

Question 3 Convert the following single-precision numbers into decimal

Question 3.1 Converting bin (Single precision FP) to dec 0 11111111 000000000000000000000002 Sign bit : 0 Exponent : 11111111 = Infinity Fraction : 00000000000000000000000 = 0 Infinity S(1) Biased Exponent(8) Fraction (23)

Question 3.2 Converting bin (Single precision FP) to dec 0 00000000 000000000000000000000102 Sign bit : 0 Exponent : 00000000 = 0 Fraction : 00000000000000000000010 =1*2-22 =0.000000238 (-1)S * (0.Fraction) * 2-126 =(-1)0 * (0.000000238) * 2-126 = 2.797676555 * 10-45 S(1) Biased Exponent(8) Fraction (23)

Question 4 Consider the 80-bit extended-precision IEEE 754 floating point standard that uses 1 bit for the sign, 16 bits for the biased exponent and 63 bits for the fraction (f). Then, write (i) the 80- bit extended-precision floating point representation in binary and (ii) the corresponding value in base-10 positional (decimal) system of the third smallest positive normalized number the largest (farthest from zero) negative normalized number the third smallest positive denormalized number that can be represented.

Question 4.1 The third smallest positive normalized number Bias: 215-1 = 32767 Sign: 0 Biased Exponent: 0000 0000 0000 0001 Fraction (f): 61 zeros followed by 10 Decimal Value: (-1)0*2(1-32767)*(1+2-62) = 2-32766+2-32828

Question 4.2 The largest (farthest from zero) negative normalized number Sign: 1 Biased Exponent: 1111 1111 1111 1110 Fraction: 63 ones Decimal Value: (-1)1*2(65534-32767)*(1+2-1+2-2+…+2-63) = -232767(264-1)2-63 = -232768 (approx.)

Question 4.3 The third smallest positive denormalized number Sign: 0 Biased Exponent: 0000 0000 0000 0000 Fraction: 61 zeros followed by 11 Decimal Value: (-1)0*2-32766*(2-62+2-63) = 3*2-32829