Fixed-point Data (Q) Format

Intel IPP for Microcontrollers functions operate on fixed-point data in Q format.

In the Qn data format, n represents the number of bits used to designate the fractional portion of the number, or the number of bits to the right of the binary point. It means that a value represented as X in a regular (not fixed-point) data format, is equal to X*2-n in the Qn format.

For example:

  • X in the Q15 format is X*2-15, with the range of supported values for the Ipp16s data type equal to [1, 1-2-15].

  • X in the Q31 format is X*2-31, with the range of supported values for the Ipp32s data type equal to [1, 1-2-31].

The Q format can additionally specify the number of integer bits. It is assumed that the sign bit is always present. For example, a Q31 number has 1 sign bit and 31 fractional bits, 32 bits in total; a Q34.30 number has 1 sign bit, 33 integer bits and 30 fractional bits, 64 bits in total. Unlike floating point numbers, the resolution of Q numbers does not change over the entire range.

For more complete information about compiler optimizations, see our Optimization Notice.