Function Use - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_Div1Q
frac16_t MLIB_DivSat_F16(frac16_t
frac16_t MLIB_DivSat_F16ls(frac32_t
frac16_t MLIB_DivSat_F16ll(frac32_t
frac32_t MLIB_DivSat_F32ls(frac32_t
frac32_t MLIB_DivSat_F32(frac32_t
acc32_t MLIB_DivSat_A32as(acc32_t

2.10.3 Function use

The use of the
MLIB_DivSat
#include "mlib.h"
static
frac32_t
f32Num, f32Denom, f32Result;
void main(void)
{
f32Num = FRAC32(0.4);
f32Denom = FRAC32(-0.02);
/* f32Result = f32Num / f32Denom */
f32Result = MLIB_DivSat_F32(f32Num, f32Denom);
}
2.11 MLIB_Div1Q
The
MLIB_Div1Q
functions return the single-quadrant fractional division of the
numerator and denominator. The numerator and denominator must be non-negative
numbers, otherwise the function returns undefined results. The function does not saturate
the output. See the following equation:
2.11.1 Available versions
This function is available in the following versions:
• Fractional output - the output is the fractional portion of the result; the result is
within the range <0 ; 1). The function is only defined for: nominator < denominator,
and both are non-negative. The function returns undefined results out of this
condition.
• Accumulator output - the output is the accumulator type, where the result is greater
than or equal to 0.
36
f16Num,
frac16_t
f16Denom)
f32Num,
frac16_t
f32Num,
frac32_t
f32Num,
frac16_t
f32Num,
frac32_t
f32Denom)
a32Num,
frac16_t
f16Denom)
function is shown in the following example:
/* f32Num = 0.4 */
/* f32Denom = -0.02 */
Equation 9. Algorithm formula
MLIB User's Guide, Rev. 2, 10/2015
f16Denom)
f32Denom)
f16Denom)
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents