CORDIC-程序员宅基地

技术标签: 笔记  IP  

CORDIC

1 关于CORDIC

“The CORDIC co-processor provides hardware acceleration of mathematical functions (mainly trigonometric ones) commonly used in motor control, metering, signal processing and many other applications.” (“STM32G4 Series microcontroller reference”, p. 469) CORDIC协处理器提供了电机控制、计量、信号处理等诸多应用中常用的数学函数(主要是三角函数)的硬件加速。

“It speeds up the calculation of these functions compared to a software implementation, making it possible the use of a lower operating frequency, or freeing up processor cycles in order to perform other tasks.” (“STM32G4 Series microcontroller reference”, p. 469) 与软件实现相比,它加快了这些功能的计算,使用较低的工作频率,或释放处理器周期以执行其他任务成为可能。

2 CORDIC主要特点

<img src="attachments/ZFLC9NZG.png" alt="" data-attachment-key="ZFLC9NZG" width="802" height="276" ztype="zimage">

3 CORDIC功能描述

3.1 一般描述

“The CORDIC is a cost-efficient successive approximation algorithm for evaluating trigonometric and hyperbolic functions.” (“STM32G4 Series microcontroller reference”, p. 469) CORDIC是一种计算三角函数和双曲函数的经济有效的逐次逼近算法。

“In trigonometric (circular) mode, the sine and cosine of an angle θ are determined by rotating the unit vector [1, 0] through decreasing angles until the cumulative sum of the rotation angles equals the input angle θ. The x and y cartesian components of the rotated vector then correspond, respectively, to the cosine and sine of θ. Inversely, the angle of a vector [x, y] corresponding to arctangent (y / x), is determined by rotating [x, y] through successively decreasing angles to obtain the unit vector [1, 0]. The cumulative sum of the rotation angles gives the angle of the original vector.” (“STM32G4 Series microcontroller reference”, p. 469) 在三角函数(圆)模式下,通过减小角度旋转单位向量[ 1、0 ]来确定角度θ的正余弦,直到旋转角度的累加和等于输入角度θ。然后,旋转向量的x和y笛卡尔分量分别对应于θ的余弦和正弦。反过来,通过依次减小角度旋转[ x , y]得到单位矢量[ 1、0 ],从而确定一个矢量[ x , y]对应于反正切( y / x)的角度。旋转角度的累积和给出了原始向量的角度。

“The CORDIC algorithm can also be used for calculating hyperbolic functions (sinh, cosh, atanh), by replacing the successive circular rotations by steps along a hyperbole. Other functions can be derived from the basic functions described above.” (“STM32G4 Series microcontroller reference”, p. 469) CORDIC算法也可用于计算双曲函数( sinh , cosh , atanh),通过沿双曲线逐级替换连续的圆周旋转。其他功能可由上述基本功能派生而来。

3.2 CORDIC函数

<img src="attachments/YV65U37V.png" alt="" data-attachment-key="YV65U37V" width="777" height="558" ztype="zimage">

“Several functions take two input arguments (ARG1 and ARG2) and some generate two results (RES1 and RES2) simultaneously. This is a side-effect of the algorithm and means that only one operation is needed to obtain two values. This is the case, for example, when performing polar-to-rectangular conversion: sin θ also generates cos θ, cos θ also generates sin θ. Similarly for rectangular-to-polar conversion (phase(x,y), modulus(x,y)) and for hyperbolic functions (cosh θ, sinh θ).” (“STM32G4 Series microcontroller reference”, p. 470) 有的函数取两个输入参数( ARG1和ARG2),有的函数同时产生两个结果( RES1和RES2)。这是算法的一个副作用,意味着只需要一次运算就可以得到两个值。例如,在进行极矩形转换时:sinθ也生成cosθ,cosθ也生成sin θ。类似地,对于直角-极坐标转换(相( x , y )),模( x , y) )和双曲函数( coshθ , sinhθ)。

“The exponential function, exp x, can be obtained as the sum of sinh x and cosh x. Furthermore, base N logarithms, logN x, can be derived by multiplying ln x by a constant K, where K = 1/ln N.” (“STM32G4 Series microcontroller reference”, p. 470) 指数函数exp x可由sinh x和cosh x之和得到。此外,基于N的对数logNx可以由lnx乘以常数K得到,其中K = 1 / lnN。(运算结果可以互相转换)

“For certain functions (atan, log, sqrt) a scaling factor (see Section 17.3.4) can be applied to extend the range of the function beyond the maximum [-1, 1] supported by the q1.31 fixed point format. The scaling factor must be set to 0 for all other circular functions, and to 1 for hyperbolic functions.” (“STM32G4 Series microcontroller reference”, p. 470) 对于某些特定的函数( atan , log , sqrt),可以应用缩放因子(见第3 . 4节)将函数的值域扩展到q1.31固定点格式所支持的最大[ - 1 , 1]之外.对于其他所有的圆函数,缩放因子必须设置为0;对于双曲函数,缩放因子必须设置为1。


Cosine

<img src="attachments/GJA3JASD.png" alt="" data-attachment-key="GJA3JASD" width="768" height="170" ztype="zimage">

<img src="attachments/PQIMJ5AU.png" alt="" data-attachment-key="PQIMJ5AU" width="767" height="133" ztype="zimage">

“This function calculates the cosine of an angle in the range -π to π. It can also be used to perform polar to rectangular conversion.” (“STM32G4 Series microcontroller reference”, p. 471) 该函数计算一个角度在- π到π范围内的余弦值。它还可以用来进行极坐标到矩形的转换。

“The primary argument is the angle θ in radians. It must be divided by π before programming ARG1.” (“STM32G4 Series microcontroller reference”, p. 471) 第一个参数是弧度中的角度θ。在编程ARG1之前,必须将其除以π。

“The secondary argument is the modulus m. If m is greater than 1, a scaling must be applied in software to adapt it to the q1.31 range of ARG2.” (“STM32G4 Series microcontroller reference”, p. 471) 第二个参数是模数m。如果m大于1,则必须在软件中进行缩放,使其适应ARG2的q1.31范围。

“The primary result, RES1, is the cosine of the angle, multiplied by the modulus.” (“STM32G4 Series microcontroller reference”, p. 471) 第一个结果RES1是角度的余弦,乘以模数。

“The secondary result, RES2, is the sine of the angle, multiplied by the modulus.” (“STM32G4 Series microcontroller reference”, p. 471) 第二个结果RES2,是角度的正弦,乘以模数。(这是弊端,不是非必须的)


