Home / Learn Embedded C / Fixed-Point Math on MCUs Without an FPU
Fixed-Point Math on MCUs Without an FPU
Representing fractional values using scaled integers, on chips lacking hardware floating-point support.
How to think about this
What it is
Fixed-point math represents a fractional value as a scaled integer (like storing "1.5" as the integer 1500 with an implied scale of 1000, or using specific bit positions for the fractional part), letting chips without a hardware floating-point unit (FPU) still do fractional arithmetic efficiently using only integer operations.
Why it matters
Many simpler/cheaper microcontrollers (including many AVR chips and some Cortex-M0 variants) lack a hardware FPU — floating-point operations there are emulated in software, which is often far slower than native integer math; fixed-point is the standard technique to get fractional-value behavior without that cost.
Mechanically speaking
Choosing the right scale factor (how many bits/decimal digits of fractional precision) is a genuine design decision: more fractional precision costs range (since the same number of bits must now represent both the integer and fractional parts), and arithmetic must consistently account for the chosen scale.
Shows up in
- FPU-less chip arithmetic
- Sensor value scaling
- Fast, predictable embedded math
Try it
Note that multiplication needed an extra division by the scale factor to keep the result at the correct fixed-point scale — addition did not.
Try it: dividing two fixed-point values
Division needs the opposite correction from multiplication: the numerator is scaled up by the scale factor first, or the result would lose its fractional precision entirely.
Check yourself
1. Why is fixed-point math commonly used on microcontrollers lacking a hardware floating-point unit (FPU)?
Software-emulated floating-point on an FPU-less chip is typically much slower than integer arithmetic; fixed-point gets fractional behavior while staying entirely within fast native integer operations.