15_Floating_Point_Numbers

15_Floating_Point_Numbers - Floating Point Numbers CMPE12...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPE12 Cyrus Bazeghi Floating Point Numbers
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CMPE12 Cyrus Bazeghi 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or 2 64 numbers to be represented. Which reals to represent? There are an infinite number between 2 adjacent integers. (or two reals!!) Which bit patterns for reals selected? Answer: use scientific notation
Background image of page 2
CMPE12 Cyrus Bazeghi 3 A B A x 10 B 0 any 0 1 . . 9 0 1 . . 9 1 . . 9 1 10 . . 90 1 . . 9 2 100 . . 900 1 . . 9 -1 0.1 . . 0.9 1 . . 9 -2 0.01 . . 0.09 Consider: A x 10 B , where A is one digit How to do scientific notation in binary? Standard: IEEE 754 Floating-Point Floating Point Numbers
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CMPE12 Cyrus Bazeghi 4 IEEE 754 Single Precision Floating Point Format Representation: S E F S is one bit representing the sign of the number E is an 8 bit biased integer representing the exponent F is an unsigned integer The true value represented is: (-1) S x f x 2 e S = sign bit e= E bias f= F/2 n + 1 for single precision numbers n=23, bias=127 0 22 23 30 31
Background image of page 4
CMPE12 Cyrus Bazeghi 5 S, E, F are all fields within a representation . Each is just a bunch of bits. S is the sign bit (-1) S (-1) 0 = +1 and (-1) 1 = -1 Just a sign bit for signed magnitude E is the exponent field The E field is a biased-127 representation. True exponent is (E bias) The base (radix) is always 2 (implied). Some early machines used radix 4 or 16 (IBM) IEEE 754 Single Precision Floating Point Format
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CMPE12 Cyrus Bazeghi 6 F (or M ) is the fractional or mantissa field. It is in a strange form. There are 23 bits for F. A normalized FP number always has a leading 1. No need to store the one, just assume it. This MSB is called the HIDDEN BIT. IEEE 754 Single Precision Floating Point Format
Background image of page 6
CMPE12 Cyrus Bazeghi 7 How to convert 64.2 into IEEE SP 1. Get a binary representation for 64.2 Binary of left of radix point is: Binary of right of radix: .2 x 2 = 0.4 0 .4 x 2 = 0.8 0 .8 x 2 = 1.6 1 .6 x 2 = 1.2 1 Binary for .2: 64.2 is: 2. Normalize binary form Produces:
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/14/2009 for the course CMPE 12/l taught by Professor Bazeghi during the Fall '09 term at UCSC.

Page1 / 30

15_Floating_Point_Numbers - Floating Point Numbers CMPE12...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online