Floating Point Number system corresponding to the decimal notation

Slides:



Advertisements
Similar presentations
Fixed Point Numbers The binary integer arithmetic you are used to is known by the more general term of Fixed Point arithmetic. Fixed Point means that we.
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.
Datorteknik FloatingPoint bild 1 Floating point Number system corresponding to the decimal notation 1,837 * 10 significand exponent a great number of corresponding.
Floating Point Numbers
CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (2)
Booth’s Algorithm.
Number Systems Standard positional representation of numbers:
Integer Arithmetic Floating Point Representation Floating Point Arithmetic Topics.
Floating Point Numbers
CSE 378 Floating-point1 How to represent real numbers In decimal scientific notation –sign –fraction –base (i.e., 10) to some power Most of the time, usual.
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
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.
1 Lecture 5 Floating Point Numbers ITEC 1000 “Introduction to Information Technology”
Computing Systems Basic arithmetic for computers.
ECE232: Hardware Organization and Design
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.
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.
Oct. 18, 2007SYSC 2001* - Fall SYSC2001-Ch9.ppt1 See Stallings Chapter 9 Computer Arithmetic.
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
Computer Arithmetic Floating Point. We need a way to represent –numbers with fractions, e.g., –very small numbers, e.g., –very large.
Computer Architecture Lecture 22 Fasih ur Rehman.
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.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
Chapter 9 Computer Arithmetic
William Stallings Computer Organization and Architecture 8th Edition
Floating Point Representations
Integer Division.
Topics IEEE Floating Point Standard Rounding Floating Point Operations
CS 232: Computer Architecture II
IEEE floating point format
CS/COE0447 Computer Organization & Assembly Language
CS 367 Floating Point Topics (Ch 2.4) IEEE Floating Point Standard
PRESENTED BY J.SARAVANAN. Introduction: Objective: To provide hardware support for floating point arithmetic. To understand how to represent floating.
William Stallings Computer Organization and Architecture 7th Edition
Outline Introduction Floating Point Arithmetic Adder Multiplier.
Luddy Harrison CS433G Spring 2007
Number Representations
CSCI206 - Computer Organization & Programming
Computer Science 210 Computer Organization
How to represent real numbers
ECEG-3202 Computer Architecture and Organization
Chapter 8 Computer Arithmetic
Numbers with fractions Could be done in pure binary
Computer Organization and Assembly Language
Number Representations
Lecture 9: Shift, Mult, Div Fixed & Floating Point
Presentation transcript:

Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number of corresponding binary standards exists. There is one common standard: IEEE 754-1985 (IEC 559) 4

IEEE 754-1985 Number representations: Single precision (32 bits) sign: 1 bit exponent: 8 bits fraction: 23 bits Double precision (64 bits) exponent: 11 bits fraction: 52 bits

Single Precision Format 1 8 23 Sign S S E M Exponent E: excess 127 binary integer Mantissa M: normalized binary significand w/ hidden integer bit: 1.M Excess 127; actual exponent is e = E - 127 N = (-1)S * (1.M [bit-string])*2e

Example 1 S E M 1 01111110 10000000000000000000000 e = E - 127 e = 126 - 127 = -1 N = (-1)1 * (1.1 [bit-string]) *2-1 N = -1 * 0.11 [bit-string] N = -1 * (2-1 *1 + 2 -2 *1) N = -1 * (0.5*1 + 0.25*1) = -0.75

Single Precision Range Magnitude of numbers that can be represented is in the range: 2-126 *(1.0) to 2127 *(2-223) which is approximately: 1.8*10-38 to 3.4 *1038

IEEE 754-1985 Single Precision (32 bits) Fraction part: 23 bits; 0 x < 1 Significand: 1 + fraction part. “1” is not stored; “hidden bit”. Corresponds to 7 decimal digits. Exponent: 127 added to the exponent. Corresponds to the range 10 -39 to 10 39 Double Precision (64 bits) Fraction part: 52 bits; 0 x < 1 Significand: 1 + fraction part. “1” is not stored; “hidden bit”. Corresponds to 16 decimal digits. Exponent: 1023 added to the exponent; Corresponds to the range 10 -308 to 10 308

IEEE 754-1985 Special features: Correct rounding of “halfway” result (to even number). Includes special values: NaN Not a number  Infinity -  - Infinity Uses denormal number to represent numbers less than 2 -E min Rounds to nearest by default; Three other rounding modes exist. Sophisticated exception handling.

Add / Sub (s1 * 2e1) +/- (s2 * 2 e2 ) = (s1 +/- s2) * 2 e3 = s3 * 2 e3 s = 1.s, the hidden bit is used during the operation. 1: Shift summands so they have the same exponent: e.g., if e2 < e1: shift s2 right and increment e2 until e1 = e2 2: Add/Sub significands using the sign bits for s1 and s2. set sign bit accordingly for the result. 3: Normalize result (sign bit kept separate): shift s3 left and decrement e3 until MSB = 1. 4: Round s3 correctly. more than 23 / 52 bits is used internally for the addition.

Multiplication (s1 * 2e1) * (s2 * 2 e2 ) = s1 * s2 * 2 e1+e2 so, multiply significands and add exponents. Problem: Significand coded in sign & magnitude; use unsigned multiplication and take care of sign. Round 2n bits significand to n bits significand. Normalize result, compute new exponent with respect to bias.

Division (s1 * 2e1 ) / (s2 * 2 e2 ) = (s1 / s2) * 2 e1-e2 so, divide significands and subtract exponents Problem: Significand coded in signed- magnitude - use unsigned division (different algoritms exists) and take care of sign Round n + 2 (guard and round) bits significand to n bits significand Compute new exponent with respect to bias