Re: Fixed Point Arithmetic



"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
.



Relevant Pages

  • Re: Fixed Point Arithmetic
    ... adders, and whether to round or truncate? ... If the inputs ABCDE are undeterministic, then either A+B or A+C or whatever ...
    (comp.dsp)
  • Fixed Point Arithmetic
    ... operations to minimize real estate and maximize speed. ... adders, and whether to round or truncate? ...
    (comp.dsp)
  • Re: TRUNC Function
    ... But now you have a problem when the seconds round up to 60. ... them into degrees minutes and seconds (i.e truncate the ... not held to its full precision in the calculator memory. ... >> I know I can reduce the precision of the stord data but ...
    (microsoft.public.excel.misc)
  • Re: Running Watch
    ... Tom B. wrote: ... But they don't generally round to the ... nearest integer minute, they truncate to the next lower minute (i.e. ...
    (rec.running)
  • RE: Rounding Problem-Please Help!!!
    ... Thank you for using the Microsoft Access Newsgroups. ... It sounds like you need to develop a function to round or truncate currency ...
    (microsoft.public.access.externaldata)