What's Q13.18 format for many function parameters?
Qm.n formatSeveral of the primitives require a fractional interpretation of the integer input and/or output arguments. The Qm.n format provides a standard mechanism for representing fractional values using an integer data type. For example, a Q3.4 word is illustrated in Figure 1-1. The integer binary word has been partitioned using an imaginary fixed point. The n-bits to the right of the imaginary point comprise the fractional portion of the value being represented, and these n-bits act as weights for negative powers of 2. The m-bits to the left of the imaginary point comprise the integer portion of the value being represented, and these m-bits act as weights for positive powers of 2. The overall signed Qm.n representation requires a total of m+n+1 bits, with the additional bit required for the sign. As shown in Figure 1-1, the Q3.4 word requires a total of 3+4+1 = 8 bits. The dynamic range for the Q3.4 word spans the open interval [-8, 8), and the precision (or quantization error) is 1/16. The value represented by a particular set of Q3.4 bits is given by the adding up the weighted powers of 2: see picture attached.