5.1.2.3 Q31 (1.31) Format

In Q31 format, the Most Significant bit is defined as a sign bit and the radix point is implied to lie just after the sign bit followed by the fractional value. This format is commonly referred to as 1.31 or Q31 format, where 1 is the number of bits used to represent the integer portion of the number, and 31 is the number of bits used to represent the fractional portion. The range of an N-bit two’s complement fraction with this implied radix point is -1.0 to (1 - 21-N ). For a 32-bit fraction, the 1.31 data range is -1.0 (0x80000000) to +0. 9999999995343387 (0x7FFFFFFF) with a precision of 4.656612873077393e-10.

Figure 5-1. Fractional Format (32 bits)

The following table shows the conversion of a two’s complement 32-bit integer +1610612736 to Q31 value +0.75.

Table 5-3. Conversion of a Two’s Complement 32-Bit Integer to Q31
BinaryDecQ31
00 x 2-31 0 x 200
11 x 23010737418240 x 210.5
11 x 2295368709120 x 220.25
00 x 228 0 x 230
00 x 227 0 x 240
00 x 226 0 x 250
00 x 225 0 x 260
00 x 224 0 x 270
00 x 223 0 x 280
00 x 222 0 x 290
00 x 221 0 x 2100
00 x 220 0 x 2110
00 x 219 0 x 2120
00 x 218 0 x 2130
00 x 217 0 x 2140
00 x 216 0 x 2150
00 x 215 0 x 2160
00 x 214 0 x 2170
00 x 213 0 x 2180
00 x 212 0 x 2190
00 x 211 0 x 2200
00 x 210 0 x 2210
00 x 29 0 x 2220
00 x 28 0 x 2230
00 x 27 0 x 2240
00 x 26 0 x 2250
00 x 25 0 x 2260
00 x 24 0 x 2270
00 x 23 0 x 2280
00 x 22 0 x 2290
00 x 21 0 x 2300
00 x 20 0 x 2310
SUM1610612736SUM0.75
= Radix point