Declaration; Function Use; Mlib_Mulrndsat; Available Versions - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_MulRndSat

2.33.2 Declaration

The available
MLIB_MulRnd
frac16_t MLIB_MulRnd_F16(frac16_t
frac16_t MLIB_MulRnd_F16as(acc32_t
frac32_t MLIB_MulRnd_F32ls(frac32_t
frac32_t MLIB_MulRnd_F32(frac32_t
acc32_t MLIB_MulRnd_A32(acc32_t

2.33.3 Function use

The use of the
MLIB_MulRnd
#include "mlib.h"
static
frac32_t
f32Mult1, f32Mult2, f32Result;
void main(void)
{
f32Mult1 = FRAC32(0.5);
f32Mult2 = FRAC32(-0.24564);
/* f32Result = round(f32Mult1 * f32Mult2) */
f32Result = MLIB_MulRnd_F32(f32Mult1, f32Mult2);
}
2.34 MLIB_MulRndSat
The
MLIB_MulRndSat
round method is the round to nearest. The function saturates the output. See the following
equation:

2.34.1 Available versions

This function is available in the following versions:
• Fractional output with fractional inputs - the output is the fractional portion of the
result; the result is within the range <-1 ; 1). The inputs are the fractional values only.
The result may saturate.
70
functions have the following declarations:
f16Mult1,
frac16_t
a32Accum,
frac16_t
f32Mult1,
frac16_t
f32Mult1,
frac32_t
a32Mult1,
acc32_t
function is shown in the following example:
/* f32Mult1 = 0.5 */
/* f32Mult2 = -0.24564 */
functions return the rounded product of two multiplicands. The
Equation 32. Algorithm formula
MLIB User's Guide, Rev. 2, 10/2015
f16Mult2)
f16Mult)
f16Mult2)
f32Mult2)
a32Mult1)
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents