Main Content

Have you been using float or double variables to perform mathematical operations on embedded systems without a Floating-Point Unit (FPU)? You are doing it wrong! Thats incredibly inefficient. Use fixed-point representation instead. An FPU is an hardware block specially designed to carry on arithmetic operations on floating point numbers. Even though the C/C++ code may work without an FPU, its always much faster to use hardware designed for a specific purpose, like this one, instead of relying on a software implementation, something that the compiler will do for you, knowing the hardware restrictions you have but not in an efficient manner. Essentially, it will generate a lot of assembly code, greatly increasing the size of your program and the amount of time required to complete the operation. Thus, if you dont have an FPU available and you still want to perform those arithmetic operations efficiently youll have to convert those numbers to fixed-point representation. Integers! But how? By scaling them. Lets see how that scaling value may be determined.”

Link to article