Skip to main content

Providing Standardized Fixed-Point Arithmetics for Embedded C Programs

  • Chapter

Part of the book series: Lecture Notes in Electrical Engineering ((LNEE,volume 38))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   129.00
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   169.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD   169.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. ISO/IEC, Programming Languages – C, approved by ANSI Accredited Standards Committee, ISO/IEC 9899:1999, December, 1999.

    Google Scholar 

  2. IEEE, Standard for Binary Floating-Point Arithmetic, ANSI/IEEE Std 754-1985; IEC-60559:1989, 1985.

    Google Scholar 

  3. Altera Corporation, USA. Nios II Processor Reference Handbook Version 7.0, 2007

    Google Scholar 

  4. 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.

    Google Scholar 

  5. ISO/IEC, Programming languages – C – Extensions to support embedded processors, ISO/IEC TR 18037:2008, JTC 1/SC 22, 2008.

    Google Scholar 

  6. P. Puschner, Worst-case execution time analysis at low cost, Control Engineering Practice, 6:129–135, January 1998.

    Article  Google Scholar 

  7. D. Goldberg, What every computer scientist should know about floating-point arithmetic, ACM Computing Surveys, 23(1):5–48, March, 1991.

    Article  Google Scholar 

  8. IEEE, Standard for Radix-independent Floating-point Arithmetic, ANSI/IEEE Std 854-1987, October 1987.

    Google Scholar 

  9. 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.

  10. 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}.

    Google Scholar 

  11. J.E. Volder, The CORDIC trigonometric computing technique. IRE Transactions on Electronic Computers, EC-8(3), 9, 1959.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics