Moore
Moore
PRN: 122AX042
Batch: H2
Branch: CSE(IOT)
Moore Machines
Motivation
DFA's which are augmented with a output function which is a function of the current state are known as
Moore Machines.
These have an initial state (also known as a power on or reset state) and may or may not have a final
state (or acceptance) state.
Moore Machines may have additional ways of being combined (composed), with the output being fed
to additional more machines as input (sequential composition), (when the output and inputs are
compatible). It is also possible to construct systems of machines which have feedback, where part or
all of the input of the systems is a function of the system's output.
Moore machines, synchronized to a clock, are the basis of many instruction set computers, as well as
dedicated discrete processing systems.
Practical Example
One application of a Moore Machine is in telecommunications, and is used to modify the stream of
symbols on the fly. Manchester encoding can be done simply with an XOR (exclusive or) logic gate
Manchester decoding can be done using a clocked at a multiple (at least twice) the transmitter clock
rate. On the receiver side, a low to high transition mid-cycle is recovered as a one, a high to low
transition is recovered as a zero. We start with the line (data) idle, which means no mid-clock
transition.
The figure shows the construction of a decoder which is clocked at twice the transmission clock rate.
State q0 is the reset, and idle state. Depending on the value of sensed on the line (either a 0 or zero),
we transition to another idle state, where the system remains until there is a change of the input value.
Remember, the system is being clocked at twice the transmission clocked rate, so any transition must
occur at the mid point.
Questions
1) Examine state q1 and the values used to exit the state. What form of Manchester encoding is
being used?
2) What changes to the machine would need to be done to use the other form of Manchester
encoding?
From state q1 no change in the input means we are still idle. A change from a zero to a 1 means we
have detected a 1 and we move to state q3 which outputs a 1. If the input returns to a 0, the system
moves to state q5 since either the input indicates multiple ones being received or the line has returned
to idle. If the input remains at 1, the system transitions to q7, since either the input returned or a input
indicates a zero following a 1.
The implementation assumes the transmitter brings the input to the receiver to the idle value of the first
bit to be sent for 2 cycles.
Moore Machine – Exercise
Problem:
Construct a Moore machine which takes a binary number and replaces the first 1 with a 0
from every substring starting with 1. For example, 0001001110 becomes 0000000110. This
type of “bit stuffing” may be used in data transmission and telecommunications for run--‐length
coding to limit the number of consecutive bits of the same value. A bit of the opposite value
is inserted after the maximum allowed number of consecutive bits.
Solution:
Open JFLAP and create a Moore machine with an initial state. Create three states as follows:
1. q0 with an output of 0 to represent a 0 read.
2. q1 with an output of 0 to represent the first 1 read within a substring of 1s.
3. q2 with an output of 1 to represent the remaining 1’s read after the first 1 was read.
Next, add the transitions:
1. At q0 and an input of 0, stay at q0.
2. At q0 and an input of 1, go to q1.
3. At q1 and an input of 0, go back to q0.
4. At q1 and an input of 1, go to q2.
5. At q2 and an input of 0, go all the way back to q0.
6. At q2 and an input of 1, stay at q2.
The Moore machine is complete, run some test strings using Input > Multiple Runs.