Re: Fixed Point Arithmetic
- From: Randy Yates <yates@xxxxxxxx>
- Date: Sat, 25 Aug 2007 23:06:53 -0400
"G Iveco" <G.Iveco@xxxxxxxxxx> writes:
"Greg Berchin" <gberchin@xxxxxxxxxxxx> wrote in message
news:vt71d3l7jqkv9uokevpmbjaeem6e98s1ir@xxxxxxxxxx
I am implementing (A+B-C-D-E) in fixed-point logic. I am implementing
it as ((A+B)-((C+D)+E)). A, B, C, D, and E are all unsigned, more or
less uniformly distributed over the range [0, MAX), where MAX>>1, and
each also carries several fractional bits. The final result is signed.
I need for the accuracy of the final result to be reasonably close to
±½, but I also need to carry as few bits as possible in the arithmetic
operations to minimize real estate and maximize speed. Is there a
deterministic way to find the minimum number of fractional bits to keep
in A, B, C, D, E, (A+B), (C+D), and ((C+D)+E) at the inputs to the
adders, and whether to round or truncate?
Thanks,
Greg
If the inputs ABCDE are undeterministic, then either A+B or A+C or whatever
doesn't
matter.
The goal of your "I need for the accuracy of the final result to be
reasonably close to
±½, " is pretty ambiguous.
I'd look at max/mins. A+B has a max of 2*MAX and a min of 0. C+D+E has
a max of 3*MAX and a min of 0. Thus A+B-(C+D+E) has a max of 2*MAX and
a min of -1*3*MAX. You must carry enough bits to cover this range or
you'll lose something (either via saturation or roundoff, depending
on how you scale things).
--
% Randy Yates % "Watching all the days go by...
%% Fuquay-Varina, NC % Who are you and who am I?"
%%% 919-577-9882 % 'Mission (A World Record)',
%%%% <yates@xxxxxxxx> % *A New World Record*, ELO
http://home.earthlink.net/~yatescr
.
- References:
- Fixed Point Arithmetic
- From: Greg Berchin
- Re: Fixed Point Arithmetic
- From: G Iveco
- Fixed Point Arithmetic
- Prev by Date: Re: Fixed Point Arithmetic
- Next by Date: Octave and loading files via libsndfile
- Previous by thread: Re: Fixed Point Arithmetic
- Next by thread: Re: Fixed Point Arithmetic
- Index(es):
Relevant Pages
|