Mike Harrison wrote: > Do you _really_ need floating point ? Couldn't you use fixed point ? > remember floating point gives range, not precision - very few things > that embedded apps do require > enough range to justify FP. > > You may need to spend a little time looking at ranges of vars to > determine where to put the fixed > point (which may vary for different variables), but you will save a lot > of code/ data space and > time.. I agree he should examine his requirements carefully. Very likely he doesn't really need 32 bit floating point. However, I disagree that fixed point necessarily saves data space over floating point. The main advantage of fixed point is that arithmetic manipulations are usually simpler and therefore faster. The constant precision accross the whole range can also sometimes be an advantage. However, this can also be a disadvantage in that a large number of bits may be required to satisfy the minimum accuracy at the low end but still be able to represent the largest numbers of the dynamic range. Especially in intermediate calculations where multiplacation factors and the like are not well known until run time, this can force large fixed point representation. For example, 32 bit fixed point may be necessary even though only 10 bit accuracy is ultimately required. Another major disadvantage of fixed point is the manual nature of tracking the scale factors implicit in each number. Good documentation helps, of course, but it's still more error prone and harder to maintain than floating point. I'm not saying that floating point is generally the better answer. I definitely use fixed point more often than floating point because most calculations are "simple". I just didn't want to let the statement stand that fixed point inherently takes less space because it often doesn't. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads