Motorola HC12 Refrence Manual page 228

Table of Contents

Advertisement

REVW
Operation:
MIN – MAX Rule Evaluation with Optional Rule Weighting
Description:
REVW performs either weighted or unweighted evaluation of a list of
rules, using fuzzy inputs to produce fuzzy outputs. REVW can be inter-
rupted, so it does not adversely affect interrupt latency.
For REVW to execute correctly, each rule in the knowledge base must
consist of a table of 16-bit antecedent pointers followed by a table of 16-
bit consequent pointers. The value $FFFE marks boundaries between
antecedents and consequents, and between successive rules. The
value $FFFF marks the end of the rule list. REVW can evaluate any
number of rules with any number of inputs and outputs.
Setting the C status bit enables weighted evaluation. To use weighted
evaluation, a table of 8-bit weighting factors, one per rule, must be stored
in memory. Index register Y points to the weighting factors.
Beginning with the address pointed to by the first rule antecedent,
REVW evaluates each successive fuzzy input value until it encounters
an $FFFE separator. Operation is similar to that of a MINA instruction.
The smallest input value is the truth value of the rule. Next, if weighted
evaluation is enabled, a computation is performed, and the truth value is
modified. Then, beginning with the address pointed to by the first rule
consequent, the truth value is compared to each successive fuzzy output
value until another $FFFE separator is encountered; if the truth value is
greater than the current output value, it is written to the output. Operation
is similar to that of a MAXM instruction. Rules are processed until an
$FFFF terminator is encountered.
Perform these set up operations before execution.
Index register X points to the element in the rule list that is being evalu-
ated. X is automatically updated so that execution can resume correctly
if the instruction is interrupted. When execution is complete, X points to
the address after the $FFFF separator at the end of the rule list.
Index register Y points to the weighting factor being used. Y is automat-
ically updated so that execution can resume correctly if the instruction is
interrupted. When execution is complete, Y points to the last weighting
factor used. When weighting is not used (C = 0), Y is not changed.
MOTOROLA
6-168
Fuzzy Logic Rule Evaluation (Weighted)
X must point to the first 16-bit element in the rule list.
A must contain the value $FF, and the CCR V bit must = 0
(LDAA #$FF places the correct value in A and clears V).
Clear fuzzy outputs to zeros.
Set or clear the CCR C bit. When weighted evaluation is enabled,
Y must point to the first item in a table of 8-bit weighting factors.
INSTRUCTION GLOSSARY
REVW
CPU12
REFERENCE MANUAL

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cpu12

Table of Contents