Sine

<img src="attachments/23CZVK78.png" alt="" data-attachment-key="23CZVK78" width="770" height="236" ztype="zimage">

“This function calculates the sine of an angle in the range -π to π. It can also be used to perform polar to rectangular conversion.” (“STM32G4 Series microcontroller reference”, p. 471) 该函数计算- π ~ π范围内某一角度的正弦值。它还可以用来进行极坐标到矩形的转换。

“The primary argument is the angle θ in radians. It must be divided by π before programming ARG1.” (“STM32G4 Series microcontroller reference”, p. 471) 第一个参数是弧度中的角度θ。在编程ARG1之前,必须将其除以π。

“The secondary argument is the modulus m. If m is greater than 1, a scaling must be applied in software to adapt it to the q1.31 range of ARG2.” (“STM32G4 Series microcontroller reference”, p. 471) 第二个参数是模数m。如果m大于1,则必须在软件中进行缩放,使其适应ARG2的q1.31范围。

“The primary result, RES1, is the sine of the angle, multiplied by the modulus.” (“STM32G4 Series microcontroller reference”, p. 471) 第一个结果RES1是角度的正弦,乘以模数。

“The secondary result, RES2, is the cosine of the angle, multiplied by the modulus.” (“STM32G4 Series microcontroller reference”, p. 471) 第二个结果,RES2,是角度的余弦,乘以模数。


Phase

<img src="attachments/INALA964.png" alt="" data-attachment-key="INALA964" width="764" height="173" ztype="zimage">

<img src="attachments/D62PLFDF.png" alt="" data-attachment-key="D62PLFDF" width="761" height="139" ztype="zimage">

“This function calculates the phase angle in the range -π to π of a vector v = [x y] (also known as atan2(y,x). It can also be used to perform rectangular to polar conversion.” (“STM32G4 Series microcontroller reference”, p. 472) 该函数计算了向量v = [ x y ] (又称atan2 ( y , x ) )在- π到π范围内的相位角。它还可以用来进行矩形到极坐标的转换。

“The primary argument is the x coordinate, that is, the magnitude of the vector in the direction of the x axis. If |x| > 1, a scaling must be applied in software to adapt it to the q1.31 range of ARG1.” (“STM32G4 Series microcontroller reference”, p. 472) 第一个参数是x坐标,即向量在x轴方向上的大小。如果| x | > 1,则必须在软件中进行缩放以适应ARG1的q1.31范围。

“The secondary argument is the y coordinate, that is, the magnitude of the vector in the direction of the y axis. If |y| > 1, a scaling must be applied in software to adapt it to the q1.31 range of ARG2.” (“STM32G4 Series microcontroller reference”, p. 472) 第二个参数为y坐标,即向量在y轴方向上的大小。如果| y | > 1,则必须在软件中进行缩放以适应ARG2的q1.31范围。

“The primary result, RES1, is the phase angle θ of the vector v. RES1 must be multiplied by π to obtain the angle in radians. Note that values close to π may sometimes wrap to -π due to the circular nature of the phase angle.” (“STM32G4 Series microcontroller reference”, p. 472) 第一个结果RES1是向量v的相角θ ,RES1必须乘以π才能得到以弧度为单位的角度。值得注意的是,由于相位角的圆性质,接近π的值有时可能会卷曲到- π。(就像过界一样)

“The secondary result, RES2, is the modulus, given by: ∣ v ∣ = x 2 + y 2 |v|=\sqrt{x^2+y^2} v=x2+y2 . If |v| > 1 the result in RES2 is saturated to 1.” (“STM32G4 Series microcontroller reference”, p. 472) 第二个结果RES2是模,由下式给出:.如果| v | > 1,则RES2中的结果饱和为1。


Modulus

<img src="attachments/3KRUNI2L.png" alt="" data-attachment-key="3KRUNI2L" width="768" height="236" ztype="zimage">

“This function calculates the magnitude, or modulus, of a vector v = [x y]. It can also be used to perform rectangular to polar conversion.” (“STM32G4 Series microcontroller reference”, p. 472) 该函数计算向量v = [ x y ]的模或模的大小。它还可以用来进行矩形到极坐标的转换。

“The primary argument is the x coordinate, that is, the magnitude of the vector in the direction of the x axis. If |x| > 1, a scaling must be applied in software to adapt it to the q1.31 range of ARG1.” (“STM32G4 Series microcontroller reference”, p. 472) 第一个参数是x坐标,即向量在x轴方向上的大小。如果| x | > 1,则必须在软件中进行缩放以适应ARG1的q1.31范围。

“The secondary argument is the y coordinate, that is, the magnitude of the vector in the direction of the y axis. If |y| > 1, a scaling must be applied in software to adapt it to the q1.31 range of ARG2.” (“STM32G4 Series microcontroller reference”, p. 472) 次要参数为y坐标,即向量在y轴方向上的大小。如果| y | > 1,则必须在软件中进行缩放以适应ARG2的q1.31范围。

“The primary result, RES1, is the modulus, given by: $|v|=\sqrt{x2+y2}$ . If |v| > 1 the result in RES1 is saturated to 1.” (“STM32G4 Series microcontroller reference”, p. 472) 第一个结果RES1为模,由下式给出:如果| v | > 1,则RES1中的结果饱和到1 .

“The secondary result, RES2, is the phase angle θ of the vector v. RES2 must be multiplied by π to obtain the angle in radians. Note that values close to π may sometimes wrap to -π due to the circular nature of the phase angle.” (“STM32G4 Series microcontroller reference”, p. 472) 第二个结果RES2为矢量v的相位角θ。RES2必须乘以π才能得到以弧度为单位的角度。值得注意的是,由于相位角的圆性质,接近π的值有时可能会卷曲到- π。


Arctangent

<img src="attachments/FGI9HF2U.png" alt="" data-attachment-key="FGI9HF2U" width="776" height="256" ztype="zimage">

“This function calculates the arctangent, or inverse tangent, of the input argument x.” (“STM32G4 Series microcontroller reference”, p. 473) 该函数计算输入变量x的反正切。

“The primary argument, ARG1, is the input value, x = tan θ. If |x| > 1, a scaling factor of 2-n must be applied in software such that -1 < x ∙ 2-n < 1. The scaled value x ∙ 2-n is programmed in ARG1 and the scale factor n must be programmed in the SCALE parameter.” (“STM32G4 Series microcontroller reference”, p. 473) 第一个参数ARG1为输入值,x = tan θ。如果| x | > 1,则在软件中必须应用2 - n的比例因子,使得- 1 < x≤2-n < 1。标度值 x × 2 − n x\times 2^{-n} x×2n在ARG1中编程,标度因数n必须在SCALE参数中编程。

“Note that the maximum input value allowed is tan θ = 128, which corresponds to an angle θ = 89.55 degrees. For |x| > 128, a software method must be used to find tan-1 x.” (“STM32G4 Series microcontroller reference”, p. 473) 注意允许的最大输入值是tan θ = 128,这对应一个角度θ = 89.55度。当| x | > 128时,必须用软件方法求 t a n − 1 x tan^{-1}x tan1x

“The secondary argument, ARG2, is unused.” (“STM32G4 Series microcontroller reference”, p. 473) 第二个参数ARG2没有使用。

“The primary result, RES1, is the angle θ = tan-1 x. RES1 must be multiplied by 2n ∙πto obtain the angle in radians.” (“STM32G4 Series microcontroller reference”, p. 473) 第一个结果结果是RES1,即角度 θ = t a n − 1 x θ = tan^{-1} x θ=tan1x . RES1必须乘以2n∙π才能得到以弧度为单位的角度。

“The secondary result, RES2, is unused.” (“STM32G4 Series microcontroller reference”, p. 473) 第二个结果RES2没有使

用。


Hyperbolic Cosine

<img src="attachments/YN2WHZT8.png" alt="" data-attachment-key="YN2WHZT8" width="765" height="299" ztype="zimage">

“This function calculates the hyperbolic cosine of a hyperbolic angle x. It can also be used to calculate the exponential functions ex = cosh x + sinh x, and e-x = cosh x - sinh x.” (“STM32G4 Series microcontroller reference”, p. 473) 该函数计算双曲角x的双曲余弦值。它还可以用来计算指数函数ex = coshx + sinhx和ex = coshx - sinhx。

“The primary argument is the hyperbolic angle x. Only values of x in the range -1.118 to +1.118 are supported. Since the minimum value of cosh x is 1, which is beyond the range of the q1.31 format, a scaling factor of 2-n must be applied in software. The factor n = 1 must be programmed in the SCALE parameter.” (“STM32G4 Series microcontroller reference”, p. 473) 第一个参数是双曲角x。只支持x在- 1.118 ~ + 1.118范围内的取值。由于cosh x的最小值为1,超出了q1.31格式的取值范围,因此在软件中必须采用2 - n的比例因子。因子n = 1必须在SCALE参数中编程实现。

“The secondary argument is not used.” (“STM32G4 Series microcontroller reference”, p. 473) 不使用第二个参数。

“The primary result, RES1, is the hyperbolic cosine, cosh x. RES1 must be multiplied by 2 to obtain the correct result.” (“STM32G4 Series microcontroller reference”, p. 474) 第一个结果RES1为双曲余弦cosh x。RES1必须乘以2才能得到正确的结果。

“The secondary result, RES2, is the hyperbolic sine, sinh x. RES2 must be multiplied by 2 to obtain the correct result.” (“STM32G4 Series microcontroller reference”, p. 474) 第二个结果RES2是双曲正弦sinh x。RES2必须乘以2才能得到正确的结果。


Hyperbolic Sine

<img src="attachments/MLS7GP4P.png" alt="" data-attachment-key="MLS7GP4P" width="774" height="299" ztype="zimage">

“This function calculates the hyperbolic sine of a hyperbolic angle x. It can also be used to calculate the exponential functions ex = cosh x + sinh x, and e-x = cosh x- sinh x.” (“STM32G4 Series microcontroller reference”, p. 474) 该函数计算一个双曲角x的双曲正弦。它还可以用来计算指数函数ex = cosh x + sinh x和ex = cosh x-sinh x。

“The primary argument is the hyperbolic angle x. Only values of x in the range -1.118 to +1.118 are supported. For all input values, a scaling factor of 2-n must be applied in software, where n = 1. The scaled value x ∙ 0.5 is programmed in ARG1 and the factor n = 1 must be programmed in the SCALE parameter.” (“STM32G4 Series microcontroller reference”, p. 474) 第一个参数是双曲角x。只支持x在- 1.118 ~ + 1.118范围内的取值。对于所有的输入值,软件中必须施加2 - n的缩放因子,其中n = 1。标度值x = 0.5在ARG1中编程,因子n = 1必须在SCALE参数中编程。

“The secondary argument is not used.” (“STM32G4 Series microcontroller reference”, p. 474) 不使用第二个参数。

“The primary result, RES1, is the hyperbolic sine, sinh x. RES1 must be multiplied by 2 to obtain the correct result.” (“STM32G4 Series microcontroller reference”, p. 474) 第一个结果RES1为双曲正弦sinh x。RES1必须乘以2才能得到正确的结果。

“The secondary result, RES2, is the hyperbolic cosine, cosh x. RES2 must be multiplied by 2 to obtain the correct result.” (“STM32G4 Series microcontroller reference”, p. 474) 第二个结果RES2是双曲余弦cosh x。RES2必须乘以2才能得到正确的结果。


Hyperbolic Arcyangent

<img src="attachments/ALL4FRH5.png" alt="" data-attachment-key="ALL4FRH5" width="773" height="237" ztype="zimage">

“This function calculates the hyperbolic arctangent of the input argument x.” (“STM32G4 Series microcontroller reference”, p. 474) 该函数计算输入变量x的双曲反正切。

“The primary argument is the input value x. Only values of x in the range -0.806 to +0.806 are supported. The value x must be scaled by a factor 2-n, where n = 1.” (“STM32G4 Series microcontroller reference”, p. 474) 主要论据是输入值x。只支持x在- 0.806到+ 0.806范围内的值。值x必须用一个因子2 - n来刻度,其中n = 1。

“The secondary argument is not used.” (“STM32G4 Series microcontroller reference”, p. 475) 不使用次要论据。

“The primary result is the hyperbolic arctangent, atanh x. RES1 must be multiplied by 2 to obtain the correct value.” (“STM32G4 Series microcontroller reference”, p. 475) 第一个结果是双曲反正切,atanh x。RES1必须乘以2才能得到正确的值。

“The secondary result is not used.” (“STM32G4 Series microcontroller reference”, p. 475)


Natural Logarithm

<img src="attachments/8PT6QMAU.png" alt="" data-attachment-key="8PT6QMAU" width="777" height="233" ztype="zimage">

“This function calculates the natural logarithm of the input argument x.” (“STM32G4 Series microcontroller reference”, p. 475) 该函数计算输入变量x的自然对数。

“The primary argument is the input value x. Only values of x in the range 0.107 to 9.35 are supported. The value x must be scaled by a factor 2-n, such that x ∙ 2-n < 1-2-n. The scaled value x ∙ 2-n is programmed in ARG1 and the factor n must be programmed in the SCALE parameter.” (“STM32G4 Series microcontroller reference”, p. 475) 第一个参数是输入值x。只有x在0.107 ~ 9.35范围内的值被支持。x值必须用一个因子2 - n进行缩放,使得x∙2-n < 1 - 2 - n。标度值x∙2 - n在ARG1中编程,因子n必须在SCALE参数中编程。

<img src="attachments/UBQMA3JN.png" alt="" data-attachment-key="UBQMA3JN" width="770" height="208" ztype="zimage">

“The secondary argument is not used.” (“STM32G4 Series microcontroller reference”, p. 475) 不使用第二个参数。

“The primary result is the natural logarithm, ln x. RES1 must be multiplied by 2(n+1) to obtain the correct value.” (“STM32G4 Series microcontroller reference”, p. 475) 第一个结果为取自然对数ln x。RES1必须乘以2 ( n + 1 )才能得到正确的值。

“The secondary result is not used.” (“STM32G4 Series microcontroller reference”, p. 475) 没有使用第二个结果。


Square Root

<img src="attachments/2V3NNK4V.png" alt="" data-attachment-key="2V3NNK4V" width="776" height="240" ztype="zimage">

“This function calculates the square root of the input argument x.” (“STM32G4 Series microcontroller reference”, p. 476) 该函数计算输入变量x的平方根。

“The primary argument is the input value x. Only values of x in the range 0.027 to 2.34 are supported. The value x must be scaled by a factor 2-n, such that x ∙ 2-n < (1 - 2(-n-2)).” (“STM32G4 Series microcontroller reference”, p. 476) 第一个参数是输入值x。只支持x在0.027 ~ 2.34范围内的值。值x必须按因子2 - n进行缩放,使得x∙2-n < ( 1-2 ( - n-2 )) )。

“The scaled value x ∙ 2-n is programmed in ARG1 and the factor n must be programmed in the SCALE parameter.” (“STM32G4 Series microcontroller reference”, p. 476) 标度值x∙2 - n在ARG1中编程,因子n必须在SCALE参数中编程。

<img src="attachments/T3FQ3W7T.png" alt="" data-attachment-key="T3FQ3W7T" width="771" height="171" ztype="zimage">

“The secondary argument is not used.” (“STM32G4 Series microcontroller reference”, p. 476) 不使用次要论据。

“The primary result is the square root of x. RES1 must be multiplied by 2n to obtain the correct value.” (“STM32G4 Series microcontroller reference”, p. 476) 主要结果是x的平方根。RES1必须乘以2n才能得到正确的值。

“The secondary result is not used.” (“STM32G4 Series microcontroller reference”, p. 476) 没有使用第二个结果。

3.3 定点数表示

“The CORDIC operates in fixed point signed integer format. Input and output values can be either q1.31 or q1.15” (“STM32G4 Series microcontroller reference”, p. 476) CORDIC算法采用定点有符号整数运算。输入和输出值可以是q1.31或q1.15

“In q1.31 format, numbers are represented by one sign bit and 31 fractional bits (binary decimal places). The numeric range is therefore -1 (0x80000000) to 1 - 2-31 (0x7FFFFFFF)” (“STM32G4 Series microcontroller reference”, p. 476) 在q1.31格式中,数字用1个符号位和31个小数位(二进制小数位)表示。因此,数值范围是- 1 ( 0x80000000 )到 1 − 2 − 31 1 - 2^{-31} 1231 ( 0x7FFFFFFF )。

“In q1.15 format, the numeric range is 1 (0x8000) to 1 - 2-15 (0x7FFF). This format has the advantage that two input arguments can be packed into a single 32-bit write, and two results can be fetched in one 32-bit read.” (“STM32G4 Series microcontroller reference”, p. 476) 在q1.15格式下,数值范围为-1 ( 0x8000 )到1 - 2 - 15 ( 0x7FFF )。这种格式的优点是可以将两个输入参数打包成一个32位的写,并且可以在一个32位的读中读取两个结果。

3.4 缩放因子

“Several of the functions listed in Section 17.3.2 specify a scaling factor, SCALE. This allows the function input range to be extended to cover the full range of values supported by the CORDIC, without saturating the input, output or internal registers.” (“STM32G4 Series microcontroller reference”, p. 476) 在3 . 2中列出的几个函数指定了一个缩放因子SCALE。这使得函数输入范围可以扩展到覆盖CORDIC支持的全部取值范围,而不需要饱和输入、输出或内部寄存器。

“it has to be calculated in software and programmed into the SCALE field of the CORDIC_CSR register. The input arguments must be scaled accordingly before programming the scaled values in the CORDIC_WDATA register. The scaling must also be undone on the results read from the CORDIC_RDATA register.” (“STM32G4 Series microcontroller reference”, p. 477) 缩放因子需要在软件中进行计算,并编程到CORDIC _ CSR寄存器的SCALE字段中。在对CORDIC _ WDATA寄存器中的缩放值进行编程之前,必须对输入参数进行相应的缩放。还必须对从CORDIC _ RDATA寄存器读取的结果进行缩放。

NOTE:

“The scaling factor entails a loss of precision due to truncation of the scaled value.” (“STM32G4 Series microcontroller reference”, p. 477) 缩放因子由于缩放值的截断而导致精度损失。

3.5 精度

“The precision of the result is dependent on the number of CORDIC iterations. The algorithm converges at a constant rate of one binary digit per iteration for trigonometric functions (sine, cosine, phase, modulus)” (“STM32G4 Series microcontroller reference”, p. 477) 结果的精度取决于CORDIC的迭代次数。对于三角函数(正弦、余弦、相位、模),该算法在每次迭代中以一个二进制数的恒定速率收敛(见图38)

<img src="attachments/75MJ3XQP.png" alt="" data-attachment-key="75MJ3XQP" width="775" height="619" ztype="zimage">

