1.4.4.30 libq_q15_Add_q15_q15 Function

Add two 16-bit 2s-complement fractional values.

Description

Function libq_q15_Add_q15_q15:

Add two 16-bit 2s-complement fractional (op1 + op2) to produce a 16-bit 2s-complement fractional result with saturation. The saturation is for handling the overflow/underflow cases, where the result is set to MAX16 when an overflow occurs and the result is set to MIN16 when an underflow occurs. This function does not produce any status flag to indicate when an overflow or underflow has occured. It is assumed that the binary point is in exactly the same bit position for both 16-bit inputs and the resulting 16-bit output.

Returns

q15 - a+b on Range: MINFRACT16 <= result <= MAXFRACT16

C

q15 libq_q15_Add_q15_q15 (q15, q15);