
For the unsigned integer format used in the MMDVSQ's square root calculation, an
u(nsigned)Qm.n notation requires m+n bits (m+n = 32) for the input radicand. An uQm.n
format produces an uQ(m/2).(n/2) square root. As examples, consider the following
tables involving the square root of 2 and square root of “pi” calculations. As expected, as
the number of fractional bits (n) increases, the error between the calculated square root
and the “actual” result decreases.
Table 32-2. Square Root of 2 Calculations (√2 = 1.4142135623)
RCND [Hex]
RCND Q format
Results [Hex]
RES Q Format
Decimal
% Error
0x0000_0002
uQ32.00
0x0000_0001
uQ16.00
1.0
-29.289%
0x0002_0000
uQ16.16
0x0000_016A
uQ08.08
1.4140625
-0.011%
0x0200_0000
uQ08.24
0x0000_16A0
uQ04.12
1.4140625
-0.011%
0x2000_0000
uQ04.28
0x0000_5A82
uQ02.14
1.4141845703
-0.002%
0x8000_0000
uQ02.30
0x0000_B504
uQ01.15
1.4141845703
-0.002%
Table 32-3. Square Root of Pi Calculations (√Pi = 1.7724538509)
RCND [Hex]
RCND Q format
Results [Hex]
RES Q Format
Decimal
% Error
0x0000_0003
uQ32.0
0x0000_0001
uQ16.00
1.0
-43.581%
0x0003_243F
uQ16.16
0x0000_01C5
uQ08.08
1.76953125
-0.165%
0x0324_3F6A
uQ08.24
0x0000_1C5B
uQ04.12
1.772216769
-0.013%
0x3243_F6A8
uQ04.28
0x0000_716F
uQ02.14
1.7723999023
-0.003%
0xC90F_DAA0
uQ02.30
0x0000_E2DF
uQ01.15
1.7724304199
-0.001%
The application of the Q notation for square root calculations provides a powerful
extension for these types of fractional numeric computations using fixed-point integer
processing hardware.
32.4.2 Execution times
The MMDVSQ module includes early termination logic to finish both divide and square
root calculations as quickly as possible, based on the magnitude of the input operand.
Accordingly, the execution time for the calculations is data dependent as defined in
. In this context, the execution time is defined from the register write
to initiate the calculation until the result register has been updated and available to read.
Stated differently, it represents the time CSR[BUSY] is asserted for a given calculation.
In the following two tables, “x” signals a bit with a don’t care value.
Integer square root
K32 L2A Reference Manual, Rev. 2, 01/2020
864
NXP Semiconductors
Summary of Contents for K32 L2A Series
Page 2: ...K32 L2A Reference Manual Rev 2 01 2020 2 NXP Semiconductors...
Page 42: ...K32 L2A Reference Manual Rev 2 01 2020 42 NXP Semiconductors...
Page 122: ...Flash Memory Clock K32 L2A Reference Manual Rev 2 01 2020 122 NXP Semiconductors...
Page 158: ...Debug and security K32 L2A Reference Manual Rev 2 01 2020 158 NXP Semiconductors...
Page 174: ...Module Signal Description Tables K32 L2A Reference Manual Rev 2 01 2020 174 NXP Semiconductors...
Page 246: ...Application information K32 L2A Reference Manual Rev 2 01 2020 246 NXP Semiconductors...
Page 374: ...CMP Trigger Mode K32 L2A Reference Manual Rev 2 01 2020 374 NXP Semiconductors...
Page 384: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 384 NXP Semiconductors...
Page 592: ...Application Information K32 L2A Reference Manual Rev 2 01 2020 592 NXP Semiconductors...
Page 656: ...Functional Description K32 L2A Reference Manual Rev 2 01 2020 656 NXP Semiconductors...
Page 664: ...Functional Description K32 L2A Reference Manual Rev 2 01 2020 664 NXP Semiconductors...
Page 744: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 744 NXP Semiconductors...
Page 762: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 762 NXP Semiconductors...
Page 806: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 806 NXP Semiconductors...
Page 868: ...Integer square root K32 L2A Reference Manual Rev 2 01 2020 868 NXP Semiconductors...
Page 976: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 976 NXP Semiconductors...
Page 1012: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 1012 NXP Semiconductors...
Page 1094: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 1094 NXP Semiconductors...
Page 1132: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 1132 NXP Semiconductors...
Page 1182: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 1182 NXP Semiconductors...
Page 1290: ...Functional description K32 L2A Reference Manual Rev 2 01 2020 1290 NXP Semiconductors...