“For hyperbolic functions (hyperbolic sine, hyperbolic cosine, natural logarithm), the convergence rate is less constant due to the peculiarities of the CORDIC algorithm (see Figure 39). The square root function converges at roughly twice the speed of the hyperbolic functions (see Figure 40).” (“STM32G4 Series microcontroller reference”, p. 477) 对于双曲函数(双曲正弦、双曲余弦、自然对数),由于CORDIC算法(见图39)的特殊性,收敛速度常数较小。平方根函数的收敛速度大约是双曲函数(见图40)的2倍。

<img src="attachments/BFFJIR3X.png" alt="" data-attachment-key="BFFJIR3X" width="775" height="606" ztype="zimage">

<img src="attachments/E9DZ4D2E.png" alt="" data-attachment-key="E9DZ4D2E" width="771" height="607" ztype="zimage">

NOTE:

“The convergence rate decreases as the quantization error starts to become significant.” (“STM32G4 Series microcontroller reference”, p. 479) 随着量化误差开始变得显著,收敛速度开始下降。

“The CORDIC can perform four iterations per clock cycle. For each function, the maximum error remaining after every four iterations is shown in Table 115, together with the number of clock cycles required to reach that precision. From this table, the desired number of cycles can be determined and programmed in the PRECISION field of the CORDIC_CR register. The co-processor stops as soon as the programmed number of iterations has completed, and the result can be read immediately.” (“STM32G4 Series microcontroller reference”, p. 479) CORDIC算法每个时钟周期可进行4次迭代运算。对于每个函数,每4次迭代后剩余的最大误差以及达到该精度所需的时钟周期数如表115所示。从这个表中可以确定所需的周期数,并在CORDIC _ CR寄存器的PRECISION字段中进行编程。协处理器在编程迭代次数完成后立即停止,并且可以立即读取结果。

<img src="attachments/6V34VF47.png" alt="" data-attachment-key="6V34VF47" width="771" height="307" ztype="zimage">

<img alt="" data-attachment-key="665QIQZA" width="771" height="401" src="attachments/665QIQZA.png" ztype="zimage">

(1)Max residual error is the maximum error remaining after the given number of iterations, compared to the identical calculation performed in double precision floating point. An additional rounding error may be incurred, of up to 2-16 for q15 format or 2-20 for q31 format.” (“STM32G4 Series microcontroller reference”, p. 480) 最大剩余误差是在给定迭代次数后剩余的最大误差,与双精度浮点运算中进行的相同计算相比。可能产生额外的舍入误差,q15格式舍入误差高达2 ~ 16,q31格式舍入误差高达2 ~ 20。

(2)For modulus > 0.5. The achievable precision reduces proportionally to the magnitude of the modulus, as quantization error becomes significant.” (“STM32G4 Series microcontroller reference”, p. 480) 对于模数> 0.5 .随着量化误差的增大,可达到的精度与模值的大小成比例地减小。

(3)If a higher scaling factor is used, the achievable precision is reduced proportionally.” (“STM32G4 Series microcontroller reference”, p. 480) 当SCALE=1,如果使用较高的缩放因子,则可达到的精度成比例地降低。

(4)“If a higher scaling factor is used, the achievable precision is reduced proportionally.” (“STM32G4 Series microcontroller reference”, p. 480) 当SCALE=0,如果使用较高的缩放因子,则可达到的精度成比例地降低。

3.6 零开销模式

“The fastest way to use the co-processor is to pre-program the CORDIC_CSR register with the function to be performed (FUNC), the desired number of clock cycles (PRECISION), the size of the input and output values (ARGSIZE, RESSIZE), the number of input arguments (NARGS) and/or results (NRES), and the scaling factor (SCALE), if applicable. Subsequently, a calculation is triggered by writing the input arguments to the CORDIC_WDATA register. As soon as the correct number of input arguments has been written (and any ongoing calculation has finished) a new calculation is launched using these input arguments and the current CORDIC_CSR settings. There is no need to re-program the CORDIC_CSR register if there is no change.” (“STM32G4 Series microcontroller reference”, p. 480) 使用协处理器的最快方法是对CORDIC _ CSR寄存器进行预编程,包括待执行的函数( FUNC )、所需的时钟周期数( PRECISION )、输入输出值的大小( ARGSIZE、RESSIZE)、输入参数的个数( NARGS )和/或结果( NRES ),以及缩放因子( SCALE ) (如果适用)。随后,通过将输入参数写入CORDIC _ WDATA寄存器来触发计算。一旦写入正确数量的输入参数(并且任何正在进行的计算都已经完成),就使用这些输入参数和当前的CORDIC _ CSR设置启动新的计算。如果CORDIC _ CSR寄存器没有变化,则不需要重新编程。

“If a dual 32-bit input argument is needed (ARGSIZE = 0, NARGS = 1), the primary input argument, ARG1, must be written first, followed by the secondary argument, ARG2. If the secondary argument remains unchanged for a series of calculations, the second write can be avoided, by reprogramming the number of arguments to one (NARGS = 0), once the first calculation has started. The secondary argument retains its programmed value as long as the function is not changed.” (“STM32G4 Series microcontroller reference”, p. 480) 如果需要双32位输入参数( ARGSIZE = 0 , NARGS = 1),则必须先写主输入参数ARG1,然后写次要输入参数ARG2。如果在一系列计算中,第二个保持不变,一旦第一次计算已经开始,通过将参数的个数重新编程为一个( NARGS = 0),就可以避免第二次写入。只要函数不改变,就保留第二个参数的编程值。

Note:

“ARG2 is set to +1 (0x7FFFFFFF) after a reset.” (“STM32G4 Series microcontroller reference”, p. 480) ARG2在复位后设置为+ 1 ( 0x7FFFFFFF )。

“If two 16-bit arguments are used (ARGSIZE = 1) they must be packed into a 32-bit word, with ARG1 in the least significant half-word and ARG2 in the most significant half-word. The packed 32-bit word is then written to the CORDIC_WDATA register. Only one write is needed in this case (NARGS = 0). For functions taking only one input argument, ARG1, it is recommended to set NARGS = 0. If NARGS = 1, a second write to CORDIC_WDATA must be performed to trigger the calculation. The ARG2 data in this case is not used.” (“STM32G4 Series microcontroller reference”, p. 480) 如果使用两个16位的参数( ARGSIZE = 1),它们必须被打包成一个32位的字,其中ARG1位于最不重要的半字中,ARG2位于最重要的半字中。然后将打包后的32位字写入CORDIC _ WDATA寄存器。在这种情况下只需要一次写( NARGS = 0)。对于只取一个输入参数ARG1的函数,建议取NARGS = 0。如果NARGS = 1,则需要对CORDIC _ WDATA进行二次写入来触发计算。本案例中的ARG2数据未被使用。

“Once the calculation starts, any attempt to read the CORDIC_RDATA register inserts bus wait states until the calculation is completed, before returning the result. Hence it is possible for the software to write the input and immediately read the result without polling to see if it is valid. Alternatively, the processor can wait for the appropriate number of clock cycles before reading the result. This time can be used to program the CORDIC_CSR register for the next calculation and prepare the next input data, if needed. The CORDIC_CSR register can be re-programmed while a calculation is in progress, without affecting the result of the ongoing calculation. In the same way, the CORDIC_WDATA register can be updated with the next argument(s) once the previous arguments have been taken into account. The next arguments and settings remain pending until the previous calculation has completed.” (“STM32G4 Series microcontroller reference”, p. 481) 一旦计算开始,任何读取CORDIC _ RDATA寄存器的尝试都会插入总线等待状态,直到计算完成,再返回结果。因此,软件可以在不进行轮询的情况下编写输入并立即读取结果,看是否有效。或者,处理器在读取结果之前可以等待合适的时钟周期数。这一次可以用来对CORDIC _ CSR寄存器进行编程,以便进行下一次的计算,并在需要的时候准备下一次的输入数据。CORDIC _ CSR寄存器可以在计算过程中重新编程,而不影响正在进行的计算结果。用同样的方法,CORDIC _ WDATA寄存器可以用下一个参数进行更新,下一个参数和设置保持挂起,直到之前的计算完成

“When a calculation is finished, the result(s) can be read from the CORDIC_RDATA register. If two 32-bit results are expected (NRES = 1, RESSIZE = 0), the primary result (RES1) is read out first, followed by the secondary result (RES2). If only one 32-bit result is expected (NRES = 0, RESSIZE = 0), then RES1 is output on the first read. If 16-bit results are expected (RESSIZE = 1), a single read to CORDIC_RDATA fetches both results packed into a 32-bit word. RES1 is in the lower half-word, and RES2 in the upper half-word. In this case, it is recommended to program NRES = 0. IF NRES = 1, a second read of CORDIC_RDATA must be performed in order to free up the CORDIC for the next operation. The data from this second read must be discarded.” (“STM32G4 Series microcontroller reference”, p. 481) 计算完成后,可以从CORDIC _ RDATA寄存器中读取结果。如果两个32位的结果被预计为( NRES = 1 , RESSIZE = 0),则首先读出主要结果( RES1 ),其次是次要结果( RES2 )。如果只有一个32位的结果是预期的( NRES = 0 , RESSIZE = 0),则在第一个读出时输出RES1。如果16位的结果被预计为( RESSIZE = 1),则单个读到CORDIC _ RDATA取两个结果打包成32位字。RES1位于半字的下部,RES2位于半字的上部。在这种情况下,建议编程NRES = 0。如果NRES = 1,则必须执行CORDIC _ RDATA的第2个读操作,以释放CORDIC进行下一步操作。从第二次读取的数据必须被丢弃。

“The next calculation starts when the expected number of results has been read, provided the expected number of arguments has been written. This means that at any time, there can be one calculation in progress, or waiting for the results to be read, and one operation pending. Any further access to CORDIC_WDATA while an operation is pending, cancels the pending operation and overwrite the data.” (“STM32G4 Series microcontroller reference”, p. 481) 当预期的结果数被读取时,只要预期的参数被写入,下一次的计算就开始了。这意味着在任何时候,都可以有一次计算在进行,或者等待结果被读取,一次操作等待。当一个操作处于挂起状态时,任何对CORDIC _ WDATA的进一步访问都将取消挂起的操作并覆盖数据。

CORDIC_IP在零开销模式下的使用:

<img src="attachments/H4AM9IY7.png" alt="" data-attachment-key="H4AM9IY7" width="778" height="215" ztype="zimage">

1、配置CORDIC_CSR寄存器;

2、配置CORDIC_WDATA寄存器中第一次计算需要的参数,触发第一次计算;

3、如果需要,更新CORDIC_CSR寄存器,用于下一次计算;

4、在CORDIC_WDATA寄存器中编写下一次计算的参数;

5、从CORID_RDATA寄存器读取结果,同时触发下一次计算;

3.7 轮询模式

“When a new result is available in the CORDIC_RDATA register, the RRDY flag is set in the CORDIC_CSR register. The flag can be polled by reading the register. It is reset by reading the CORDIC_RDATA register (once or twice depending on the NRES field of the CORDIC_CSR register).” (“STM32G4 Series microcontroller reference”, p. 481) 当CORDIC_RDATA寄存器中的新结果可用时,将在CORDIC_CSR寄存器中设置RRDY标志。可以通过读取寄存器来轮询标志。它通过读取CORDIC_RDATA寄存器(一次或两次取决于CORDIC_CSR寄存器的NRES字段)来重置。

“Polling the RRDY flag takes slightly longer than reading the CORDIC_RDATA register directly, since the result is not read as soon as it is available. However the processor and bus interface are not stalled while reading the CORDIC_CSR register, so this mode may be of interest if stalling the processor is not acceptable (e.g. if low latency interrupts must be serviced).” (“STM32G4 Series microcontroller reference”, p. 481) 轮询RRDY标志位比直接读取CORDIC _ RDATA寄存器需要的时间稍长,因为一旦结果可用,不能立即读取。但是,在读取CORDIC _ CSR寄存器时,处理器和总线接口并没有停止,因此,该模式适用于处理器不停止的情况(例如,如果必须实现低延迟中断),那么这种模式可能是有意义的。

3.8 中断模式

“By setting the interrupt enable (IE) bit in the CORDIC_CSR register, an interrupt is generated whenever the RRDY flag is set. The interrupt is cleared when the flag is reset. This mode allows the result of the calculation to be read under interrupt service routine, and hence given a priority relative to other tasks. However it is slower than directly reading the result, or polling the flag, due to the interrupt handling delays.” (“STM32G4 Series microcontroller reference”, p. 482) 通过在CORDIC _ CSR寄存器中设置中断使能( IE )位,每当设置RRDY标志位时都会产生一个中断。当标志位被重置时,中断被清除。该模式允许在中断服务程序下读取计算结果,因此相对于其他任务具有优先性。然而,由于中断处理的延迟,它比直接读取结果或轮询标志位慢。

3.9 DMA模式

“If the DMA write enable (DMAWEN) bit is set in the CORDIC_CSR register, and no operation is pending, a DMA write channel request is generated. The DMA controller can transfer a primary input argument (ARG1) from memory into the CORDIC_WDATA register. Writing into the register deasserts the DMA request. If NARGS = 1 in the CORDIC_CSR register, a second DMA write channel request is generated to transfer the secondary input argument (ARG2) into the CORDIC_WDATA register. When all input arguments have been written, and any ongoing calculation has been completed (by reading the results), a new calculation is started and another DMA write channel request is generated.” (“STM32G4 Series microcontroller reference”, p. 482) 如果在CORDIC _ CSR寄存器中设置了DMA写入使能( DMAWEN )位,且未挂起任何操作,则会产生DMA写通道请求。DMA控制器可以将一个主输入参数( ARG1 )从存储器传输到CORDIC _ WDATA寄存器。写入寄存器将取消DMA的请求。如果CORDIC _ CSR寄存器中NARGS = 1,则产生第二个DMA写通道请求,将第二个输入参数( ARG2 )转移到CORDIC _ WDATA寄存器中。当所有输入参数都写完,并且任何正在进行的计算已经完成(通过阅读结果)时,就开始新的计算,并产生另一个DMA写通道请求。

“If the DMA read enable (DMAREN) bit is set in the CORDIC_CSR register, the RRDY flag going active generates a DMA read channel request. The DMA controller can then transfer the primary result (RES1) from the CORDIC_RDATA register to memory. Reading the register deasserts the DMA request. If NRES = 1 in the CORDIC_CSR register, a second DMA request is generated to read out the secondary result (RES2). When all results have been read, the RRDY flag is deasserted.” (“STM32G4 Series microcontroller reference”, p. 482) 如果在CORDIC _ CSR寄存器中设置DMA读使能( DMAREN )位,则启动RRDY标志位生成DMA读通道请求。然后,DMA控制器可以将CORDIC _ RDATA寄存器中的主要结果( RES1 )传输到存储器中。读取寄存器决定DMA请求。如果CORDIC _ CSR寄存器中NRES = 1,则产生第二个DMA请求,读出次级结果( RES2 )。当所有结果都被读取时,RRDY标志被去重。

“The DMA read and write channels can be enabled separately. If both channels are enabled, the CORDIC can autonomously perform repeated calculations on a buffer of data without processor intervention.This allows the processor to perform other tasks. The DMA controller is operating in memory-to-peripheral mode for the write channel, and peripheral-to-memory mode for the read channel. Note that the sequence is started by the processor setting the DMAWEN flag. Thereafter the DMA read and write requests are generated as fast as the CORDIC can process the data.” (“STM32G4 Series microcontroller reference”, p. 482) DMA读写通道可以单独启用。如果两个通道都启用,CORDIC可以在没有处理器干预的情况下,自主地对数据的缓冲区进行重复计算。这使得处理器可以执行其他任务。DMA控制器对写通道采用内存到外设模式,对读通道采用外设到内存模式。需要注意的是,该序列是由设置DMAWEN标志位的处理器启动的。此后,DMA读写请求的生成速度与CORDIC处理数据的速度一样快。

“In some cases, the input data may be stored in memory, and the output is transferred at regular intervals to another peripheral, such as a digital-to-analog converter. In this case, the destination peripheral generates a DMA request each time it needs a new data. The DMA controller can directly fetch the next sample from the CORDIC_RDATA register (in this case the DMA controller is operating in memory-to-peripheral mode, even though the source is a peripheral register). The act of reading the result allows the CORDIC to start a new calculation, which in turn generates a DMA write channel request, and the DMA controller transfers the next input value to the CORDIC_WDATA register. The DMA write channel is enabled (DMAWEN = 1), but the read channel must not be enabled.” (“STM32G4 Series microcontroller reference”, p. 482) 在某些情况下,输入数据可能存储在内存中,而输出则以一定的间隔传输到另一个外设,如数模转换器。在这种情况下,目的外设每次需要一个新数据时都会产生一个DMA请求。DMA控制器可以直接从CORDIC _ RDATA寄存器(在这种情况下, DMA控制器是以内存到外设的方式工作的,即使源是一个外设寄存器)中取下一个采样值。读取结果的动作使得CORDIC开始新的计算,进而产生DMA写通道请求,DMA控制器将下一个输入值传递给CORDIC _ WDATA寄存器。DMA写通道启用( DMAWEN = 1),但读取通道不得启用。

“In a similar way, data coming from another peripheral, such as an ADC, can be transferred directly to the CORDIC_WDATA register (in peripheral-to-memory mode). The DMA write channel must not be enabled. The CORDIC processes the input data and generate a DMA read request when complete, if DMAREN = 1. The DMA controller then transfers the result from CORDIC_RDATA register to memory (peripheral-to-memory mode).” (“STM32G4 Series microcontroller reference”, p. 482) 类似地,来自另一个外设(如ADC )的数据可以直接传输到CORDIC _ WDATA寄存器(在外设到内存模式下)。不得启用DMA写通道。如果DMAREN = 1,则CORDIC对输入数据进行处理,完成后生成DMA读请求。然后,DMA控制器将CORDIC _ RDATA寄存器的结果传输到存储器(外设到存储器模式)。

NOTE:

“No DMA request is generated to program the CORDIC_CSR register. DMA mode is therefore only useful when repeatedly performing the same function with the same settings. The scale factor cannot be changed during a series of DMA transfers.” (“STM32G4 Series microcontroller reference”, p. 482) CORDIC _ CSR寄存器的编程不需要产生DMA请求。因此,DMA模式只有在使用相同的设置重复执行相同的功能时才有用。在一系列DMA传输过程中,缩放因子不能改变。

“Each DMA request must be acknowledged, as a result of the DMA performing an access to the CORDIC_WDATA or CORDIC_RDATA register. If an extraneous access to the relevant register occurs before this, the acknowledge is asserted prematurely, and could block the DMA channel. Therefore, when the DMA read channel is enabled, CPU access to the CORDIC_RDATA register must be avoided. Similarly, the processor must avoid accessing the CORDIC_WDATA register when the DMA write channel is enabled.” (“STM32G4 Series microcontroller reference”, p. 483) 由于DMA执行对CORDIC _ WDATA或CORDIC _ RDATA寄存器的访问,每个DMA请求都必须被确认。如果在此之前发生了对相关寄存器的外在访问,则会过早地断言确认,并可能阻塞DMA通道。因此,在启用DMA读通道时,必须避免CPU对CORDIC _ RDATA寄存器的访问。同样,当DMA写通道被启用时,CPU必须避免访问CORDIC _ WDATA寄存器。

