Figure.1. Sample Fixed Point Representation

Figure.1. Sample Fixed Point Representation

As the terms fixed and floating point indicates, the fundamental difference between the two types is in their respective numeric representations of data. While fixed point arithmetic performs strictly integer arithmetic, floating-point arithmetic support either integer or real arithmetic, the latter normalized in the form of scientific notation.

Fixed Point Arithmetic follows integer like representation of all numbers including both integer and real numbers. It assumes that the least significant bit is some negative power of 2 (1/2, 1/4, 1/8 etc.). The binary point is assumed to be in the middle of the number and not after the least significant bit. Applications can adjust their precision and range by moving the binary point. If a fixed point number has:

M-bits of integral precision and N-bits of fractional precision, it is called a M.N number. 

For example, if an application requires the numbers to be represented in the fixed point format 8.8 that means the application requires 8 bits of integral precision and 8 bits of fractional precision. Similarly we can have fixed point representation in formats of 4.12, 16.16, 8.24 etc. Fixed point representation allows fractional values to be represented only using integer arithmetic. It is simple to use and understand. This representation allows even the real numbers to be added and subtracted just like integers. Multiplication and division also follows the same convention as that for the corresponding integral arithmetic.                                    

By contrast, floating point arithmetic divides a 32-bit data word into two parts: a 24-bit mantissa that can be used either for integer values or as the base of a real number, and an 8-bit exponent. The 16M range of precision offered by 24 bits with the addition of an 8-bit exponent allows it to support a vastly greater dynamic range than is available with the fixed-point format. This is known as the IEEE 754 32-bit single precision representation. The most significant bit of the mantissa can also be used to represent a sign bit for doing signed arithmetic. 

There are a lot of factors which has to be considered when choosing a particular type of arithmetic for our application. The application data set can tell us which arithmetic or rather which microcontroller has to be used. Cost versus ease of use is an important deciding factor as well. The much greater computational power and numeric range offered by floating point arithmetic is normally the critical element in the fixed or floating point design decision. However, historically when the first floating point based controllers were released into the market other factors tended to obscure the fundamental mathematical issue. Floating point functions require more internal circuitry, and the 32-bit data paths were twice as wide as those of fixed point microcontrollers, which at that time integrated only a single 16-bit data path. These factors, plus the greater number of pins required by the wider data bus, meant a larger die and larger package that resulted in a significant cost premium for the new floating point devices. Fixed point microcontrollers, therefore, were favored for high-volume applications where unit manufacturing costs had to be kept low.

Offsetting the cost issue at that time was ease of use. Floating point microcontrollers were among the first microcontrollers to support the C language, while fixed point microcontrollers still needed to be programmed at the assembly code level. In addition, real arithmetic could be coded directly into hardware operations with the floating point format, while fixed point devices had to implement real arithmetic indirectly through software routines that added development time and extra instructions to the algorithm. Because floating point microcontrollers were easier to program, they were adopted early on for low volume applications where the time and cost of software development were of greater concern than unit manufacturing costs. 

Today the early differences in cost and ease of use, while not altogether erased, are considerably less pronounced. Scores of transistors can now fit into the same space required by a single transistor a decade ago, leading to SOC integration that reduces the impact of a single microcontroller core on die size and expense. Floating point accuracy provides visibility into code execution. The advantage of implementing real arithmetic directly in floating point hardware still remains; but today advanced mathematical modeling tools, comprehensive libraries of mathematical functions and off-the-shelf algorithms reduce the difficulty of developing complex applications—with or without real numbers—for fixed-point devices. Overall, fixed point microcontrollers still have an edge in cost and floating point microcontrollers in ease of use, but the edge has narrowed until these factors should no longer be overriding in the design decision.

As the cost of floating point microcontrollers has continued to fall, the choice of using a fixed or floating point microcontrollers boils down to whether floating point math is needed by the application data set. In general, designers need to resolve two questions: What degree of accuracy is required by the data set and how predictable is the data set? The greater accuracy of the floating point format results from three factors. First, the 24-bit word width in floating point microcontrollers yields greater precision than the 16-bit fixed point word width, in integer as well as real values. Second, exponentiation vastly increases the dynamic range available for the application. A wide dynamic range is important in dealing with extremely large data sets and with data sets where the range cannot be easily predicted. Third, the internal representations of data in floating point microcontrollers are more exact than in fixed point, ensuring greater accuracy in end results. But in floating point arithmetic a designated hardware has to be used which results in a slower performance as compared to the fixed point arithmetic.

 

This free website was made using Yola.

No HTML skills required. Build your website in minutes.

Go to www.yola.com and sign up today!

Make a free website with Yola