
ST52F510/F513/F514
58/106
Example 1
:
IF Input
1
IS NOT Mbf
1
AND Input
4
is Mbf
12
OR Input
3
IS Mbf
8
THEN Crisp
1
is codified by the following instructions:
ISNOT 1 1
calculates the NOT
α
value of Input
1
with Mbf
1
and stores the result in internal registers
Example 2
, the priority of the operator is fixed by the brackets:
IF (Input
3
IS Mbf
1
AND Input
4
IS NOT Mbf
15
) OR (Input
1
IS Mbf
6
OR Input
6
IS NOT Mbf
14
) THEN Crisp
2
At the end of the fuzzy rules related to the current Fuzzy Variable, by using the instruction
OUT reg
, the
specified registeris written with the computed value. Afterwards,the control ofthe algorithm returns to the
CU. The next Fuzzy Variable evaluation must start again with a FUZZY instruction.
FZAND
implements the operation AND between the previous and the next alpha value evaluated
IS 4 12
fixes the
α
value of Input
4
with Mbf
12
and stores the result in internal registers
FZOR
implements the operation OR between the previous and the next alpha value evaluated
IS 3 8
fixes the
α
value of Input
3
with Mbf
8
and stores the result in internal registers
CON crisp
1
multiplies the result of the last
operation with the crisp value crisp
1
(
parenthesis open to change the priority
IS 3 1
fixes the
α
value of Input
3
with Mbf
1
and stores the result in internal registers
FZAND
implements the operation AND between the previous and the next alpha value evaluated
ISNOT 4 15
calculates the NOT
α
value of Input
4
with Mbf
15
and stores the result in internal registers
)
parenthesis closed
FZOR
implements the operation OR between the previous and the next alpha value evaluated
(
parenthesis open to change the priority
IS 1 6
fixes the
α
value of Input
1
with Mbf
6
and stores the result in internal registers
FZOR
implements the operation OR between the previous and the next alpha value evaluated
ISNOT 2 14
calculates the NOT
α
value of Input
6
with Mbf
14
and stores the result in internal registers
)
parenthesis closed
CON crisp
2
multiplies the result of the last
operation with the crisp value crisp
2