Lec22FloatingPoint

Lec22FloatingPoint - Lecture 22 Math Calculation Using...

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

View Full Document Right Arrow Icon
ECE 471 22-1 Outline Data representation Fixed Point Math Binary Factions Discussion and Summary Lecture 22: Math Calculation Using Fixed Point Processors
Background image of page 1

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

View Full DocumentRight Arrow Icon
ECE 471 22-2 Floating point Number Representation Data objects of type float and double are represented as described in the IEEE floating point standard. Four bytes for a float Mantissa 30 23 22 0 Sign 31 Exponent
Background image of page 2
ECE 471 22-3 Data Representation IEEE floating point standard Eight bytes for a double Mantissa 62 52 51 0 Sign 63 Exponent
Background image of page 3

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

View Full DocumentRight Arrow Icon
ECE 471 22-4 Fixed Point Math Fixed point math is best used when: Float is slow Float uses too much memory Integer resolution is not sufficient More accurate representation of some fractions ANSI C does not have built-in support for Fixed Point Math Can be implemented as library routines Macros
Background image of page 4
ECE 471 22-5 Fixed Point Math The decimal point does not “float” Fixed number of digits to the right of the decimal point Program code is responsible for managing the decimal digits Range of values are limited Faster Use integer instructions for perform the operations Uses less memory No floating point libraries needed.
Background image of page 5

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

View Full DocumentRight Arrow Icon
ECE 471 22-6 Fixed Point Math Fixed point math is common in applications that must process data in real-time DSP ICs generally provide integral support for fixed point math FFT Digital filtering Process control Speech synthesis Voice recognition
Background image of page 6
ECE 471 22-7 Simple Example Suppose you wanted to work with dollars and cents in your program I.e., store and manipulate a number like: $1.20 1.2 cannot be represented exactly in binary Floating point is not necessary For money, we will always have no more that two decimal digits.
Background image of page 7

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

View Full DocumentRight Arrow Icon
22-8 Solution Represent all money as cents instead of dollars $1.20 == 120 cents Use integer arithmetic Results are always accurate (assuming your not using division) The two decimal digits are implied. Conversion must occur for input and output
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/31/2008 for the course ECE 471 taught by Professor Chien during the Spring '08 term at IUPUI.

Page1 / 31

Lec22FloatingPoint - Lecture 22 Math Calculation Using...

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

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