Lec22FloatingPoint - Lecture 22 Math Calculation Using...

Info icon This 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
Image of page 1

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

View Full Document Right 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
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
Image of page 3

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

View Full Document Right 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
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.
Image of page 5

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

View Full Document Right 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
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.
Image of page 7

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

View Full Document Right Arrow Icon
ECE 471 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.
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern