English
Language : 

PM0014 Datasheet, PDF (32/46 Pages) Solid States Devices, Inc – POWER MODULE
Arithmetic library functions
PM0014
5.6.2
mVM_q15_q15_q15
void mVM_q15_q15_q15 (short Mat[][], short *Vectin, int N, short *Output).
Description:
Argument:
Real 16-bit fractional [N*N] [N*1] matrix multiply. The result vector is
on 1.15 format.
Mat
Pointer to matrix.
Vectin
Pointer to input vector.
N
Size of the squared matrix and size of vectors.
Algorithm:
Note:
Output
Pointer to result vector.
N
Output (i) =  Mat(i, k) x Vectin(k)
k=0
Matrix and Vector should be stored in the DPRAM.
The output vector saturates to 1 or -1 if the result is greater than 1
or respectively lower than -1.
Assembly source
code:
mVM_q15_q15_q15.asm
Code size and cycles: Size: 60 bytes
Instruction cycles: N2 + 10N - 10
Test:
To test this function, two test cases are provided. Each test case
has two input vector files that contain the matrix to multiply and one
output vector file that contains the output matrix. For instance,
mat_10_10.in and vect_10_1.in contains respectively a
Matrix[10][10] and a vector [10][1]. The input file as well as the
output file contains the elements of the matrix sorted as follows:
Op_row1_col1, Op_row1_col2, Op_row1_col3...
....Op_row2_col1,Op_row2_col2...
32/46