IQMathLibrary  1.0
Functions
_IQNrmpy.c File Reference

Detailed Description

Functions to multiply two IQ numbers, returning the product in IQ format. The result is rounded but not saturated, so if the product is greater than the minimum or maximum values for the given IQ format, the return value wraps around and produces inaccurate results.



#include <stdint.h>
#include "../support/support.h"
Include dependency graph for _IQNrmpy.c:

Functions

__STATIC_INLINE int_fast32_t __IQNrmpy (int_fast32_t iqNInput1, int_fast32_t iqNInput2, const int8_t q_value)
 Multiply two values of IQN type, with rounding. More...
 
int32_t _IQ31rmpy (int32_t a, int32_t b)
 Multiply two values of IQ31 type, with rounding. More...
 
int32_t _IQ30rmpy (int32_t a, int32_t b)
 Multiply two values of IQ30 type, with rounding. More...
 
int32_t _IQ29rmpy (int32_t a, int32_t b)
 Multiply two values of IQ29 type, with rounding. More...
 
int32_t _IQ28rmpy (int32_t a, int32_t b)
 Multiply two values of IQ28 type, with rounding. More...
 
int32_t _IQ27rmpy (int32_t a, int32_t b)
 Multiply two values of IQ27 type, with rounding. More...
 
int32_t _IQ26rmpy (int32_t a, int32_t b)
 Multiply two values of IQ26 type, with rounding. More...
 
int32_t _IQ25rmpy (int32_t a, int32_t b)
 Multiply two values of IQ25 type, with rounding. More...
 
int32_t _IQ24rmpy (int32_t a, int32_t b)
 Multiply two values of IQ24 type, with rounding. More...
 
int32_t _IQ23rmpy (int32_t a, int32_t b)
 Multiply two values of IQ23 type, with rounding. More...
 
int32_t _IQ22rmpy (int32_t a, int32_t b)
 Multiply two values of IQ22 type, with rounding. More...
 
int32_t _IQ21rmpy (int32_t a, int32_t b)
 Multiply two values of IQ21 type, with rounding. More...
 
int32_t _IQ20rmpy (int32_t a, int32_t b)
 Multiply two values of IQ20 type, with rounding. More...
 
int32_t _IQ19rmpy (int32_t a, int32_t b)
 Multiply two values of IQ19 type, with rounding. More...
 
int32_t _IQ18rmpy (int32_t a, int32_t b)
 Multiply two values of IQ18 type, with rounding. More...
 
int32_t _IQ17rmpy (int32_t a, int32_t b)
 Multiply two values of IQ17 type, with rounding. More...
 
int32_t _IQ16rmpy (int32_t a, int32_t b)
 Multiply two values of IQ16 type, with rounding. More...
 
int32_t _IQ15rmpy (int32_t a, int32_t b)
 Multiply two values of IQ15 type, with rounding. More...
 
int32_t _IQ14rmpy (int32_t a, int32_t b)
 Multiply two values of IQ14 type, with rounding. More...
 
int32_t _IQ13rmpy (int32_t a, int32_t b)
 Multiply two values of IQ13 type, with rounding. More...
 
int32_t _IQ12rmpy (int32_t a, int32_t b)
 Multiply two values of IQ12 type, with rounding. More...
 
int32_t _IQ11rmpy (int32_t a, int32_t b)
 Multiply two values of IQ11 type, with rounding. More...
 
int32_t _IQ10rmpy (int32_t a, int32_t b)
 Multiply two values of IQ10 type, with rounding. More...
 
int32_t _IQ9rmpy (int32_t a, int32_t b)
 Multiply two values of IQ9 type, with rounding. More...
 
int32_t _IQ8rmpy (int32_t a, int32_t b)
 Multiply two values of IQ8 type, with rounding. More...
 
int32_t _IQ7rmpy (int32_t a, int32_t b)
 Multiply two values of IQ7 type, with rounding. More...
 
int32_t _IQ6rmpy (int32_t a, int32_t b)
 Multiply two values of IQ6 type, with rounding. More...
 
int32_t _IQ5rmpy (int32_t a, int32_t b)
 Multiply two values of IQ5 type, with rounding. More...
 
int32_t _IQ4rmpy (int32_t a, int32_t b)
 Multiply two values of IQ4 type, with rounding. More...
 
int32_t _IQ3rmpy (int32_t a, int32_t b)
 Multiply two values of IQ3 type, with rounding. More...
 
int32_t _IQ2rmpy (int32_t a, int32_t b)
 Multiply two values of IQ2 type, with rounding. More...
 
int32_t _IQ1rmpy (int32_t a, int32_t b)
 Multiply two values of IQ1 type, with rounding. More...
 

Function Documentation

§ __IQNrmpy()

__STATIC_INLINE int_fast32_t __IQNrmpy ( int_fast32_t  iqNInput1,
int_fast32_t  iqNInput2,
const int8_t  q_value 
)

Multiply two values of IQN type, with rounding.

Parameters
iqNInput1IQN type value input to be multiplied.
iqNInput2IQN type value input to be multiplied.
q_valueIQ format for result.
Returns
IQN type result of the multiplication.

Referenced by _IQ10rmpy(), _IQ11rmpy(), _IQ12rmpy(), _IQ13rmpy(), _IQ14rmpy(), _IQ15rmpy(), _IQ16rmpy(), _IQ17rmpy(), _IQ18rmpy(), _IQ19rmpy(), _IQ1rmpy(), _IQ20rmpy(), _IQ21rmpy(), _IQ22rmpy(), _IQ23rmpy(), _IQ24rmpy(), _IQ25rmpy(), _IQ26rmpy(), _IQ27rmpy(), _IQ28rmpy(), _IQ29rmpy(), _IQ2rmpy(), _IQ30rmpy(), _IQ31rmpy(), _IQ3rmpy(), _IQ4rmpy(), _IQ5rmpy(), _IQ6rmpy(), _IQ7rmpy(), _IQ8rmpy(), and _IQ9rmpy().

§ _IQ31rmpy()

int32_t _IQ31rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ31 type, with rounding.

Parameters
aIQ31 type value input to be multiplied.
bIQ31 type value input to be multiplied.
Returns
IQ31 type result of the multiplication.

References __IQNrmpy().

§ _IQ30rmpy()

int32_t _IQ30rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ30 type, with rounding.

Parameters
aIQ30 type value input to be multiplied.
bIQ30 type value input to be multiplied.
Returns
IQ30 type result of the multiplication.

References __IQNrmpy().

§ _IQ29rmpy()

int32_t _IQ29rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ29 type, with rounding.

Parameters
aIQ29 type value input to be multiplied.
bIQ29 type value input to be multiplied.
Returns
IQ29 type result of the multiplication.

References __IQNrmpy().

§ _IQ28rmpy()

int32_t _IQ28rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ28 type, with rounding.

Parameters
aIQ28 type value input to be multiplied.
bIQ28 type value input to be multiplied.
Returns
IQ28 type result of the multiplication.

References __IQNrmpy().

§ _IQ27rmpy()

int32_t _IQ27rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ27 type, with rounding.

Parameters
aIQ27 type value input to be multiplied.
bIQ27 type value input to be multiplied.
Returns
IQ27 type result of the multiplication.

References __IQNrmpy().

§ _IQ26rmpy()

int32_t _IQ26rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ26 type, with rounding.

Parameters
aIQ26 type value input to be multiplied.
bIQ26 type value input to be multiplied.
Returns
IQ26 type result of the multiplication.

References __IQNrmpy().

§ _IQ25rmpy()

int32_t _IQ25rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ25 type, with rounding.

Parameters
aIQ25 type value input to be multiplied.
bIQ25 type value input to be multiplied.
Returns
IQ25 type result of the multiplication.

References __IQNrmpy().

§ _IQ24rmpy()

int32_t _IQ24rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ24 type, with rounding.

Parameters
aIQ24 type value input to be multiplied.
bIQ24 type value input to be multiplied.
Returns
IQ24 type result of the multiplication.

References __IQNrmpy().

§ _IQ23rmpy()

int32_t _IQ23rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ23 type, with rounding.

Parameters
aIQ23 type value input to be multiplied.
bIQ23 type value input to be multiplied.
Returns
IQ23 type result of the multiplication.

References __IQNrmpy().

§ _IQ22rmpy()

int32_t _IQ22rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ22 type, with rounding.

Parameters
aIQ22 type value input to be multiplied.
bIQ22 type value input to be multiplied.
Returns
IQ22 type result of the multiplication.

References __IQNrmpy().

§ _IQ21rmpy()

int32_t _IQ21rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ21 type, with rounding.

Parameters
aIQ21 type value input to be multiplied.
bIQ21 type value input to be multiplied.
Returns
IQ21 type result of the multiplication.

References __IQNrmpy().

§ _IQ20rmpy()

int32_t _IQ20rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ20 type, with rounding.

Parameters
aIQ20 type value input to be multiplied.
bIQ20 type value input to be multiplied.
Returns
IQ20 type result of the multiplication.

References __IQNrmpy().

§ _IQ19rmpy()

int32_t _IQ19rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ19 type, with rounding.

Parameters
aIQ19 type value input to be multiplied.
bIQ19 type value input to be multiplied.
Returns
IQ19 type result of the multiplication.

References __IQNrmpy().

§ _IQ18rmpy()

