Fractional Q Formats
A.2 Fractional Q Formats
Unless specifically noted, DSPLIB functions use Q15 format, or to be more exact, Q0.15. In a Qm.n format, there are m bits used to represent the two’s complement integer portion of the number, and n bits used to represent the two’s complement fractional portion. m+n+1 bits are needed to store a general Qm.n number. The extra bit is needed to store the sign of the number in the
For example, the most commonly used format is Q.15. Q.15 means that a
A.2.1 Q3.12 Format
Q.3.12 format places the sign bit after the fourth binary digit from the right, and the next 12 bits contain the two’s complement fractional component. The approximate allowable range of numbers in Q.3.12 representation is (−8,8) and the finest fractional resolution is 2−12 = 2.441 × 10−4.
Table A−1. Q3.12 Bit Fields
Bit | 15 | 14 | 13 | 12 | 11 | 10 | 9 | … | 0 |
|
|
|
|
|
|
|
|
|
|
Value | S | I3 | I2 | I1 | Q11 | Q10 | Q9 | … | Q0 |
A.2.2 Q.15 Format
Q.15 format places the sign bit at the leftmost binary digit, and the next 15 leftmost bits contain the two’s complement fractional component. The approximate allowable range of numbers in Q.15 representation is (−1,1) and the finest fractional resolution is 2−15 = 3.05 × 10−5.
Table A−2. Q.15 Bit Fields
Bit | 15 | 14 | 13 | 12 | 11 | 10 | 9 | … | 0 |
|
|
|
|
|
|
|
|
|
|
Value | S | Q14 | Q13 | Q12 | Q11 | Q10 | Q9 | … | Q0 |
Performance/Fractional Q Formats |