Function Use - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_Div1QSat

2.11.3 Function use

The use of the
MLIB_Div1Q
#include "mlib.h"
static
frac32_t
f32Num, f32Denom, f32Result;
void main(void)
{
f32Num = FRAC32(0.2);
f32Denom = FRAC32(0.865);
/* f32Result = f32Num / f32Denom */
f32Result = MLIB_Div1Q_F32(f32Num, f32Denom);
}
2.12 MLIB_Div1QSat
The
MLIB_Div1QSat
denominator. The numerator and denominator must be non-negative numbers. The
function saturates the output. See the following equation:
2.12.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 result may saturate.
• Accumulator output - the output is the accumulator type, where the result is greater
than or equal to 0.
The available versions of the
Function name
MLIB_Div1QSat_F16
38
function is shown in the following example:
/* f32Num = 0.2 */
/* f32Denom = 0.865 */
functions return the fractional division of the numerator and
Equation 10. Algorithm formula
MLIB_Div1QSat
Table 2-12. Function versions
Input type
Result
type
Num.
Denom.
frac16_t
frac16_t
frac16_t
Table continues on the next page...
MLIB User's Guide, Rev. 2, 10/2015
function are shown in the following table:
Description
Division of a non-negative 16-bit fractional numerator and
denominator. The output is within the range <0 ; 1).
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents