ST52T400/T440/E440/T441
Example 1:
IF Input1 IS NOT Mbf1 AND Input4 is Mbf12 OR Input3 IS Mbf8 THEN Crisp1
is codified by the following instructions:
LDN 1 1 calculates the NOT α value of Input1 with Mbf1 and stores the result in internal registers
LDP 4 12 fixes the α value of Input4 with M12 and stores the result in internal registers
FZAND adds the NOT α and α values obtained with the operations LDN1 1 and LDP 4 12
LDK
stores the result of the operation FZAND in internal registers
LDP 3 8 fixes the α value of Input3 with Mbf8 and stores the result in internal registers
FZOR
implements the operation OR between the results obtained with the operations LDK and
LDP
CON crisp1 multiplies the result of the last Ω operation with the crisp value Crisp1
Example 2, the priority of the operator is fixed by the brackets:
IF (Input3 IS Mbf1 AND Input4 IS NOT Mbf15) OR (Input1 IS Mbf6 OR Input6IS NOT Mbf14) THEN Crisp2
LDP 3
fixes the α value of Input3 with Mbf1 and stores the result in internal registers
LDN 4 15 calculates the NOT α value of Input4 with Mbf15 and stores the result in internal registers
FZAND adds NOT α and α values obtained with the operations LDP 3 1 and LDN 4 15 SKM
stores the result of the operation FZAND in internal registers
LDP 1 6 fixes the α value of Input1 with Mbf6 and stores the result in internal registers
LDN 2 14 calculates the NOT α value of Input6 with Mbf14 and stores the result in internal registers
FZOR
implements the operation OR between the α and NOT α values obtained with the two previ-
ous operations (LDP 1 6 and LDN 2 14)
LDK
stores the result of the operation OR in internal registers
LDM
copies the value of the memory register M in internal registers
FZOR
implements the operation OR between the last two values stored in internal registers (LDK
and LDM)
CON crisp2 multiplies the result of the last Ω operation with the crisp value Crip2
At the end of the fuzzy rule, by using the instruction OUT RAM_reg, a byte is written. Afterwards, the con-
trol of the algorithm goes returns to the CU.
29/94