int32_t _IQ18rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ18 type, with rounding.

Parameters
aIQ18 type value input to be multiplied.
bIQ18 type value input to be multiplied.
Returns
IQ18 type result of the multiplication.

References __IQNrmpy().

§ _IQ17rmpy()

int32_t _IQ17rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ17 type, with rounding.

Parameters
aIQ17 type value input to be multiplied.
bIQ17 type value input to be multiplied.
Returns
IQ17 type result of the multiplication.

References __IQNrmpy().

§ _IQ16rmpy()

int32_t _IQ16rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ16 type, with rounding.

Parameters
aIQ16 type value input to be multiplied.
bIQ16 type value input to be multiplied.
Returns
IQ16 type result of the multiplication.

References __IQNrmpy().

§ _IQ15rmpy()

int32_t _IQ15rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ15 type, with rounding.

Parameters
aIQ15 type value input to be multiplied.
bIQ15 type value input to be multiplied.
Returns
IQ15 type result of the multiplication.

References __IQNrmpy().

§ _IQ14rmpy()

int32_t _IQ14rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ14 type, with rounding.

Parameters
aIQ14 type value input to be multiplied.
bIQ14 type value input to be multiplied.
Returns
IQ14 type result of the multiplication.

References __IQNrmpy().

§ _IQ13rmpy()

int32_t _IQ13rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ13 type, with rounding.

Parameters
aIQ13 type value input to be multiplied.
bIQ13 type value input to be multiplied.
Returns
IQ13 type result of the multiplication.

References __IQNrmpy().

§ _IQ12rmpy()

int32_t _IQ12rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ12 type, with rounding.

Parameters
aIQ12 type value input to be multiplied.
bIQ12 type value input to be multiplied.
Returns
IQ12 type result of the multiplication.

References __IQNrmpy().

§ _IQ11rmpy()

int32_t _IQ11rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ11 type, with rounding.

Parameters
aIQ11 type value input to be multiplied.
bIQ11 type value input to be multiplied.
Returns
IQ11 type result of the multiplication.

References __IQNrmpy().

§ _IQ10rmpy()

int32_t _IQ10rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ10 type, with rounding.

Parameters
aIQ10 type value input to be multiplied.
bIQ10 type value input to be multiplied.
Returns
IQ10 type result of the multiplication.

References __IQNrmpy().

§ _IQ9rmpy()

int32_t _IQ9rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ9 type, with rounding.

Parameters
aIQ9 type value input to be multiplied.
bIQ9 type value input to be multiplied.
Returns
IQ9 type result of the multiplication.

References __IQNrmpy().

§ _IQ8rmpy()

int32_t _IQ8rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ8 type, with rounding.

Parameters
aIQ8 type value input to be multiplied.
bIQ8 type value input to be multiplied.
Returns
IQ8 type result of the multiplication.

References __IQNrmpy().

§ _IQ7rmpy()

int32_t _IQ7rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ7 type, with rounding.

Parameters
aIQ7 type value input to be multiplied.
bIQ7 type value input to be multiplied.
Returns
IQ7 type result of the multiplication.

References __IQNrmpy().

§ _IQ6rmpy()

int32_t _IQ6rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ6 type, with rounding.

Parameters
aIQ6 type value input to be multiplied.
bIQ6 type value input to be multiplied.
Returns
IQ6 type result of the multiplication.

References __IQNrmpy().

§ _IQ5rmpy()

int32_t _IQ5rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ5 type, with rounding.

Parameters
aIQ5 type value input to be multiplied.
bIQ5 type value input to be multiplied.
Returns
IQ5 type result of the multiplication.

References __IQNrmpy().

§ _IQ4rmpy()

int32_t _IQ4rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ4 type, with rounding.

Parameters
aIQ4 type value input to be multiplied.
bIQ4 type value input to be multiplied.
Returns
IQ4 type result of the multiplication.

References __IQNrmpy().

§ _IQ3rmpy()

int32_t _IQ3rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ3 type, with rounding.

Parameters
aIQ3 type value input to be multiplied.
bIQ3 type value input to be multiplied.
Returns
IQ3 type result of the multiplication.

References __IQNrmpy().

§ _IQ2rmpy()

int32_t _IQ2rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ2 type, with rounding.

Parameters
aIQ2 type value input to be multiplied.
bIQ2 type value input to be multiplied.
Returns
IQ2 type result of the multiplication.

References __IQNrmpy().

§ _IQ1rmpy()

int32_t _IQ1rmpy ( int32_t  a,
int32_t  b 
)

Multiply two values of IQ1 type, with rounding.

Parameters
aIQ1 type value input to be multiplied.
bIQ1 type value input to be multiplied.
Returns
IQ1 type result of the multiplication.

References __IQNrmpy().

© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale