Skip to content
RED SAGSkills
mediumEmbedded Systems Engineer interview question

When would you use fixed-point arithmetic instead of floating point on a microcontroller?

What the interviewer wants to hear

  • MCUs without an FPU emulate float slowly in software
  • Fixed point uses integers with an implied scale, such as Q15 or milli-units
  • Faster, deterministic and smaller code on such MCUs
  • Need care with overflow, rounding and scaling
  • With a hardware FPU, single-precision float is often fine; avoid accidental double

Model answer

Many small MCUs, like Cortex-M0 or M3, have no floating-point unit, so every float operation is emulated in software, which is slow and adds code size. In those cases, or in tight control loops, I use fixed-point arithmetic: integers with an agreed scale. For example, I store temperature in hundredths of a degree, so 23.45 degrees is 2345, or use Q15 and Q31 formats for signal processing, where CMSIS-DSP provides optimised functions. Fixed point is fast and deterministic, but I must manage scaling, use wider intermediates like int64 for multiplication to avoid overflow, and choose rounding carefully. On chips with a single-precision FPU, such as Cortex-M4F, float is fast and easier to read, so I use it, but I make sure constants have an f suffix, like 0.5f, so the compiler does not silently use slow double precision.

Can you answer it under time pressure?

Take a timed medium round and get scored on every answer.

Start mock interview

More medium Embedded Systems Engineer questions