Motorola HC12 Refrence Manual page 329

Table of Contents

Advertisement

9.7.2 Rule Evaluation Variations
The REV and REVW instructions expect fuzzy input and fuzzy output values to be 8-
bit values. In a custom fuzzy inference program, higher resolution may be desirable
(although this is not a common requirement). The CPU12 includes variations of mini-
mum and maximum operations that work with the fuzzy MIN-MAX inference algorithm.
The problem with the fuzzy inference algorithm is that the min and max operations
need to store their results differently, so the min and max instructions must work dif-
ferently or more than one variation of these instructions is needed.
The CPU12 has min and max instructions for 8- or 16-bit operands, where one oper-
and is in an accumulator and the other is a referenced memory location. There are
separate variations that replace the accumulator or the memory location with the re-
sult. While processing rule antecedents in a fuzzy inference program, a reference val-
ue must be compared to each of the referenced fuzzy inputs, and the smallest input
must end up in an accumulator. The instruction...
automates the central operations needed to process rule antecedents. The E stands
for extended, so this instruction compares 16-bit operands. The D at the end of the
mnemonic stands for the D accumulator, which is both the first operand for the com-
parison and the destination of the result. The 2,X+ is an indexed addressing specifica-
tion that says X points to the second operand for the comparison.
When processing rule consequents, the operand in the accumulator must remain con-
stant (in case there is more than one consequent in the rule), and the result of the com-
parison must replace the referenced fuzzy output in RAM. To do this, use the
instruction...
The M at the end of the mnemonic indicates that the result will replace the referenced
memory operand. Again, indexed addressing is used. These two instructions would
form the working part of a 16-bit resolution fuzzy inference routine.
There are many other methods of performing inference, but none of these are as wide-
ly used as the min-max method. Since the CPU12 is a general-purpose microcontrol-
ler, the programmer has complete freedom to program any algorithm desired. A
custom programmed algorithm would typically take more code space and execution
time than a routine that used the built-in REV or REVW instructions.
9.7.3 Defuzzification Variations
There are two main areas where other CPU12 instructions can help with custom de-
fuzzification routines. The first case is working with operands that are more than eight
bits. The second case involves using an entirely different approach than weighted av-
erage of singletons.
CPU12
REFERENCE MANUAL
EMIND
2,X+
EMAXM
2,X+
FUZZY LOGIC SUPPORT
;process one rule antecedent
;process one rule consequent
MOTOROLA
9-29

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cpu12

Table of Contents