Declaration - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

2.16.2 Declaration

The available
MLIB_MacRnd
frac16_t MLIB_MacRnd_F16(frac16_t
frac32_t MLIB_MacRnd_F32lls(frac32_t
frac32_t MLIB_MacRnd_F32(frac32_t
acc32_t MLIB_MacRnd_A32ass(acc32_t
2.16.3 Function use
The use of the
MLIB_MacRnd
#include "mlib.h"
static
frac16_t
f16Accum, f16Mult1, f16Mult2, f16Result;
void main(void)
{
f16Accum = FRAC16(0.3);
f16Mult1 = FRAC16(0.1);
f16Mult2 = FRAC16(-0.2);
/* f16Result = round(f16Accum + f16Mult1 * f16Mult2) */
f16Result = MLIB_MacRnd_F16(f16Accum, f16Mult1, f16Mult2);
}
2.17 MLIB_MacRndSat
The
MLIB_MacRndSat
rounded fractional product of two multiplicands. The round method is the round to
nearest. The function saturates the output. See the following equation:
2.17.1 Available versions
This function is available in the following versions:
Freescale Semiconductor, Inc.
functions have the following declarations:
f16Accum,
frac16_t
f32Accum,
f32Accum,
frac32_t
a32Accum,
frac16_t
function is shown in the following example:
/* f16Accum = 0.3 */
/* f16Mult1 = 0.1 */
/* f16Mult2 = -0.2 */
functions return the sum of the input accumulator and the
Equation 15. Algorithm formula
MLIB User's Guide, Rev. 2, 10/2015
f16Mult1,
frac16_t
frac32_t
f32Mult1,
frac16_t
f32Mult1,
frac32_t
f16Mult1,
frac16_t
Chapter 2 Algorithms in detail
f16Mult2)
f16Mult2)
f32Mult2)
f16Mult2)
45

Advertisement

Table of Contents
loading

Table of Contents