Years ago minicomputer manufacturers supplied a software "floating-point package" that let programmers work with floating-point numbers. The PDP-8 family of minicomputers, circa 1970, used 12-bit words and a floating-point value required three of them; one for an exponent and sign, and two for the mantissa and its sign. Special op codes identified basic math operations and a square and square-root function. If you wanted anything else, you were on your own.

Today's programmers and engineers have it easy by comparison because many microprocessor and microcontroller families include floating-point math operations as a matter of course.

Atmel, for example, recently announced several new microcontrollers in the 32-bit UC3 family will include a floating-point unit (FPU) that can handle single-precision values. The addition of an FPU might let you eliminate a signal-processing chip from a design or greatly simplify software that previously used fixed-point or integer values. The AVR32 Studio already can handle floating-point values, so there's no need to buy new development tools or upgrade them. According to an engineer at Atmel, "The only difference in the AVR UC3 Toolchain is that now the CPU can perform operations on floating point numbers in a single cycle. In the past, this involved library functions that required hundreds of instructions."

 

Single-precision floating-point math means you can operate with values between 1 x 10-38 and 1 x 10+38. And Atmel's FPU complies with the IEEE 754 standard. So, a single-precision value use one bit for the sign (+ or -) of the value, eight bits for an exponent (-126 to +127), and 23 bits for the numerical value. Compliance with the IEEE standard ensures the proper representation of values, independent of CPU or FPU architecture, proper rounding of values, and the correct handling of exceptions, such as an attempt to divide a value by zero. It also lets programmers take advantage of many code libraries and proven algorithms such as those created in MatLab.

But floating-point information can create a debugging problem: How do you examine FP values when debugging?  I don't know of any MCU development tools that can "watch" or "trace" floating point information and present it in a form we humans can read.  I'd rather see 4.389 x 105 than a long string of binary or hexadecimal values. If you know of development tools that can display FP values in scientific or engineering format, please let us all know. --Jon Titus

Addendum:  FPU Benchmarks

The Embedded Microprocessor Benchmark Consortium (EEMBC) plans to create benchmarks that will track the performance of embedded processors with floating-point unit (FPU) hardware.  The new benchmarks will let people evaluate FPU performance based on consistent and controlled data.

Examples of the real-world applications that the forthcoming FP suite will likely address include DSP filtering, audio encoding, video encoding, and motor control. According to the EEMBC, the suite might also include a series of generic kernels such as bi-cubic filtering and fast Fourier transforms (FFTs), which are particularly revealing of FPU performance. Likewise, the benchmarks will measure the performance difference between single-precision (32-bit) and double-precision (64-bit) floating-point operations.

The EEMBC floating-point working group seeks contributions of benchmark kernels from engineers and programmers in industries that use embedded systems. For more information, please contact Markus Levy, EEMBC president (www.eembc.org).

References:

For an overview of floating-point numbers, visit: en.wikipedia.org/wiki/IEEE_754-2008.

I also recommend Michael L. Overton's book, "Numerical Computing with IEEE Floating Point Arithmetic," Society for Industrial and Applied Mathematics, Philadelphia, PA. 2001.

    |  Link Link to This Post

1 Response so far »

  1. 1
    cheapestgucci

Post a Comment: