Forums

Fixed Point Arithmetic resources

Started by Ashwin June 25, 2003
Hi,

I'm looking for good links to information on Fixed Point Arithmetic.

The only good resource I could find was -

Fixed Point Arithmetic: An Introduction - by Randy Yates
http://mel.interspace.dk/~sune/old-stuff/files/reading/fixed-point.pdf

But, it is only an intro and does not deal with concepts like
overflow, saturation and scaling.

Are there any other good resources on the web related to Fixed Point
Arithmetic?


Thanks,
Ashwin
-- 
http://symonds.net/~ash/
ashwin@despammed.com (Ashwin) wrote in message news:<b28d4abb.0306250232.191757f0@posting.google.com>...
> Hi, > > I'm looking for good links to information on Fixed Point Arithmetic. > > The only good resource I could find was - > > Fixed Point Arithmetic: An Introduction - by Randy Yates > http://mel.interspace.dk/~sune/old-stuff/files/reading/fixed-point.pdf
Interesting link. You can get the "official" version from http://home.earthlink.net/~yatescr/fp.pdf
> But, it is only an intro and does not deal with concepts like > overflow, saturation and scaling.
Methinks you didn't really read the paper. The whole paper is on scaling. That's the point (pun intended!). There is also some information on overflow in the example at the end. There is indeed no information on saturation, although I'm not sure what information you would need on the matter. Do you not understand what the operation of saturation actually does? Do you not understand when you would saturate and when you would not? There is another paper called "Practical Considerations in Fixed-Point FIR implementations" that deals with overflows and coefficient scaling. Perhaps it may touch on some of your questions. I suspect you may have a specific problem in mind that the paper didn't address. Why don't you present it here? --Randy
> > Are there any other good resources on the web related to Fixed Point > Arithmetic? > > > Thanks, > Ashwin
"Randy Yates" <yates@ieee.org> wrote in message
news:567ce618.0306250712.41faed55@posting.google.com...
> ashwin@despammed.com (Ashwin) wrote in message
news:<b28d4abb.0306250232.191757f0@posting.google.com>... <snipped> Do you not understand when you would saturate and when you would not? <snipped> ========================================================= Randy, I suspect that a lot of people do not understand this seemingly "simple" topic because there is not a clean generalized answer that is processor/situation independent. Some situations to consider (not exhaustive) assuming 2's complement math for multiply-accumulates (MACs): Do I want to saturate every time I overflow? If I know I overflowed at some point in a calculation do I always want to saturate the final result? What if intermediate calculations overflow but the final results are valid? Can I tell if the final result is valid? What is the impact if the final result overflows and is not saturated? If I avoid overflows by scaling my numbers down, what does that do to my numerical resolution including underflows? Does the range of my accumulator support the detection of the situation where intermediate values in a MAC overflow but the final result does not? How many MACs can I perform and not destroy this detection capability? ... Not so simple. Dirk Dirk A. Bell DSP Consultant
ashwin@despammed.com (Ashwin) wrote in message news:<b28d4abb.0306250232.191757f0@posting.google.com>...
> Hi, > > I'm looking for good links to information on Fixed Point Arithmetic. > > The only good resource I could find was - > > Fixed Point Arithmetic: An Introduction - by Randy Yates > http://mel.interspace.dk/~sune/old-stuff/files/reading/fixed-point.pdf > > But, it is only an intro and does not deal with concepts like > overflow, saturation and scaling. > > Are there any other good resources on the web related to Fixed Point > Arithmetic? > > > Thanks, > Ashwin
Hi Ashwin, The effect of scaling, overflow and saturation is application specific ans so are ways of handling them. For general filter applications in fixed point point arithmetic u might want to refer the book - Advanced DSP (sorry i dont remember the title exactly) by Sanjit K Mitra or any other classical DSP book. The book has interesting references as well. u might also want search in ieee online library (free for all) http://ieeexplore.ieee.org. i got some useful stuff from this site for my research. Hope this helps ( if not "kshamisi saar tappaithu" :-) ) -Nithin www.utdallas.edu/~nithinr
Dirk Bell wrote:
> > "Randy Yates" <yates@ieee.org> wrote in message > news:567ce618.0306250712.41faed55@posting.google.com... > > ashwin@despammed.com (Ashwin) wrote in message > news:<b28d4abb.0306250232.191757f0@posting.google.com>... > > <snipped> > > Do you not understand when you would saturate and when you would not? > > <snipped> > > ========================================================= > > Randy, > > I suspect that a lot of people do not understand this seemingly "simple" > topic because there is not a clean generalized answer that is > processor/situation independent. > > Some situations to consider (not exhaustive) assuming 2's complement math > for multiply-accumulates (MACs): > > Do I want to saturate every time I overflow? If I know I overflowed at some > point in a calculation do I always want to saturate the final result? What > if intermediate calculations overflow but the final results are valid? Can I > tell if the final result is valid? What is the impact if the final result > overflows and is not saturated? If I avoid overflows by scaling my numbers > down, what does that do to my numerical resolution including underflows? > Does the range of my accumulator support the detection of the situation > where intermediate values in a MAC overflow but the final result does not? > How many MACs can I perform and not destroy this detection capability? ... > > Not so simple.
Did I say, "It is simple to understand when you would saturate and when you would not"??? -- % Randy Yates % "...the answer lies within your soul %% Fuquay-Varina, NC % 'cause no one knows which side %%% 919-577-9882 % the coin will fall." %%%% <yates@ieee.org> % 'Big Wheels', *Out of the Blue*, ELO http://home.earthlink.net/~yatescr
"Randy Yates" <yates@ieee.org> wrote in message
news:3EFA6499.A1A75D81@ieee.org...
> Dirk Bell wrote: > > > > "Randy Yates" <yates@ieee.org> wrote in message > > news:567ce618.0306250712.41faed55@posting.google.com... > > > ashwin@despammed.com (Ashwin) wrote in message > > news:<b28d4abb.0306250232.191757f0@posting.google.com>... > > > > <snipped> > > > > Do you not understand when you would saturate and when you would not? > > > > <snipped> > > > > ========================================================= > > > > Randy, > > > > I suspect that a lot of people do not understand this seemingly "simple" > > topic because there is not a clean generalized answer that is > > processor/situation independent. > > > > Some situations to consider (not exhaustive) assuming 2's complement
math
> > for multiply-accumulates (MACs): > > > > Do I want to saturate every time I overflow? If I know I overflowed at
some
> > point in a calculation do I always want to saturate the final result?
What
> > if intermediate calculations overflow but the final results are valid?
Can I
> > tell if the final result is valid? What is the impact if the final
result
> > overflows and is not saturated? If I avoid overflows by scaling my
numbers
> > down, what does that do to my numerical resolution including underflows? > > Does the range of my accumulator support the detection of the situation > > where intermediate values in a MAC overflow but the final result does
not?
> > How many MACs can I perform and not destroy this detection capability?
...
> > > > Not so simple. > > Did I say, "It is simple to understand when you would saturate and when > you would not"??? > -- > % Randy Yates % "...the answer lies within your soul > %% Fuquay-Varina, NC % 'cause no one knows which side > %%% 919-577-9882 % the coin will fall." > %%%% <yates@ieee.org> % 'Big Wheels', *Out of the Blue*, ELO > http://home.earthlink.net/~yatescr
Randy, In the context of "There is indeed no information on saturation, although I'm not sure what information you would need on the matter. Do you not understand what the operation of saturation actually does? Do you not understand when you would saturate and when you would not? " I would say you most definitely implied it. Of course I could be wrong. At least that's what my wife says. Dirk Dirk A. Bell DSP Consultant
In article bdck9p$bku$1@bob.news.rcn.net, Dirk Bell at dirkman@erols.com
wrote on 06/25/2003 12:56:

> "Randy Yates" <yates@ieee.org> wrote in message > news:567ce618.0306250712.41faed55@posting.google.com... >> ashwin@despammed.com (Ashwin) wrote in message > news:<b28d4abb.0306250232.191757f0@posting.google.com>... > > <snipped> > > Do you not understand when you would saturate and when you would not? > > <snipped> > > ========================================================= > > Randy, > > I suspect that a lot of people do not understand this seemingly "simple" > topic because there is not a clean generalized answer that is > processor/situation independent. > > Some situations to consider (not exhaustive) assuming 2's complement math > for multiply-accumulates (MACs): > > Do I want to saturate every time I overflow? If I know I overflowed at some > point in a calculation do I always want to saturate the final result? What > if intermediate calculations overflow but the final results are valid? Can I > tell if the final result is valid? What is the impact if the final result > overflows and is not saturated? If I avoid overflows by scaling my numbers > down, what does that do to my numerical resolution including underflows? > Does the range of my accumulator support the detection of the situation > where intermediate values in a MAC overflow but the final result does not? > How many MACs can I perform and not destroy this detection capability? ...
depends on how many guard bits on the lefta and how many on the righta.
> Not so simple.
it's not so bad on a 56K. that is one reason i was such a proponent of the 56K over TI or even the SHArC until a couple of years ago. r b-j
yates@ieee.org (Randy Yates) wrote in message news:<567ce618.0306250712.41faed55@posting.google.com>...

> > I'm looking for good links to information on Fixed Point Arithmetic. > > > > The only good resource I could find was - > > > > Fixed Point Arithmetic: An Introduction - by Randy Yates > > http://mel.interspace.dk/~sune/old-stuff/files/reading/fixed-point.pdf > > Interesting link. You can get the "official" version from > > http://home.earthlink.net/~yatescr/fp.pdf
Interestingly, Google lists the other one as more popular than your home link :-)
> There is another paper called "Practical Considerations in > Fixed-Point FIR implementations" that deals with overflows > and coefficient scaling. Perhaps it may touch on some of > your questions.
I got that one here - http://home.earthlink.net/~yatescr/fir.pdf I will look into it.
> I suspect you may have a specific problem in mind that the paper > didn't address. Why don't you present it here?
No specific problem. I was just looking around for information on FP math and was surprised to see so very less of it on the net. Ashwin -- http://symonds.net/~ash/
nitin_hsn@yahoo.com (Nithin) wrote in message news:<96e5ea15.0306251015.90a825e@posting.google.com>...

> > I'm looking for good links to information on Fixed Point Arithmetic. > > > > The only good resource I could find was - > > > > Fixed Point Arithmetic: An Introduction - by Randy Yates > > http://mel.interspace.dk/~sune/old-stuff/files/reading/fixed-point.pdf
[...]
> The effect of scaling, overflow and saturation is application specific > ans so are ways of handling them. For general filter applications in > fixed point point arithmetic u might want to refer the book - Advanced > DSP (sorry i dont remember the title exactly) by Sanjit K Mitra or any > other classical DSP book. The book has interesting references as well. > > u might also want search in ieee online library (free for all) > http://ieeexplore.ieee.org. i got some useful stuff from this site for > my research.
Here are some general resources on FPA I was able to dig out in these weeks - ---------- Fixed Point Arithmetic http://cnx.rice.edu/content/m11054/latest/ Fixed point numbers and fixed point arithmetic http://andercheran.aiind.upv.es/~amstrad/docs/fixedpnt.html A Calculated Look at Fixed-Point Arithmetic by Robert Gordon http://www.embedded.com/98/9804fe2.htm Fixed-point Arithmetic http://www.accu.org/acornsig/public/caugers/volume2/issue6/fixedpoint.html Fixed Point Math For Speed Freaks http://www.mactech.com/articles/mactech/Vol.10/10.03/FixedPointMath/index.html Getting a Speed Boost with Fixed-Point Math http://www.mactech.com/articles/mactech/Vol.13/13.11/Fixed-PointMathSpeed/ Comp.dsp FAQ: Algorithm implementation: floating-point versus fixed-point http://www.bdti.com/faq/2.htm#211 ---------- Thanks for all your help on this thread guys! :-) (Thumba sahaya aythu ;-) ashwin -- Ashwin N http://symonds.net/~ash/
ashwin@despammed.com (Ashwin) wrote in message news:<b28d4abb.0307132226.52ce693e@posting.google.com>...
> nitin_hsn@yahoo.com (Nithin) wrote in message news:<96e5ea15.0306251015.90a825e@posting.google.com>... > > > > I'm looking for good links to information on Fixed Point Arithmetic. > > > > > > The only good resource I could find was - > > > > > > Fixed Point Arithmetic: An Introduction - by Randy Yates > > > http://mel.interspace.dk/~sune/old-stuff/files/reading/fixed-point.pdf > > [...] > > > The effect of scaling, overflow and saturation is application specific > > ans so are ways of handling them. For general filter applications in > > fixed point point arithmetic u might want to refer the book - Advanced > > DSP (sorry i dont remember the title exactly) by Sanjit K Mitra or any > > other classical DSP book. The book has interesting references as well. > > > > u might also want search in ieee online library (free for all) > > http://ieeexplore.ieee.org. i got some useful stuff from this site for > > my research. > > Here are some general resources on FPA I was able to dig out in these weeks - > > ---------- > > Fixed Point Arithmetic > http://cnx.rice.edu/content/m11054/latest/ > > Fixed point numbers and fixed point arithmetic > http://andercheran.aiind.upv.es/~amstrad/docs/fixedpnt.html > > A Calculated Look at Fixed-Point Arithmetic > by Robert Gordon > http://www.embedded.com/98/9804fe2.htm > > Fixed-point Arithmetic > http://www.accu.org/acornsig/public/caugers/volume2/issue6/fixedpoint.html > > Fixed Point Math For Speed Freaks > http://www.mactech.com/articles/mactech/Vol.10/10.03/FixedPointMath/index.html > > Getting a Speed Boost with Fixed-Point Math > http://www.mactech.com/articles/mactech/Vol.13/13.11/Fixed-PointMathSpeed/ > > Comp.dsp FAQ: Algorithm implementation: floating-point versus fixed-point > http://www.bdti.com/faq/2.htm#211 > > ---------- > > Thanks for all your help on this thread guys! :-) > (Thumba sahaya aythu ;-) > > > ashwin
hi thats good research work. as few of these article indicate, u have to be careful while choosing your fixed point format and handling problems thereof. These things are usually application specific. Eg: Generally saturation is used as a solution for overflow in many recursive algorithms in oder to avoid complications associated with scaling. The articles u indicated do give an overview what it is all about. good ones to start with indeed. -Nithin ("sahaya madode nam kelsa ":-))