IQmath Library
C2000 Microcontroller Workshop - Numerical Concepts 8 - 25
16 vs. 32 Bits
The "IQmath" approach could also be used on 16-bit numbers and for many problems, this is suf-
ficient resolution. However, in many control cases, the user needs to use many different "Q" val-
ues to accommodate the limited resolution of a 16-bit number.
With DSP devices like the TMS320C28x processor, which can perform 16-bit and 32-bit math
with equal efficiency, the choice becomes more of productivity (time to market). Why bother
spending a whole lot of time trying to code using 16-bit numbers when you can simply use 32-bit
numbers, pick one value of "Q" that will accommodate all cases and not worry about spending
too much time optimizing.
Of course there is a concern on data RAM usage if numbers that could be represented in 16 bits
all use 32 bits. This is becoming less of an issue in today's processors because of the finer tech-
nology used and the amount of RAM that can be cheaply integrated. However, in many cases,
this problem can be mitigated by performing intermediate calculations using 32-bit numbers and
converting the input from 16 to 32 bits and converting the output back to 16 bits before storing
the final results. In many problems, it is the intermediate calculations that require additional ac-
curacy to avoid quantization problems.