Floating-point numbers.
Floating-point numbers—of the type A x 10<sup>B</sup>—are so named because in this numerical representation the decimal point of the first part of the number (A, the “mantissa” or “significant”) can float freely; it can be placed anywhere, depending on what best suits the calculations to be performed, and the value of the exponent (B) can be adjusted to keep the magnitude of the entire number constant. See Figure 1: 1.234 x 10<sup>6</sup> is identical to 1234 x 10<sup>3</sup>. The most widespread practice is to present—and store—numbers in a standardized format with the decimal point located after the first non-zero digit.


For the engineer working with digital representations of real-world signals—such as high-quality audio—much of the value of using floating-point mathematics for processing lies not only in the freedom to place the decimal point anywhere, but also in the variety of numbers the notation can represent. The standard most frequently used in signal processing and calculation is IEEE 754, and within it, the so-called single-precision number can have a value belonging to a (decimal) range of approximately -10<sup>39</sup> to +10<sup>39</sup>. Floating-point notation is a whole subject in itself, and an internet search on it, or on IEEE 754, will yield far more detailed information than most non-mathematicians would assume, including the binary storage of numbers, the handling of “special” numbers—such as zero—and detailed distinctions between floating-point, fixed-point, and integer arithmetic.


Regardless of where the number falls within the range, the mantissa portion always has approximately 23-bit resolution, making it well-suited to signal content such as 24-bit audio.


Maintaining Signal Fidelity:
The fundamental challenges faced by engineers when designing an audio signal chain may not have changed since the shift from the analog to the digital realm. Audio signals have large dynamic ranges containing information critical for faithful content reproduction that must be protected at both ends of the signal range: the loudest and the quietest. Along the audio signal path, the signal can be filtered, mixed, leveled, or amplified at multiple processing steps. When design work was in the analog domain, the designer had to continuously monitor signal levels to ensure they remained above the noise floor, while also ensuring that content peaks did not approach the amplifiers' maximum levels too closely; there was always a risk of losing information by adding noise at the low end or clipping peaks.

Utilization2A similar situation arises when the signal is handled within the digital domain. The data values ​​representing the content must fall within a defined range of numbers to prevent information loss, whether due to overload or corruption. Numerous stages in signal processing, especially filtering, require successive mathematical operations—primarily multiplications—which can vary the absolute value of the data over very wide ranges. When the range of numbers is limited, special care must be taken to ensure that the "variable window" of relative values—in the case of audio content, from loudest to quietest—remains within the available range; in the analog domain, above the noise floor but below the power rail voltage.


Traditionally, digital signal processing devices that employ floating-point arithmetic have been significantly more expensive than their fixed-point counterparts. A common approach has been to develop an initial version of a signal processing project in a floating-point environment, allowing numerical values ​​to freely assume any value within the vast available numerical space. Once the algorithms are functioning according to specification, the prototype is converted to lower-cost fixed-point hardware. Part of this process involves inspecting the numerical values ​​generated by the working product along the signal chain and introducing scaling factors at appropriate points to keep values ​​within usable ranges. The opposite approach is also valid: project managers may choose to introduce designs to more expensive target hardware to shorten and reduce the costs of the development process.


Process technology allows FPUs to be small.
The two methods described above are based on the premise that floating-point coprocessors consume a large silicon area, which increases the cost of the devices. However, current silicon fabrication technology means that this is no longer necessarily true. It is now possible to combine a 32-bit microprocessor core—of the type found in a mid-range microcontroller—with a fully IEEE754-compliant floating-point unit in a cost-effective unit. For example, Atmel's AVR UC3 microcontrollers already offer very high performance for digital signal processing, with support for both fixed-point and integer arithmetic. The addition of a single-precision floating-point unit changes the options available to designers in several ways.

Utilization diagramThe first advantage, stemming from the aforementioned observations on floating-point number systems, is the elimination of many concerns regarding number ranges and scales. Through successive steps in the process, and given the vast available range, the signal value can (to a large extent) take on any absolute value required; the essential information—the signal's dynamic range—will always be contained within the 24-bit fractional representation of the floating-point number's mantissa. This eliminates the need to constantly monitor the scale to keep the number within limits.
The advantages of an on-chip FPU, however, extend beyond simple design freedom; performance is also enhanced because the FPU can perform operations like precision multiplication and division in just a few clock cycles, operations that consume many tens of cycles on a non-augmented core. In AVR UC3 devices, the FPU executes most 32-bit floating-point instructions in a single cycle, and a 32-bit multiplier-and-accumulate in two clock cycles, compared to the 30–50 cycles required to complete the same arithmetic operation without an FPU. This increased performance can be leveraged to greatly increase the amount of signal processing a microcontroller can perform, or it can represent a significant reduction in the power required to achieve a given output.
MCU + FPU equates to a broader application space


There are numerous examples of mission-critical system designs where code must meet real-time deadlines and leverage the ability to perform high-precision calculations in just a few CPU cycles. Automotive power transmission is one such case; an engine management unit must handle sensor inputs with very large dynamic ranges, but the time available to complete each computation cycle is entirely determined by the engine's rotational speed. Similar constraints apply to systems like ABS (anti-lock braking system) or active suspension. In precise electric motor control, the ability to handle large ranges of numbers is also valuable because the algorithms require the sequential application of numerous complex transformations without data loss due to breakage; however, once again, the computation time is determined by the motor's rotational period. In these cases, both accuracy and speed represent valuable advantages. The digital signal processing using FFT (Fast Fourier Transform) is a familiar example for many engineers who face problems that can be solved thanks to the acceleration provided by floating-point mathematical calculations. In another application area, graphics and editing systems, the visual quality of the results depends on the precise geometric calculations that enable the display of graphic textures and printed fonts. In this case, there might be fewer real-time limitations, but the system's performance and efficiency directly reflect the FPU's ability to execute calculations in fewer cycles. Each of these sectors has traditionally had access to floating-point calculations, but designers working with microcontroller cores, in general, have not.

Utilization3The availability of floating-point arithmetic in this type of processor alters the dynamics of device selection for many types of designs, particularly in consumer audio devices. The audio signal chain clearly demonstrates the advantage a floating-point architecture offers designers. In many cases—probably most—the signal source will be a digital representation that is converted into the required numerical format in just a few cycles. At the end of the signal chain, it is returned to the analog domain of the real world; after normalization (an operation performed in a single cycle), a D/A converter is applied to the fractional numbers as represented in the mantissa, which contains all the necessary data. Any deviation the signal may have experienced within the entire range of floating-point numbers is simply discarded; the exponent is not used, and maximum precision is maintained throughout the process.


Designers working on signal capture and processing in other environments—such as industrial systems or medical instrumentation—who also need to perform multiple processing steps on data and require a wide dynamic range will find that integrating a general-purpose microcontroller core with an FPU changes their options. Previously, a signal path with floating-point processing inevitably involved combining a microprocessor or microcontroller with a dedicated DSP, with its associated costs, size, and power consumption implications. The option of basing the entire design on a DSP was often dismissed because the DSP lacked the capability to handle the control functions required by the project.


Conclusion:
Markets typically associated with microcontrollers—where factors such as ease of connection to external signals and events, low cost, and limited energy consumption have been dominant—had not previously had access to floating-point mathematical calculations.


The term FPU itself has carried connotations such as complexity, high-end, and often DSP-based systems. In fact, now that advances in process technology have made FPUs accessible to a much wider range of projects, engineers can take advantage of the computational precision, wide dynamic range, and simplified coding that floating-point mathematical calculations provide.

Author: Haakon Skar, AVR Marketing Director, Atmel.

More information or a quote