1.4.4.53 libq_q31_Multi_q15_q31 Function

Implement 16 bit by 32 bit multiply.

Description

Function libq_q31_Multi_q15_q31():

Implement 16 bit by 32 bit multiply as shown below The s and u notation shows the processing of signed and unsigned numbers.

-B1- -B0- s u 2nd argument is 32 bits -A0- s 1st argument is 16 bits

------------

A0B0 A0B0 s=su 1st 32-bit product is A0B0 A0B1 A0B1 s=ss 2nd 32-bit product is A0B1

------------

-S2- -S1- -S0- s=s+s 48-bit result is the sum of products

-P1- -P0- 32-bit return is the most significant bits of sum

The algorithm is implemented entirely with the fractional arithmetic library. The unsigned by signed multiply is implemented by shifting bits 15:1 to bits 14:0 of a 16-bit positive fractional number, which throws away bit 0 of the 32-bit number. Since that affects result bits that are used for rounding, rounding processing is included. Saturation processing is handled implicitly in the fractional arithmetic library, except for the case of maximum negative numbers.

Returns

q31 result - a*b rounded

C

q31 libq_q31_Multi_q15_q31 (q15 argAQ1d15 , q31 argBQ1d31 );