The same two's complement N-bit word may represent an integer value or a fractional value. The same arithmetic and logic hardware may be used with either format. We just interpret the results differently.(1)
For N = 16 bits, 2N-1 = 32768
1.15(Q15) Signed Fractional Format
To understand how Q15 numbers are handled, let's assume we have a 16-bit integer in 2's complement format where s is a sign bit and an is the digit at bit n.(3)
For a positive integer a, the value of the number a is:(4)
For a Q15 number, the weightings of each bit change. Let b = a / 215, then the value of a positive Q15 number b is:(5)
The maximum negative value that can be handled is 0x8000 = -1.000000000000 and the maximum positive value is 0x7FFF = 0.999969482422. Zero is represented by 0x0000.