Motorola HC12 Refrence Manual page 226

Table of Contents

Advertisement

REV
Operation:
MIN – MAX Rule Evaluation
Description:
Performs an unweighted evaluation of a list of rules, using fuzzy input
values to produce fuzzy outputs. REV can be interrupted, so it does not
adversely affect interrupt latency.
The REV instruction uses an 8-bit offset from a base address stored in
index register Y to determine the address of each fuzzy input and fuzzy
output. For REV to execute correctly, each rule in the knowledge base
must consist of a table of 8-bit antecedent offsets followed by a table of
8-bit consequent offsets. The value $FE marks boundaries between an-
tecedents and consequents, and between successive rules. The value
$FF marks the end of the rule list. REV can evaluate any number of rules
with any number of inputs and outputs.
Beginning with the address pointed to by the first rule antecedent, REV
evaluates each successive fuzzy input value until it encounters an $FE
separator. Operation is similar to that of a MINA instruction. The smallest
input value is the truth value of the rule. Then, beginning with the ad-
dress pointed to by the first rule consequent, the truth value is compared
to each successive fuzzy output value until another $FE separator is en-
countered; 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 $FF terminator is encountered.
Before executing REV, perform the following set up operations.
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 next address after the $FF separator at the end of the rule list.
Index register Y points to the base address for the fuzzy inputs and fuzzy
outputs. The value in Y does not change during execution.
MOTOROLA
6-166
Fuzzy Logic Rule Evaluation
X must point to the first 8-bit element in the rule list.
Y must point to the base address for fuzzy inputs and fuzzy outputs.
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.
INSTRUCTION GLOSSARY
REV
CPU12
REFERENCE MANUAL

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cpu12

Table of Contents