Re: Fixed point Vs Floating point



Hi tim,
Thanks for the quick response. I totally understand what you have
explained. But lets take the same example you have given. Let us
assume we have a micrprocessor that does only 4 bit multiplies. Lets
say the numers are now, 11.01 and 01.01. For the hardware, the binary
point is not really a concern, so really its doing 1101 * 0101. Now
the answer is 0100.0001. This is where I lose my wheels. What comes
out of the microprosessor (assuming we have enough data word bits to
obtain the result) is 11010101. How do i know where the decimal point
is. That number can be interpreted in a myriad number of ways.

Can it be that we first scale the numbers to a known place for the
binary point, so in this case .1101 and .0101 and now WE KNOW that the
answer is .01000001?
Is this how the hardware design is done?

Regards,
Sai.

On Jun 15, 2:52 pm, Tim Wescott <t...@xxxxxxxxxxxxxxxx> wrote:
skila...@xxxxxxxxx wrote:
Hi All,

I am trying to understand how fixed point and floating point are
implemented in hardware. This is what I understand so far

1) Fixed point means the decimal point is fixed. Floating point has
some bits set for mantissa and some for the exponent ie the decimal
point "floats".
2) Floating point has more dynamic range for the given number of bits
as compared to fixed.
3) Floating point is harder to implement in hardware than fixed point
but is closer to representing real world values.
4) Fixed point is better when ur application has power consumption
requirements but doesn care as much about the precision.

  -- snip --

Fixed point math can yield results that are every bit as precise as
floating point math, and can often do so with significantly fewer
processor resources and software bugs.

If you have an applications where the inputs are of known range and
precision (such as you get when you're taking input from some sort of
analog to digital conversion process), then you can almost always map
out the entire data path of your algorithm, and know the exact range of
magnitudes and precision for each step.  Knowing this, the task of
fitting fixed-point math to the algorithm is simple, if sometimes tedious.

In this case floating point's mantissa is a useless waste of space, and
maintaining it is a useless waste of clock ticks.

Moreover, if you _really_ want to make sure that your application is
going to work, there's no savings to be had using floating point -- you
still have to analyze your algorithm from one end to the other to make
sure that the floating point type that you have chosen is still 'big'
enough to work.  For many practical problems where the hardware uses
16-bit ADCs, a 24-bit mantissa isn't enough -- and double precision
floating point _always_ uses scads of processor resources.

--

Tim Wescott
Wescott Design Serviceshttp://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" gives you just what it says.
See details athttp://www.wescottdesign.com/actfes/actfes.html- Hide quoted text -

- Show quoted text -

.



Relevant Pages

  • Re: why still use C?
    ... >> fairly low degree of precision, but it needs to be provided ... >> a radix that is a power of 10. ... > binary floating point. ... It's faster (given the hardware), simpler, ...
    (comp.lang.c)
  • Re: Fixed point Vs Floating point
    ... Is this how the hardware design is done? ... Floating point has more dynamic range for the given number of bits ... requirements but doesn care as much about the precision. ... fitting fixed-point math to the algorithm is simple, ...
    (sci.electronics.design)
  • Re: Standard Fortran Floating point behaviour
    ... > nonzero digits and negate the comparison. ... > floating point standards prescribe any particular behaviour in this respect. ... is the actual hardware that counts in the end. ... The problems in Fortran occur when mixing precision and expecting ...
    (comp.lang.fortran)
  • Re: floats doubles long doubles
    ... C++ allow, but does not require, three different floating point types. ... A 32 bit IEEE single precision representation fully meets the ... what almost all platforms and compilers use today for double. ... Some hardware architectures provide hardware ...
    (comp.lang.cpp)
  • Re: Fixed point Vs Floating point
    ... I am trying to understand how fixed point and floating point are ... Floating point is harder to implement in hardware than fixed point ... If you have an applications where the inputs are of known range and precision, then you can almost always map out the entire data path of your algorithm, and know the exact range of magnitudes and precision for each step. ...
    (sci.electronics.design)