-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdotp_solution.txt
55 lines (37 loc) · 961 Bytes
/
dotp_solution.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* ======== clock.c ========
* The clock example shows how to use the ti.sysbios.knl.Clock module to
* create one-shot and periodic Clock Instances. Clock Instances are
* essentially functions that run after a certain number of Clock ticks.
*/
#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Clock.h>
#include <xdc/runtime/Timestamp.h>
Void clk0Fxn(UArg arg0);
int dotp(short *m, short *n, int count);
/* Include Files */
#include "data.h"
/* Definitions */
#define COUNT 256
short a[COUNT] = {A_ARRAY};
short x[COUNT] = {X_ARRAY};
volatile int y = 0;
/*
* ======== main ========
*/
void main()
{
y = dotp(a, x, COUNT); // matrix multiplication
System_printf("y = %d \n", y);
System_printf("y = %x \n", y);
}
int dotp(short *m, short *n, int count)
{
int acc,i;
acc = 0;
for (i = 0; i<count; i++)
acc += m[i]*n[i];
return acc;
}