Calculator.emadl 656 Bytes
Newer Older
1
2
3
package CalculatorTest;
import NumberDetector;

Maurice's avatar
Maurice committed
4
component Calculator{
5
6
7
8
9
10
    ports in Q(0:1)^10 vec1_1,
          in Q(0:1)^10 vec1_2,
          in Q(0:1)^10 vec1_3,
          in Q(0:1)^10 vec2_1,
          in Q(0:1)^10 vec2_2,
          in Q(0:1)^10 vec2_3,
Maurice's avatar
Maurice committed
11
12
          out Z(0:1998) result;

13
14
15
16
17
18
19
20
21
22
    instance NumberDetector nd1;
    instance NumberDetector nd2;

    connect vec1_1 -> nd1.pred_num1;
    connect vec1_2 -> nd1.pred_num2;
    connect vec1_3 -> nd1.pred_num3;
    connect vec2_1 -> nd2.pred_num1;
    connect vec2_2 -> nd2.pred_num2;
    connect vec2_3 -> nd2.pred_num3;

Maurice's avatar
Maurice committed
23
    implementation Math{
24
          result = nd1.number + nd2.number;
Maurice's avatar
Maurice committed
25
26
    }
}