1.4.4.23 Fract_XtimesY_Q15 Function

fract_q15_t Fract_XtimesY_Q15(fract_q15_t x, fract_q15_t y );

Summary

Calculates product of X*Y for Q15 fixed point

Description

Calculates product of X*Y for Q15 fixed point

Preconditions

None

Parameters

x Q15 multiplicand

y Q15 multiplicand

Returns

Q15 product x*y

Remarks

Since both x and y are Q15 fixed point numbers the product x*y is also Q15.

Example

fract_q15_t x, y, xtimesy;

x = 0x1234; _// 4660/32768 = 0.142219_

y = 0x5678; _// 22136/32768 = 0.675537_

xtimesy = Fract_XtimesY_Q15(x,y);

_// x*y = 0.142219 * 0.675537 = 0.096069_

_// xtimesy = 0x0C4C = 3148/32768 = 0.096069_

C

fract_q15_t Fract_XtimesY_Q15 (fract_q15_t x , fract_q15_t y );