80 likes | 219 Vues
This lecture by Professor CK Cheng explores the transformation between Mealy and Moore machines, using state tables and diagrams. It covers the algorithm for state transformation, providing a step-by-step guide to creating new states from given inputs. An example of a Mealy machine with its corresponding state diagram and outputs is included, along with the timing diagrams that illustrate the differences in clock shifts between the two machine types. The session also discusses state assignments such as binary, Gray, Johnson, and one-hot encoding techniques.
E N D
CS 140L Lecture 7 Professor CK Cheng 11/12/02
Transformation between Mealy and Moore Machines Input: State Table of Mealy machine Algorithm: 1) For each NS, z = Si,j create a state Si(j) 2) For each new state Si(j), repeat the row PS = Si 3) Replace NS, z = Si,j with state Si(j). Set z = j for row PS = Si(j)
Example Mealy Machine: PS A B 00 A,0 A,1 01 A,1 B,0 10 A,1 B,0 (x,y) (NS, z) Moore Machine: PS A0 A1 B (x,y) 00 A0 A0 A1 01 A1 A1 B 10 B B B z 0 1 0
Mealy State Diagram 00/1 10/0, 01/0 10/0 B A 00/1
Moore State Diagram 10 01 00 10 A0/0 B/0 10 00 01 00 A1/1 01
Timing Diagrams Time step x y S z S z 0 0 0 A 0 A0 0 1 0 1 A 1 A0 0 2 1 0 A 0 A1 1 3 0 0 B 1 B 0 4 0 1 A 1 A1 1 5 0 1 A 1 A1 1 A Mealy A1 1 Moore (The output has a 1 clock shift between Mealy and Moore machines)
State Assignment 1) Binary – [ log2n ] bits 000,001,110, etc. 2) Gray – can change by only 1 bit i.e. 000-> 001->011->010. 3) Johnson - [ n/2 ] (bits) number of flip flops. 4) One hot – n FF, n states
One hot: Qi = 1 iff present state = Si. 0 0 S0 S1 S2 1 1 0 1 X X X Q Q Q D D D Q’ Q’ Q’ X’ X’ X’ (X not true -> back to 1st FF, else to 2nd ) • Branch outs Fan-outs with AND gates. • Branch ins Collect tokens with an OR gate.