Re: Fixed point Vs Floating point
- From: skilambi@xxxxxxxxx
- Date: Sun, 15 Jun 2008 12:08:07 -0700 (PDT)
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 -
.
- Follow-Ups:
- Re: Fixed point Vs Floating point
- From: JosephKK
- Re: Fixed point Vs Floating point
- From: John Larkin
- Re: Fixed point Vs Floating point
- From: Frank Buss
- Re: Fixed point Vs Floating point
- From: Jonathan Kirwan
- Re: Fixed point Vs Floating point
- References:
- Fixed point Vs Floating point
- From: skilambi
- Re: Fixed point Vs Floating point
- From: Tim Wescott
- Fixed point Vs Floating point
- Prev by Date: Re: Attorney generals trying to shut down usenet?
- Next by Date: Re: Anyone from Iowa lurking here?
- Previous by thread: Re: Fixed point Vs Floating point
- Next by thread: Re: Fixed point Vs Floating point
- Index(es):
Relevant Pages
|