Mem Instruction Flow Diagram - Motorola HC12 Refrence Manual

Table of Contents

Advertisement

1 - R
Read word @ 0,X — Point_1 and Point_2
X = X + 4
2 - R
Read word @ –2,X — Slope_1 and Slope_2
Y = Y + 1
2a — Delta_1 = ACCA – Point_1
2b — Delta_2 = Point_2 – ACCA
2c — If (Delta_1 or Delta_2) < 0 then flag_d12n = 1 else flag_d12n = 0
3 - f
No bus access
3a — If flag_d12n = 1 then Grade_1 = 0 else Grade_1 = Slope_1 * Delta_1
3b — If flag_d12n = 1 then Grade_2 = 0 else Grade_2 = Slope_2 * Delta_2
4 - O
If misaligned then read program word to fill instruction queue else no bus access
4a — If (((Slope_2 = 0) or (Grade_2 > $FF)) and (flag_d12n = 0)) then Grade = $FF
else Grade = Grade_2
4b — If (((Slope_1 = 0) or (Grade_1 > $FF)) and (flag_d12n = 0)) then Grade = Grade
else Grade = Grade_1
5 - w
Write byte @ –1,Y — Fuzzy input result (Grade)
Consider 4a: If (((Slope_2 = 0) or (Grade_2 > $FF)) and (flag_d12n = 0)).
The flag_d12n is zero as long as the input value (in accumulator A) is within the trap-
ezoid. Everywhere outside the trapezoid, one or the other delta term will be negative,
and the flag will equal one. Slope_2 equals zero indicates the right side of the trape-
zoid has infinite slope, so the resulting grade should be $FF everywhere in the trape-
zoid, including at point_2, as far as this side is concerned. The term grade_2 greater
than $FF means the value is far enough into the trapezoid that the right sloping side
of the trapezoid has crossed above the $FF cutoff level and the resulting grade should
be $FF as far as the right sloping side is concerned. 4a decides if the value is left of
the right sloping side (Grade = $FF), or on the sloping portion of the right side of the
trapezoid (Grade = Grade_2). 4b could still override this tentative value in grade.
CPU12
REFERENCE MANUAL
START
Figure 9-5 MEM Instruction Flow Diagram
FUZZY LOGIC SUPPORT
END
MEM FLOW
MOTOROLA
9-11

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cpu12

Table of Contents