附录

STM32G4_CORDIC与定点带符号整数数据格式

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/mz__zm/article/details/135501634

智能推荐

oracle 12c 集群安装后的检查_12c查看crs状态-程序员宅基地

文章浏览阅读1.6k次。安装配置gi、安装数据库软件、dbca建库见下:http://blog.csdn.net/kadwf123/article/details/784299611、检查集群节点及状态:[root@rac2 ~]# olsnodes -srac1 Activerac2 Activerac3 Activerac4 Active[root@rac2 ~]_12c查看crs状态

解决jupyter notebook无法找到虚拟环境的问题_jupyter没有pytorch环境-程序员宅基地

文章浏览阅读1.3w次,点赞45次,收藏99次。我个人用的是anaconda3的一个python集成环境,自带jupyter notebook,但在我打开jupyter notebook界面后,却找不到对应的虚拟环境,原来是jupyter notebook只是通用于下载anaconda时自带的环境,其他环境要想使用必须手动下载一些库:1.首先进入到自己创建的虚拟环境(pytorch是虚拟环境的名字)activate pytorch2.在该环境下下载这个库conda install ipykernelconda install nb__jupyter没有pytorch环境

国内安装scoop的保姆教程_scoop-cn-程序员宅基地

文章浏览阅读5.2k次,点赞19次,收藏28次。选择scoop纯属意外,也是无奈,因为电脑用户被锁了管理员权限,所有exe安装程序都无法安装,只可以用绿色软件,最后被我发现scoop,省去了到处下载XXX绿色版的烦恼,当然scoop里需要管理员权限的软件也跟我无缘了(譬如everything)。推荐添加dorado这个bucket镜像,里面很多中文软件,但是部分国外的软件下载地址在github,可能无法下载。以上两个是官方bucket的国内镜像,所有软件建议优先从这里下载。上面可以看到很多bucket以及软件数。如果官网登陆不了可以试一下以下方式。_scoop-cn

Element ui colorpicker在Vue中的使用_vue el-color-picker-程序员宅基地

文章浏览阅读4.5k次,点赞2次,收藏3次。首先要有一个color-picker组件 <el-color-picker v-model="headcolor"></el-color-picker>在data里面data() { return {headcolor: ’ #278add ’ //这里可以选择一个默认的颜色} }然后在你想要改变颜色的地方用v-bind绑定就好了,例如:这里的:sty..._vue el-color-picker

迅为iTOP-4412精英版之烧写内核移植后的镜像_exynos 4412 刷机-程序员宅基地

文章浏览阅读640次。基于芯片日益增长的问题,所以内核开发者们引入了新的方法,就是在内核中只保留函数,而数据则不包含,由用户(应用程序员)自己把数据按照规定的格式编写,并放在约定的地方,为了不占用过多的内存,还要求数据以根精简的方式编写。boot启动时,传参给内核,告诉内核设备树文件和kernel的位置,内核启动时根据地址去找到设备树文件,再利用专用的编译器去反编译dtb文件,将dtb还原成数据结构,以供驱动的函数去调用。firmware是三星的一个固件的设备信息,因为找不到固件,所以内核启动不成功。_exynos 4412 刷机

Linux系统配置jdk_linux配置jdk-程序员宅基地

文章浏览阅读2w次,点赞24次,收藏42次。Linux系统配置jdkLinux学习教程,Linux入门教程(超详细)_linux配置jdk

随便推点

matlab(4):特殊符号的输入_matlab微米怎么输入-程序员宅基地

文章浏览阅读3.3k次,点赞5次,收藏19次。xlabel('\delta');ylabel('AUC');具体符号的对照表参照下图:_matlab微米怎么输入

C语言程序设计-文件(打开与关闭、顺序、二进制读写)-程序员宅基地

文章浏览阅读119次。顺序读写指的是按照文件中数据的顺序进行读取或写入。对于文本文件,可以使用fgets、fputs、fscanf、fprintf等函数进行顺序读写。在C语言中,对文件的操作通常涉及文件的打开、读写以及关闭。文件的打开使用fopen函数,而关闭则使用fclose函数。在C语言中,可以使用fread和fwrite函数进行二进制读写。‍ Biaoge 于2024-03-09 23:51发布 阅读量:7 ️文章类型:【 C语言程序设计 】在C语言中,用于打开文件的函数是____,用于关闭文件的函数是____。

Touchdesigner自学笔记之三_touchdesigner怎么让一个模型跟着鼠标移动-程序员宅基地

文章浏览阅读3.4k次,点赞2次,收藏13次。跟随鼠标移动的粒子以grid(SOP)为partical(SOP)的资源模板,调整后连接【Geo组合+point spirit(MAT)】,在连接【feedback组合】适当调整。影响粒子动态的节点【metaball(SOP)+force(SOP)】添加mouse in(CHOP)鼠标位置到metaball的坐标,实现鼠标影响。..._touchdesigner怎么让一个模型跟着鼠标移动

【附源码】基于java的校园停车场管理系统的设计与实现61m0e9计算机毕设SSM_基于java技术的停车场管理系统实现与设计-程序员宅基地

文章浏览阅读178次。项目运行环境配置:Jdk1.8 + Tomcat7.0 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。项目技术:Springboot + mybatis + Maven +mysql5.7或8.0+html+css+js等等组成,B/S模式 + Maven管理等等。环境需要1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。_基于java技术的停车场管理系统实现与设计

Android系统播放器MediaPlayer源码分析_android多媒体播放源码分析 时序图-程序员宅基地

文章浏览阅读3.5k次。前言对于MediaPlayer播放器的源码分析内容相对来说比较多,会从Java-&amp;amp;gt;Jni-&amp;amp;gt;C/C++慢慢分析,后面会慢慢更新。另外,博客只作为自己学习记录的一种方式,对于其他的不过多的评论。MediaPlayerDemopublic class MainActivity extends AppCompatActivity implements SurfaceHolder.Cal..._android多媒体播放源码分析 时序图

java 数据结构与算法 ——快速排序法-程序员宅基地

文章浏览阅读2.4k次,点赞41次,收藏13次。java 数据结构与算法 ——快速排序法_快速排序法