Motorola HC12 Refrence Manual page 229

Table of Contents

Advertisement

Accumulator A holds intermediate results. During antecedent process-
ing, a MIN function compares each fuzzy input to the value stored in A,
and writes the smaller of the two to A. When all antecedents have been
evaluated, A contains the smallest input value. For unweighted evalua-
tion, this is the truth value used during consequent processing. For
weighted evaluation, the value in A is multiplied by the quantity (Rule
Weight + 1) and the upper eight bits of the result replace the content of
A. Accumulator A must be initialized to $FF for the MIN function to eval-
uate the inputs of the first rule correctly. For subsequent rules, the value
$FF is written to A when an $FFFE marker is encountered. At the end of
execution, accumulator A holds the truth value for the last rule.
The V status bit signals whether antecedents (0) or consequents (1) are
being processed. V must be initialized to zero in order for processing to
begin with the antecedents of the first rule. Once execution begins, the
value of V is automatically changed as $FFFE separators are encoun-
tered. At the end of execution, V should equal one, because the last el-
ement before the $FF end marker should be a rule consequent. If V is
equal to zero at the end of execution, the rule list is incorrect.
Fuzzy outputs must be cleared to $00 before processing begins in order
for the MAX algorithm used during consequent processing to work cor-
rectly. Residual output values would cause incorrect comparison.
Refer to
Condition Codes and Boolean Formulas:
S
V:
C:
H, N, Z and C may be altered by this instruction.
Addressing Modes, Machine Code, and Execution Times:
Source Form
REVW
(add 2 at end of ins if wts)
(add if interrupted)
Notes:
1. The 3-cycle loop in parentheses expands to five cycles for separators when weighting is enabled. The loop is
executed once for each element in the rule list. When an interrupt occurs, there is a 2-cycle exit sequence, a 4-
cycle re-entry sequence, then execution resumes with a prefetch of the last antecedent or consequent being pro-
cessed at the time of the interrupt.
CPU12
REFERENCE MANUAL
SECTION 9 FUZZY LOGIC SUPPORT
X
H
I
N
Z
?
?
?
1; Normally set, unless rule structure is erroneous.
Selects weighted (1) or unweighted (0) rule evaluation.
Address Mode
Special
INSTRUCTION GLOSSARY
V
C
!
Object Code
18 3B
for details.
Cycles
Access Detail
1
See note
ORf(tTx)O
(rffRf)
fff + ORft
MOTOROLA
6-169

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cpu12

Table of Contents