LINKED STATE MACHINES
When
a sequential machine becomes large and complex, then the machine can be divided
into several smaller machines which are easier to design and implement and are
linked together. Also one of the submachines may be called in several different
places by the main machine.
Fig.1:
SM Charts for serially linked state machines
From
fig.1, the main machine (machine A) executes a sequence of some states until it
is ready to call the submachine (machine B). when state SA is reached, the output
signal ZA activates machine B. machine B then leaves its idle state and
executes a sequence of other states. When it finishes, it outputs ZB before
returning to the idle state. When machine A receives ZB, it continues to
execute other states. Assume that the two machines have a common clock.
Consider
fig.2, Rb is used to control the roll of the dice in states S0 and S1 and in an
identical way in states S4 and S5. As this function is repeated in two places,
it is logical to use a separate roll control (fig.3) which allows the main dice
control to be reduced from six states to four states. The main control
generates an En_roll (enable roll) signal in T0 and then waits for a Dn_roll
(done rolling) signal before continuing. Similar action occurs in T1. The roll
control machine waits in state S0 untill it gets an En_roll signal from the
main dice game control. Then, when the roll button is pressed (Rb=1), the
machine goes to S1 and generates a Roll signal. It remains in S1 until Rb=0, in
which case the Dn_roll signal is generated and the machine goes back to state
S0.
Fig.2:
SM Chart for Dice Game
Fig.3:
Linked SM Charts for Dice Game
No comments:
Post a Comment