
32.4.1.1.3 Special case: Divide-by-Zero
For both signed and unsigned divides, if the divisor is zero, the MMDVSQ hardware
detects this condition and the CSR[DZ] indicator set. The quotient result is forced to
0x0000_0000. If the remainder is selected as the output of this calculation, it also returns
0x0000_0000. Additionally, if CSR[DZE] = 1, then an attempted read of the Result
register (RES) is error terminated to provide a simple mechanism to signal software of
the divide-by-zero condition.
Integer square root
32.4.1.2.1 Overview
The unsigned square root algorithm begins by creating a 32-bit “one-hot” bit vector
signaling the highest power of four of the contents of the Radicand register (RCND). It
then iterates through an algorithm involving magnitude comparisons of the RCND
register versus the working result plus bit vector summation, conditional decrementing of
the radicand, a 1-bit right shift of the result, and a 2-bit right shift of the one-hot bit
vector.
Processing two bits of the radicand per cycle, the result register finishes with the integer
portion of the square root calculation. The module includes early termination logic so that
the execution time is data dependent, based on the magnitude of the input radicand. See
for more execution time details. Since both algorithms share common
hardware structures, the incremental cost of the square root logic is an extremely small
delta to the basic divide hardware.
The square root algorithm was exhaustively compared (that is, all 2
32
possible input
values) against the standard GNU C library implementation, which converts the unsigned
integer input into a double-precision floating-point number, calculates the double-
precision square root and then converts it back into an unsigned integer. Each input value
calculated identical square root results.
32.4.1.2.2 Square root using Q notation
Consider the use of Q notation for square root calculations returning fractional values.
The following description is taken from
http://en.wikipedia.org/wiki/Q_(number_format)
.
32.4.1.2
Integer square root
K32 L2A Reference Manual, Rev. 2, 01/2020
862
NXP Semiconductors
Содержание 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...