Mlib_Mulneg; Available Versions - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

#include "mlib.h"
static
acc32_t
a32Accum;
static
frac16_t
f16Mult, f16Result;
void main(void)
{
a32Accum = ACC32(-5.5);
f16Mult = FRAC16(0.3);
/* f16Result = sat(a32Accum * f16Mult) */
f16Result = MLIB_MulSat_F16as(a32Accum, f16Mult);
}

2.32 MLIB_MulNeg

The
MLIB_MulNeg
function does not saturate the output. See the following equation:

2.32.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.
• Fractional output with mixed inputs - the output is the fractional portion of the result;
the result is within the range <-1 ; 1). The inputs are the accumulator and fractional
values. The result may overflow.
• Accumulator output - the output is the accumulator type where the result can be out
of the range <-1;1). The result may overflow.
The available versions of the
Function name
MLIB_MuNegl_F16
frac16_t
MLIB_MulNeg_F16as
acc32_t
Freescale Semiconductor, Inc.
/* a32Accum = -5.5 */
/* f16Mult = 0.3 */
functions return the negative product of two multiplicands. The
Equation 30. Algorithm formula
MLIB_MulNeg
Table 2-32. Function versions
Input type
Result
type
Mult. 1
Mult. 2
frac16_t
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
Negative product of two 16-bit fractional multiplicands; the
output are the upper 16 bits of the results [16..31]. The output
is within the range <-1 ; 1).
Negative product of a 32-bit accumulator and a 16-bit fractional
multiplicand; the output is a 16-bit fractional value, which has
the upper 16 bits of the fractional portion of the result [16..31].
The output is within the range <-1 ; 1).
Chapter 2 Algorithms in detail
67

Advertisement

Table of Contents
loading

Table of Contents