This module regroups the options used to configure the signed fixed point Q format.
Here is a description of the Q-Format:
Q-format: Qa.b
Here is the formula linking a Q-format number (x) to a decimal number (d):
The resolution of a Q-formatted number is calculated as follow:
Example:
For the Q1.15 type:
For the Q1.31 type:
Here is a link where you can find more information http://en.wikipedia.org/wiki/Fixed-point_arithmetic on fixed-point formats.
Q Format definition for the 16-bit type | |
| |
#define | DSP16_QA 1 |
number of integer bits | |
#define | DSP16_QB 15 |
number of fractional bits | |
Q Format definition for the 32-bit type | |
| |
#define | DSP32_QA 1 |
number of integer bits | |
#define | DSP32_QB 31 |
number of fractional bits |
#define DSP16_QA 1 |
#define DSP16_QB 15 |
number of fractional bits
Definition at line 144 of file dsp_types.h.
Referenced by dsp16_op_div(), and dsp16_op_mul().
#define DSP32_QA 1 |
#define DSP32_QB 31 |
number of fractional bits
Definition at line 174 of file dsp_types.h.
Referenced by dsp32_op_div(), and dsp32_op_mul().