Abstract
The ISO/IEC Standard TR 18037 defines the syntax and semantics for fixedpoint operations for programming embedded hardware in C. However, there are currently only few compilers available that support this standard. Therefore, we have implemented a stand-alone library according to the standard that can be compiled with standard C compilers. The library is available as open source and written in plain C, thus can be used in various target architectures as long as a C compiler is available. This book chapter presents a brief description of the ISO/IEC standard and the library implementation followed by an evaluation of code size and performance of the fixed-point operations on the Atmel AVR architecture. A comparison with the standard floating-point library (which is machine code-optimized to the target architecture) shows that simple fixed-point functions such as addition, subtraction and multiplication are more efficient, while more complicate functions can only compete in the worst case behavior. The fixed-point approach provides a smaller memory foot print, for typical applications where only a small subset of functions is used. This is especially of interest for the big market of embedded microcontrollers with only a few Kbytes of program memory.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
ISO/IEC, Programming Languages – C, approved by ANSI Accredited Standards Committee, ISO/IEC 9899:1999, December, 1999.
IEEE, Standard for Binary Floating-Point Arithmetic, ANSI/IEEE Std 754-1985; IEC-60559:1989, 1985.
Altera Corporation, USA. Nios II Processor Reference Handbook Version 7.0, 2007
D.P. Magee, Matlab extensions for the development, testing and verification of real-time DSP software, In Proceedings of the 42nd Annual Conference on Design Automation, pages 603–606, San Diego, CA, USA, 2005.
ISO/IEC, Programming languages – C – Extensions to support embedded processors, ISO/IEC TR 18037:2008, JTC 1/SC 22, 2008.
P. Puschner, Worst-case execution time analysis at low cost, Control Engineering Practice, 6:129–135, January 1998.
D. Goldberg, What every computer scientist should know about floating-point arithmetic, ACM Computing Surveys, 23(1):5–48, March, 1991.
IEEE, Standard for Radix-independent Floating-point Arithmetic, ANSI/IEEE Std 854-1987, October 1987.
G. Frantz and R. Simar, Comparing fixed- and floating-point DSPs. Texas Instruments, Dallas, TX, USA, 2004. White paper available at http://ocus.ti.com/lit/ml /spry061/spry061.pdf.
M. Rosenblattl and A. Wolf, Fixed-point library according to ISO/IEC standard DTR 18037 for Atmel AVR processors, Bachelor’s thesis, Vienna University of Technology, Vienna, Austria, 2007. \url{http://sourceforge.net/projects/avrfix}.
J.E. Volder, The CORDIC trigonometric computing technique. IRE Transactions on Electronic Computers, EC-8(3), 9, 1959.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer Science+Business Media B.V.
About this chapter
Cite this chapter
Elmenreich, W., Wolf, A., Rosenblattl, M. (2009). Providing Standardized Fixed-Point Arithmetics for Embedded C Programs. In: Martínez Madrid, N., Seepold, R.E. (eds) Intelligent Technical Systems. Lecture Notes in Electrical Engineering, vol 38. Springer, Dordrecht. https://doi.org/10.1007/978-1-4020-9823-9_8
Download citation
DOI: https://doi.org/10.1007/978-1-4020-9823-9_8
Publisher Name: Springer, Dordrecht
Print ISBN: 978-1-4020-9822-2
Online ISBN: 978-1-4020-9823-9
eBook Packages: EngineeringEngineering (R0)