Mlib_Mac - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

/* u16Result = log2(u16Val) */
u16Result = MLIB_Log2_U16(u16Val);
}

2.14 MLIB_Mac

The
MLIB_Mac
functions return the sum of the input accumulator, and the fractional
product of two multiplicands. The function does not saturate the output. See the
following equation:
2.14.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 <-1 ; 1). The result may overflow.
• Accumulator output with mixed inputs - the output is the accumulator type, where
the result can be out of the range <-1 ; 1). The accumulator is the accumulator type,
the multiplicands are the fractional types. The result may overflow.
The available versions of the
Function name
Accum.
MLIB_Mac_F16
frac16_t
MLIB_Mac_F32lss
frac32_t
MLIB_Mac_F32
frac32_t
MLIB_Mac_A32ass
acc32_t
Freescale Semiconductor, Inc.
Equation 12. Algorithm formula
MLIB_Mac
function are shown in the following table.
Table 2-14. Function versions
Input type
Result
type
Mult. 1
Mult. 2
frac16_t
frac16_t
frac16_t
frac16_t
frac16_t
frac32_t
frac32_t
frac32_t
frac32_t
frac16_t
frac16_t
acc32_t
MLIB User's Guide, Rev. 2, 10/2015
Chapter 2 Algorithms in detail
Description
The upper 16-bit portion [16..31] of the fractional
product (of two 16-bit fractional multiplicands) is
added to a 16-bit fractional accumulator. The output
is within the range <-1 ; 1).
The 32-bit fractional product (of two 16-bit fractional
multiplicands) is added to a 32-bit fractional
accumulator. The output is within the range <-1 ; 1).
The upper 32-bit portion [32..63] of the fractional
product (of two 32-bit fractional multiplicands) is
added to a 32-bit fractional accumulator. The output
is within the range <-1 ; 1).
The upper 16-bit portion [16..31] of the fractional
product (of two 16-bit fractional multiplicands) is
added to a 32-bit accumulator. The output may be
out of the range <-1 ; 1).
41

Advertisement

Table of Contents
loading

Table of Contents