Gregory Massey
Acterna
Improvements in languages, compilers, hardware, and even standards continue to simplify the task of performing mathematical calculations in embedded systems. Even with these improvements, though, the calculations do not always perform as expected.
This paper compares the different types of machine calculationsinteger, fixed point, and floating pointin terms of versatility, accuracy and speed. It looks at the sources of errors for each type and ways to manage them. It covers type conversions, overflow effects, implementation tricks, custom integer sizes, and machine dependencies. It shows how to implement fixed point math using integers and customize it to your needs. The emphasis is on simplicity and practicality. Examples are given in "C", although the concepts apply equally well to other programming languages.
|