blob: 05d4a8acb961df188bf1a9b80f0de93fed8d3429 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
component minmax "Track the minimum and maximum values of the input to the outputs";
pin in float in;
pin in bit reset "When reset is asserted, 'in' is copied to the outputs";
pin out float max_;
pin out float min_;
function _;
license "GPL";
;;
FUNCTION(_) {
if(reset) { max_ = min_ = in; }
else {
if(in > max_) max_ = in;
if(in < min_) min_ = in;
}
}
|