Function Use; Declaration - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_Add
• Accumulator output with fractional inputs - the output is the accumulator type, where
the result can be out of the range <-1 ; 1). The inputs are the fractional values only.
• Accumulator output with mixed inputs - the output is the accumulator type, where
the result can be out of the range <-1 ; 1). The inputs are the accumulator and
fractional values. The result may overflow.
The available versions of the
Function name
Addend 1
MLIB_Add_F16
frac16_t
MLIB_Add_F32
frac32_t
MLIB_Add_A32ss
frac16_t
MLIB_Add_A32as
acc32_t

2.3.2 Declaration

The available
MLIB_Add
frac16_t MLIB_Add_F16(frac16_t
frac32_t MLIB_Add_F32(frac32_t
acc32_t MLIB_Add_A32ss(frac16_t
acc32_t MLIB_Add_A32as(acc32_t

2.3.3 Function use

The use of the
MLIB_Add
#include "mlib.h"
static
acc32_t
a32Result;
static
frac16_t
f16Add1, f16Add2;
void main(void)
{
f16Add1 = FRAC16(-0.8);
f16Add2 = FRAC16(-0.5);
/* a32Result = f16Add1 + f16Add2 */
a32Result = MLIB_Add_A32ss(f16Add1, f16Add2);
}
26
MLIB_Add
function are shown in the following table.
Table 2-3. Function versions
Input type
Result
type
Addend 2
frac16_t
frac16_t
frac32_t
frac32_t
frac16_t
acc32_t
frac16_t
acc32_t
functions have the following declarations:
f16Add1,
frac16_t
f32Add1,
frac32_t
f16Add1,
frac16_t
a32Accum,
frac16_t
function is shown in the following example:
/* f16Add1 = -0.8 */
/* f16Add2 = -0.5 */
MLIB User's Guide, Rev. 2, 10/2015
Description
Addition of two 16-bit fractional addends. The output is
within the range <-1 ; 1).
Addition of two 32-bit fractional addends. The output is
within the range <-1 ; 1).
Addition of two 16-bit fractional addends; the result is a 32-
bit accumulator. The output may be out of the range <-1 ; 1).
A 16-bit fractional addend is added to a 32-bit accumulator.
The output may be out of the range <-1 ; 1).
f16Add2)
f32Add2)
f16Add2)
f16Add)
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents