steve wrote:>... snip ...> > The whole point of BCD is that it is able to represent any decimal > number exactly, of course that doesn't eliminate division rounding > problems it just changes where they occur. For instance, how do you > divide $1 among three people? But that is a real world money problem > that has to be resolved in the real world so the BCD model is > appropriate for the financial world. My point was this has nothing to > do with fixed vs floating point math.No based numeral system can represent all numbers exactly. All can represent integers exactly. You can always find a divisor that is prime wrt the base. -- <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt> <http://www.securityfocus.com/columnists/423> <http://www.aaxnet.com/editor/edit043.html> <http://kadaitcha.cx/vista/dogsbreakfast/index.html> cbfalconer at maineline dot net -- Posted via a free Usenet account from http://www.teranews.com
Will ADI ever make DSCs?
Started by ●June 11, 2007
Reply by ●June 14, 20072007-06-14
Reply by ●June 14, 20072007-06-14
steve wrote:> On Jun 13, 11:06 pm, Jerry Avins <j...@ieee.org> wrote: >> steve wrote: >> >> ... >> >>> isn't the financial problem a base 2 vs base 10 problem, not a fixed >>> vs float problem >> No. An integer is an integer. Changing the representation base doesn't >> change the number. >> >> Jerry >> -- >> Engineering is the art of making what you want from things you can get. >> ����������������������������������������������������������������������� > > No, I am referring to binary math (implicit in modern processors) and > BCD math (commonly used by calculators) and the methods used to > represent the number (for instance strings in BCD). You can have fixed > point BCD or floating point BCD, just like you can have fixed point > base 2 math and floating point base 2 math. > > The whole point of BCD is that it is able to represent any decimal > number exactly,No. It can represent a number with a finite number of decimal digits exactly. So what? Most numbers are irrational and many others are repeating decimals. The only finite fractions exactly representable in base 10 have denominators factorable into powers of 2 and 5.> of course that doesn't eliminate division rounding > problems it just changes where they occur. For instance, how do you > divide $1 among three people? But that is a real world money problem > that has to be resolved in the real world so the BCD model is > appropriate for the financial world. My point was this has nothing to > do with fixed vs floating point math.Or, in general, with the representation base. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply by ●June 14, 20072007-06-14
On Jun 14, 12:03 pm, Jerry Avins <j...@ieee.org> wrote:> > The whole point of BCD is that it is able to represent any decimal > > number exactly, > > No. It can represent a number with a finite number of decimal digits > exactly.if you going to the general case why are you limiting BCD to finite numbers? So what? Most numbers are irrational and many others are> repeating decimals. The only finite fractions exactly representable in > base 10 have denominators factorable into powers of 2 and 5.with fixed vs floating point math.> > Or, in general, with the representation base. >in general, yes, but we are not talking in general, the topic is practical usage of different representation, and how it's specific rounding errors are pertinent (or not) to the application at hand
Reply by ●June 14, 20072007-06-14
steve wrote:> On Jun 14, 12:03 pm, Jerry Avins <j...@ieee.org> wrote: > >>> The whole point of BCD is that it is able to represent any decimal >>> number exactly, >> No. It can represent a number with a finite number of decimal digits >> exactly. > > if you going to the general case why are you limiting BCD to finite > numbers?Because those are the only ones that fit on a printout or be represented in core. Infinitely long numbers are unrepresentable in any base.> So what? Most numbers are irrational and many others are >> repeating decimals. The only finite fractions exactly representable in >> base 10 have denominators factorable into powers of 2 and 5. > with fixed vs floating point math. >> Or, in general, with the representation base. >> > in general, yes, but we are not talking in general, the topic is > practical usage of different representation, and how it's specific > rounding errors are pertinent (or not) to the application at handIt takes only a few extra bits to make the rounding epsilon as small as needed. 24 bits represent 999,999 in BCD, but fewer that 20 in binary. The extra 4 bits go a long way toward mitigating any inaccuracy due to rounding. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply by ●June 15, 20072007-06-15
On Tue, 12 Jun 2007 13:21:25 -0700, steve <bungalow_steve@yahoo.com> wrote:>On Jun 12, 4:16 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote: > >> To me, a better question is why you want floating point at all? > >if the resources are available, why would you ever not want to use >floating point? > >Integer/fixed point math is purely a artifact of resource limited >architectures (driven by cost, size, and power constraints) >I think you have it the wrong way round. Floating point is an artifact of resource limited architectures. Fixed point with enough bits have all the precision and resolution that floating point have, without all of the disadvantages of floating point. In yesteryears systems, it was very important to save RAM, today with multigigabyte memories on home PCs, using 256 bits or more for fixed point representation is not a problem. Regards Anton Erasmus
Reply by ●June 15, 20072007-06-15
Anton Erasmus <nobody@spam.prevent.net> wrote in news:4ns5739vj43a2hpl3numvntsjbpimk94ea@4ax.com:> On Tue, 12 Jun 2007 13:21:25 -0700, steve <bungalow_steve@yahoo.com> > wrote: > >>On Jun 12, 4:16 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote: >> >>> To me, a better question is why you want floating point at all? >> >>if the resources are available, why would you ever not want to use >>floating point? >> >>Integer/fixed point math is purely a artifact of resource limited >>architectures (driven by cost, size, and power constraints) >> > > I think you have it the wrong way round. Floating point is an > artifact of resource limited architectures. Fixed point with enough > bits have all the precision and resolution that floating point have, > without all of the disadvantages of floating point. In yesteryears > systems, it was very important to save RAM, today with multigigabyte > memories on home PCs, using 256 bits or more for fixed point > representation is not a problem. > > Regards > Anton Erasmus > > >There are plenty advantages to floating point. Floating point is a good choice when dealing with large dynamic range. It makes scaling easy. Its much easier to create an rms detector or perform FFTs. Flaoting point building blocks are easy to connect together since you don't have to worry about overflow/underflow in most cases. Fixed point typically offers better precision. I prefer it for IIR filtering. In my view (we do build SHARC based products), the best choice is often a processor that does both well. Yopu then pick the format that makes the most sense for the situation. This reduces developement time which for our customers is often the most important factor. -- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com
Reply by ●June 15, 20072007-06-15
Anton Erasmus wrote: (snip)> I think you have it the wrong way round. Floating point is an > artifact of resource limited architectures. Fixed point with enough > bits have all the precision and resolution that floating point have, > without all of the disadvantages of floating point. In yesteryears > systems, it was very important to save RAM, today with multigigabyte > memories on home PCs, using 256 bits or more for fixed point > representation is not a problem.Well, that is true. In scientific and engineering problems many quantities have a relative uncertainty. The mass of the earth, about 5.9742e24 kg, is known to about 1 part in 10000. The mass of an electron, 9.10938215e-31 kg, is known to about 5 parts in 10**8. There is a factor of about 1e55 between the two, and the smaller one is known more accurately relative to its size. Most mass measurements will have a relative uncertainty somewhere between the 1 in 1e4 and 5 in 1e8 shown above, over a wide range (55 orders of magnitude) shown above. It is quantities like mass, where the uncertainty is, more or less, relative to the size that floating point is designed for. It would take about 200 bits of fixed point to cover the range between the electron mass and earth mass. Next consider that one might need to multiply two such quantities, maybe a mass and length both of which could vary over many orders of magnitude and have similar relative uncertainty. The product of two 200 bit values will require 400 bits, where the relative uncertainty of the product will be a little more than the relative uncertainty of the quantities being multiplied. Floating point has a big advantage for quantities that can vary over many orders of magnitude and have a relative uncertainty that doesn't very so much, and is much smaller than the range of values, and when such are multiplied or divided. Quantities where the uncertainty stays approximately the same, and tend to vary over a smaller range of magnitude, as financial and typesetting calculations do, are better done in fixed point. I expect my bank balance to be computed to the cent when I have $1 or $1,000,000 in my account. -- glen
Reply by ●June 15, 20072007-06-15
Al Clark wrote: (snip)> There are plenty advantages to floating point. Floating point is a good > choice when dealing with large dynamic range. It makes scaling easy. Its > much easier to create an rms detector or perform FFTs. Flaoting point > building blocks are easy to connect together since you don't have to > worry about overflow/underflow in most cases.For FFT, which involves multiplying by fixed constants and addition, the results tend to have absolute uncertainty. A better choice might be to scale the input values based on the magnitude of the largest value, and then do fixed point arithmetic on the result. This is probably more true on processors with multiply-accumulate instructions. Still, it seems to be rarely done, partly because doing scaled fixed point isn't easy with many processors and high-level languages. -- glen
Reply by ●June 16, 20072007-06-16
On Fri, 15 Jun 2007 14:32:02 -0800, glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote:>Anton Erasmus wrote: > >(snip) > >> I think you have it the wrong way round. Floating point is an >> artifact of resource limited architectures. Fixed point with enough >> bits have all the precision and resolution that floating point have, >> without all of the disadvantages of floating point. In yesteryears >> systems, it was very important to save RAM, today with multigigabyte >> memories on home PCs, using 256 bits or more for fixed point >> representation is not a problem. > >Well, that is true. > >In scientific and engineering problems many quantities >have a relative uncertainty. The mass of the earth, >about 5.9742e24 kg, is known to about 1 part in 10000. >The mass of an electron, 9.10938215e-31 kg, is known >to about 5 parts in 10**8. There is a factor of about >1e55 between the two, and the smaller one is known more >accurately relative to its size. Most mass measurements >will have a relative uncertainty somewhere between >the 1 in 1e4 and 5 in 1e8 shown above, over a wide range >(55 orders of magnitude) shown above. It is quantities >like mass, where the uncertainty is, more or less, >relative to the size that floating point is designed for. > >It would take about 200 bits of fixed point to cover the >range between the electron mass and earth mass.That could still be handled with the 128.128 bit fixed point representation I proposed in an other post. While it is quite rare to have real word signals that would require more than about 20 bits (maybe 24 bits with audio+attenuator settings) there are still situations, in which the floating point representation will bite you. If you take samples every microsecond and do summations since system startup (which might be a few years ago), the ordinary 32 bit floating point representation is clearly inadequate, unless you do some intermediate summations e.g. every millisecond, second, hour and month. Paul
Reply by ●June 16, 20072007-06-16
On Fri, 15 Jun 2007 21:22:22 GMT, Al Clark <aclark@danvillesignal.com> wrote:>Anton Erasmus <nobody@spam.prevent.net> wrote in >news:4ns5739vj43a2hpl3numvntsjbpimk94ea@4ax.com: > >> On Tue, 12 Jun 2007 13:21:25 -0700, steve <bungalow_steve@yahoo.com> >> wrote: >> >>>On Jun 12, 4:16 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote: >>> >>>> To me, a better question is why you want floating point at all? >>> >>>if the resources are available, why would you ever not want to use >>>floating point? >>> >>>Integer/fixed point math is purely a artifact of resource limited >>>architectures (driven by cost, size, and power constraints) >>> >> >> I think you have it the wrong way round. Floating point is an >> artifact of resource limited architectures. Fixed point with enough >> bits have all the precision and resolution that floating point have, >> without all of the disadvantages of floating point. In yesteryears >> systems, it was very important to save RAM, today with multigigabyte >> memories on home PCs, using 256 bits or more for fixed point >> representation is not a problem. >> >> Regards >> Anton Erasmus >> >> >> > >There are plenty advantages to floating point. Floating point is a good >choice when dealing with large dynamic range. It makes scaling easy. Its >much easier to create an rms detector or perform FFTs. Flaoting point >building blocks are easy to connect together since you don't have to >worry about overflow/underflow in most cases.There are numerous things to worry about when using floating point. The misconception that one do not have to worry about things is it's biggest disadvantage. In floating point: If one has a big number y, and a very small number x, both of which can be represented in floating point, then there is a whole range of numbers where x+y=y. In fixed point, if one has the range to represent y, and the precision to represent x, then x+y=x+y. The biggest problem with fixed point is that almost none of the available languages todat supports it. C should have had a "real" number type, where one could choose whether one wants this "real" number type to be represented in floatin point, or fixed point. i.e. typedef real float, or typedef real double, or typedef real fixed64.64>Fixed point typically offers better precision. I prefer it for IIR >filtering.Fixed point offers consistent precision over it's range. All posible bit patterns are also legal numbers. In floating point a very high percentage of bit patterns are not legal floating point numbers. The fact that the precision also varies over it's range can cause a lot of numeric instability and plain wrong answers when doing calculations.> >In my view (we do build SHARC based products), the best choice is often a >processor that does both well. Yopu then pick the format that makes the >most sense for the situation. This reduces developement time which for >our customers is often the most important factor.The effort that has been put into modern floating point hardware has made it very fast. If a 10th of the effort had been put into fixed point hardware, it would beat floating point by quite a margin IMO. The only real technical reason I can see for having floating point, is to save memory. If memory is not a problem, one can use as many bits as needed for the range, and as many bits as needed for the precision. Regards Anton Erasmus






