Commit 811801cc authored by nilsfreyer's avatar nilsfreyer
Browse files

Deleted old files

parent a38c9452
package CalculatorTest;
import NumberDetector;
component Calculator{
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,
out Z(0:1998) result;
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;
implementation Math{
result = nd1.number + nd2.number;
}
}
package CalculatorTest;
component NumberDetector{
ports in Q(0:1)^10 pred_num1,
in Q(0:1)^10 pred_num2,
in Q(0:1)^10 pred_num3,
out Z(0:999) number;
implementation Math{
for j = 1:3
if(j == 1)
tmp_vector = pred_num1;
end
if(j == 2)
tmp_vector = pred_num2;
end
if(j == 3)
tmp_vector = pred_num3;
end
maxIndex = 0;
maxValue = tmp_vector(1);
for i = 2:10
if tmp_vector(i) > maxValue
maxIndex = i - 1;
maxValue = tmp_vector(i);
end
end
if(j == 1)
num1 = maxIndex;
end
if(j == 2)
num2 = maxIndex;
end
if(j == 3)
num3 = maxIndex;
end
end
number = (num1*100) + (num2*10) + num3;
}
}
package CalculatorTest;
import NumberDetector;
component Calculator{
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,
out Z(0:1998) result;
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;
implementation Math{
result = nd1.number + nd2.number;
}
}
package CalculatorTest;
component NumberDetector{
ports in Q(0:1)^10 pred_num1,
in Q(0:1)^10 pred_num2,
in Q(0:1)^10 pred_num3,
out Z(0:999) number;
implementation Math{
for j = 1:3
if(j == 1)
tmp_vector = pred_num1;
end
if(j == 2)
tmp_vector = pred_num2;
end
if(j == 3)
tmp_vector = pred_num3;
end
maxIndex = 0;
maxValue = tmp_vector(1);
for i = 2:10
if tmp_vector(i) > maxValue
maxIndex = i - 1;
maxValue = tmp_vector(i);
end
end
if(j == 1)
num1 = maxIndex;
end
if(j == 2)
num2 = maxIndex;
end
if(j == 3)
num3 = maxIndex;
end
end
number = (num1*100) + (num2*10) + num3;
}
}
package TestA;
stream CalulatorStreamtest for Calculator {
input1:[0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0] [0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0] ; [0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0]];
input2:[[0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0] ; [0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0] ; [0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0]];
out1: 444;
}
\ No newline at end of file
package CalculatorTest;
stream streamtest_calculator for Calculator {
vec1_1: (0,0,1,0,0,0,0,0,0,0);
vec1_2: (0,0,1,0,0,0,0,0,0,0);
vec1_3: (0,0,1,0,0,0,0,0,0,0);
vec2_1: (0,0,1,0,0,0,0,0,0,0);
vec2_2: (0,0,1,0,0,0,0,0,0,0);
vec2_3: (0,0,1,0,0,0,0,0,0,0);
out1: 444;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment