Chapter 12. Math

When we looked at trading resources in the last chapter, you had to choose between RAM, code space, and processing cycles. Trading these resources goes only so far. Sometimes you need to make your code go faster. Not knowing what you’ll need for your system, I can still guess that you’ll need to implement some math (because that is where processors excel).

The less your system does, the fewer resources it needs to do it. Sometimes we confuse accuracy, which is important, with precision, which can go too far. If you can quantify the range of data you expect and your error budget, there are some useful methods to reduce unnecessary precision for all sorts of algorithms, thereby saving RAM and processing cycles.

Get Making Embedded Systems, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.