The coefficients of the playback path mixers [for example, ax, bx, cx, dx and so on] are programmed as 16-bit twos-complement values, each occupying four consecutive registers in the register space of the device. These mixer coefficients are in 2.14 format which is shown in Figure 3-2, with a range from –2 (0x8000) to 1.99994 (0x7FFF).
- To convert a floating point number to the corresponding Q16 format, multiply the floating point mixer coefficient by 214 and truncate to the nearest integer.
- For positive integers, convert directly to hexadecimal format.
- For negative integers, take the absolute value of the coefficient, convert the value to binary, negate the value, add one, and convert to hex. For example, to represent -135 in 16-bit two's complement hexadecimal format:
- Absolute value of -135 is 0000 0000 1000 0111 in binary (or 0x0087 in hex)
- Negating the binary and adding 1 results in 1111 1111 0111 1001 in binary (or 0xFF79 in hex). This is the twos-complement representation of the negative integer.