
Q is a fixed point number format where the number of fractional bits (and optionally the
number of integer bits) is specified. For example, a Q15 number has 15 fractional bits; a
Q1.14 number has 1 integer bit and 14 fractional bits. Q format is often used in
hardware that does not have a floating-point unit and in applications that require
constant resolution.
Q format numbers are (notionally) fixed point numbers (but not actually a number itself);
that is, they are stored and operated upon as regular binary numbers (i.e. signed
integers), thus allowing standard integer hardware/ALU to perform rational number
calculations. The number of integer bits, fractional bits and the underlying word size are
to be chosen by the programmer on an application-specific basis - the programmer's
choices of the foregoing will depend on the range and resolution needed for the numbers.
The machine itself remains oblivious to the notional fixed point representation being
employed - it merely performs integer arithmetic the way it knows how. Ensuring that the
computational results are valid in the Q format representation is the responsibility of the
programmer.
The Q notation is written as Qm.n, where:
• Q designates that the number is in the Q format notation - the Texas Instruments
representation for signed fixed-point numbers (the “Q” being reminiscent of the
standard symbol for the set of rational numbers).
• m is the number of bits set aside to designate the two's complement integer portion of
the number, exclusive of the sign bit (therefore if m is not specified it is taken as
zero).
• n is the number of bits used to designate the fractional portion of the number, i.e. the
number of bits to the right of the binary point. (If n = 0, the Q numbers are integers -
the degenerate case).
Note that the most significant bit is always designated as the sign bit (the number is
stored as a two's complement number) in order to allow standard arithmetic-logic
hardware to manipulate Q numbers. Representing a signed fixed-point data type in Q
format therefore always requires m+n+1 bits to account for the sign bit. Hence the
smallest machine word size required to accommodate a Qm.n number is m+n+1, with the
Q number left justified in the machine word.
For a given Qm.n format, using an m+n+1 bit signed integer container with n fractional
bits:
• its range is [-2
m
, 2
m
- 2
-n
]
• its resolution is 2
-n
Chapter 32 Memory-Mapped Divide and Square Root (MMDVSQ)
K32 L2A Reference Manual, Rev. 2, 01/2020
NXP Semiconductors
863
Содержание K32 L2A Series
Страница 2: ...K32 L2A Reference Manual Rev 2 01 2020 2 NXP Semiconductors...
Страница 42: ...K32 L2A Reference Manual Rev 2 01 2020 42 NXP Semiconductors...
Страница 122: ...Flash Memory Clock K32 L2A Reference Manual Rev 2 01 2020 122 NXP Semiconductors...
Страница 146: ...Module operation in low power modes K32 L2A Reference Manual Rev 2 01 2020 146 NXP Semiconductors...
Страница 158: ...Debug and security K32 L2A Reference Manual Rev 2 01 2020 158 NXP Semiconductors...
Страница 174: ...Module Signal Description Tables K32 L2A Reference Manual Rev 2 01 2020 174 NXP Semiconductors...
Страница 246: ...Application information K32 L2A Reference Manual Rev 2 01 2020 246 NXP Semiconductors...
Страница 322: ...Kinetis Bootloader Status Error Codes K32 L2A Reference Manual Rev 2 01 2020 322 NXP Semiconductors...
Страница 344: ...Application initialization information K32 L2A Reference Manual Rev 2 01 2020 344 NXP Semiconductors...
Страница 374: ...CMP Trigger Mode K32 L2A Reference Manual Rev 2 01 2020 374 NXP Semiconductors...
Страница 384: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 384 NXP Semiconductors...
Страница 592: ...Application Information K32 L2A Reference Manual Rev 2 01 2020 592 NXP Semiconductors...
Страница 602: ...Initialization and application information K32 L2A Reference Manual Rev 2 01 2020 602 NXP Semiconductors...
Страница 656: ...Functional Description K32 L2A Reference Manual Rev 2 01 2020 656 NXP Semiconductors...
Страница 664: ...Functional Description K32 L2A Reference Manual Rev 2 01 2020 664 NXP Semiconductors...
Страница 744: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 744 NXP Semiconductors...
Страница 762: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 762 NXP Semiconductors...
Страница 806: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 806 NXP Semiconductors...
Страница 868: ...Integer square root K32 L2A Reference Manual Rev 2 01 2020 868 NXP Semiconductors...
Страница 976: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 976 NXP Semiconductors...
Страница 1012: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 1012 NXP Semiconductors...
Страница 1094: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 1094 NXP Semiconductors...
Страница 1132: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 1132 NXP Semiconductors...
Страница 1182: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 1182 NXP Semiconductors...
Страница 1290: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 1290 NXP Semiconductors...
Страница 1344: ...USB Voltage Regulator Module Signal Descriptions K32 L2A Reference Manual Rev 2 01 2020 1344 NXP Semiconductors...
Страница 1356: ...Initialization Application Information K32 L2A Reference Manual Rev 2 01 2020 1356 NXP Semiconductors...