Floating Point Representations CDA 3101 Discussion Session 02.

Slides:



Advertisements
Similar presentations
COMP2130 Winter 2015 Storing signed numbers in memory.
Advertisements

Arithmetic in Computers Chapter 4 Arithmetic in Computers2 Outline Data representation integers Unsigned integers Signed integers Floating-points.
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
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
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
Faculty of Computer Science © 2006 CMPUT 229 Floating Point Representation Operating with Real Numbers.
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.
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
1 Module 2: Floating-Point Representation. 2 Floating Point Numbers ■ Significant x base exponent ■ Example:
Floating Point Numbers
Quiz 1.1 Convert the following unsigned binary numbers to their decimal equivalent: Number2 Number
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
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Review CAS CS210 Ying Ye Boston University. Logical expressions Truth table input: A, B, Coutput: D ABCD (~A)(~B)(~C)
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Number Systems So far we have studied the following integer number systems in computer Unsigned numbers Sign/magnitude numbers Two’s complement numbers.
Computer Architecture
ECE232: Hardware Organization and Design
COMPSCI 210 Semester Tutorial 1
Floating Point Numbers Topics –IEEE Floating Point Standard –Rounding –Floating Point Operations –Mathematical properties.
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.
9.4 FLOATING-POINT REPRESENTATION
CSCI 6307 Foundation of Systems – Exercise (2) Xiang Lian The University of Texas – Pan American Edinburg, TX
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.
©Brooks/Cole, 2003 Chapter 3 Number 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.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Floating Point Arithmetic
Number Systems & Operations
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.
Data Representation: Floating Point for Real Numbers Computer Organization and Assembly Language: Module 11.
IT11004: Data Representation and Organization Floating Point Representation.
Numbers in Computers.
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.
Representation of Data (Part II) Computer Studies Notes: chapter 19 Ma King Man.
Fixed-point and floating-point numbers Ellen Spertus MCS 111 October 4, 2001.
FLOATING-POINT NUMBER REPRESENTATION
CSCI206 - Computer Organization & Programming
Floating Point Numbers
Floating Point Representations
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
PRESENTED BY J.SARAVANAN. Introduction: Objective: To provide hardware support for floating point arithmetic. To understand how to represent floating.
CSCI206 - Computer Organization & Programming
Number Representations
CSCI206 - Computer Organization & Programming
Chapter 2 Representing and Manipulating Information
Chapter 2 Representing and Manipulating Information
Number Representations
Presentation transcript:

Floating Point Representations CDA 3101 Discussion Session 02

Question 1 Converting the binary number to decimal, if the binary is Unsigned? 2 ’ s complement? Single precision floating-point?

Question 1.1 Converting bin (unsigned) to dec * * … + 1* * *2 2 =

Question 1.2 Converting bin (2 ’ s complement) to dec * * … + 1* * *2 2 =

Question 1.3 Converting bin (Single precision FP) to dec Sign bit : 1 Exponent : = 73 Fraction : =1* * … + 1* * *2 -21 = (-1) S * (1.Fraction) * 2 (Exponent - 127) = (-1) 1 * ( ) * 2 ( ) = * = * S(1)Biased Exponent(8)Fraction (23)

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

Question 2.1 Converting 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, … … … * 2 -4 Step2: Express in single precision format (-1) S * (1.Fraction) * 2 (Exponent +127) = (-1) 0 * ( ) * 2 (-4+127)

Question 2.2 Converting 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, … … … * 2 -4 Step2: Express in double precision format (-1) S * (1.Fraction) * 2 (Exponent +1023) = (-1) 0 * ( ) * 2 ( )

Question 3 Convert the following single-precision numbers into decimal a b

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

Question 3.2 Converting bin (Single precision FP) to dec Sign bit : 0 Exponent : = 0 Fraction : =1*2 -22 = (-1) S * (0.Fraction) * = (-1) 0 * ( ) * = * 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 a.the third smallest positive normalized number b.the largest (farthest from zero) negative normalized number c.the third smallest positive denormalized number that can be represented.

Question 4.1 The third smallest positive normalized number Bias: = Sign: 0 Biased Exponent: Fraction (f): 61 zeros followed by 10 Decimal Value: (-1) 0 *2 ( ) *( ) =

Question 4.2 The largest (farthest from zero) negative normalized number Sign: 1 Biased Exponent: Fraction: 63 ones Decimal Value: (-1) 1 *2 ( ) *( … ) = ( )2 -63 = (approx.)

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