Edge tracking operators
In addition to the operators and indicators from the articles Operators of temporal logic and Indicators of change, edge tracking operators can be set on transitions .
Front tracking operators are functions rising
, falling
and crossing
, which return the logical value true
when the signal changes in a certain way. This allows the finite automaton to determine the exact moment of switching: not by the current value of the signal, but by its change in time.
What is a signal change and an edge
In digital systems, signals are often represented by logical values - logic 0 (false) and logic 1 (true). A change in such a case is a transition between these two states.
In continuous systems (e.g. with analogue signals), the values can be any numerical value, and the moment when the signal crosses a certain threshold - especially the value zero - is considered important.
Changes in the signal are called fronts. Two main types are distinguished:
-
Rising edge - the transition of a signal across
0
from a smaller value to a larger one (e.g. from-1
to0.5
); -
Decreasing front - signal transition through
0
from a larger value to a smaller one (for example, from1
to-0.2
).
Logic of triggering operators
Each of the operators (rising
, falling
, crossing
) is an expression that returns the value true
only when the signal changes in a certain way. At all other times it is false
.
Let’s consider the triggering conditions of each operator.
Operator rising(x)
The rising(x)
operator returns true
at the moment when the signal x
crosses zero from bottom to top (increasing).
This occurs in two cases:
-
The previous value of
x
was negative and the current value has become zero or positive; -
The previous value of
x
was zero and the current value has become positive.
Thus, rising(x)
is a detector of a transition in the positive direction.
For example, let the variable x
change from -0.2
→ 0.1
. The rising(x)
operator will return true
in this case, since there has been a zero crossing from bottom to top. If x
changes from 0.1
to -0.1
, the operator will not work.
Similarly, rising(x - 0.5)
tracks the moment x
crosses the value 0.5 from bottom to top. For example:
-
x
was0.4
, became0.6
→rising(x - 0.5)
will returntrue
; -
x
was0.6
, became0.4
→rising(x - 0.5)
will returnfalse
.
The operator falling(x)
The falling(x)
operator returns true
when the signal x
crosses zero from top to bottom. It is triggered when:
-
A previous positive value of
x
if the current value is zero or negative; -
Previous zero value of
x
if the current value has become negative.
Thus, falling(x)
responds to a transition in the negative direction.
+ Example:
-
x
was0.2
, became-0.1
→falling(x)
will returntrue
; -
x
was-0.1
, became-0.2
→ will not work.
For falling(x - 0.5)
is similar: the operator will trigger when x
crosses 0.5
from top to bottom. For example:
-
x
changes from0.6
to0.4
→ triggers; -
x
varies from0.4
to0.6
→ does not trigger.
Operator crossing(x)
.
The crossing(x)
operator is a general-purpose operator that returns true
any time the signal crosses zero (or other specified threshold), regardless of direction. It is triggered under one of the following conditions:
-
The previous value was positive and the current value was zero or negative;
-
The previous value was zero and the current value was non-zero;
-
The previous value was negative and the current value is zero or positive.
Thus, the crossing(x)
operator captures any transition through zero - both up (increasing) and down (decreasing). For example:
-
x
changes from0.6
to0.4
→crossing(x - 0.5)
will returntrue
; -
x
changes from0.4
to0.6
→ alsotrue
; -
x
remains below0.5
or above0.5
, does not cross the threshold →false
.
Special attention should be paid to how equality to zero is handled. Unlike the simple For example:
|