Motorola HC12 Refrence Manual page 330

Table of Contents

Advertisement

The primary part of the WAV instruction is a multiply and accumulate operation to get
the numerator for the weighted average calculation. When working with operands as
large as 16 bits, the EMACS instruction could at least be used to automate the multiply
and accumulate function. The CPU12 has extended math capabilities, including the
EMACS instruction which uses 16-bit input operands and accumulates the sum to a
32-bit memory location and 32-bit by 16-bit divide instructions.
One benefit of the WAV instruction is that both a sum of products and a sum of weights
are maintained, while the fuzzy output operand is only accessed from memory once.
Since memory access time is such a significant part of execution time, this provides a
speed advantage compared to conventional instructions.
The weighted average of singletons is the most commonly used technique in micro-
controllers because it is computationally less difficult than most other methods. The
simplest method is called max defuzzification, which simply uses the largest fuzzy out-
put as the system result. However, this approach does not take into account any other
fuzzy outputs, even when they are almost as true as the chosen max output. Max de-
fuzzification is not a good general choice because it only works for a subset of fuzzy
logic applications.
The CPU12 is well suited for more computationally challenging algorithms than
weighted average. A 32-bit by 16-bit divide instruction takes eleven or twelve 8-MHz
cycles for unsigned or signed variations. A 16-bit by 16-bit multiply with a 32-bit result
takes only three 8-MHz cycles. The EMACS instruction uses 16-bit operands and
accumulates the result in a 32-bit memory location, taking only twelve 8-MHz cycles
per iteration, including accessing all operands from memory and storing the result to
memory.
MOTOROLA
FUZZY LOGIC SUPPORT
CPU12
9-30
REFERENCE MANUAL

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cpu12

Table of Contents