Declaration - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_Sub4
The available versions of the
Function name
Minuend
MLIB_SubSat_F16
frac16_t
MLIB_SubSat_F32
frac32_t

2.55.2 Declaration

The available
MLIB_SubSat
frac16_t MLIB_SubSat_F16(frac16_t
frac32_t MLIB_SubSat_F32(frac32_t
2.55.3 Function use
The use of the
MLIB_SubSat
#include "mlib.h"
static
frac32_t
f32Min, f32Sub, f32Result;
void main(void)
{
f32Min = FRAC32(-0.5);
f32Sub = FRAC32(0.8);
/* f32Result = sat(f32Min - f32Sub) */
f32Result = MLIB_SubSat_F32(f32Min,f32Sub);
}
2.56 MLIB_Sub4
The
MLIB_Sub4
functions return the subtraction of three subtrahends from the minuend.
The function does not saturate the output. See the following equation:
98
MLIB_SubSat
function are shown in the following table.
Table 2-55. Function versions
Input type
Result
type
Subtrahend
frac16_t
frac16_t
frac32_t
frac32_t
functions have the following declarations:
f16Min,
frac16_t
f32Min,
frac32_t
function is shown in the following example:
/* f32Min = -0.5 */
/* f32Sub = 0.8 */
Equation 54. Algorithm formula
MLIB User's Guide, Rev. 2, 10/2015
Description
Subtraction of a 16-bit fractional subtrahend from a 16-bit
fractional minuend. The output is within the range <-1 ; 1).
Subtraction of a 32-bit fractional subtrahend from a 32-bit
fractional minuend. The output is within the range <-1 ; 1).
f16Sub)
f32Sub)
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents