Mealy and Moore Machines: Topic
Mealy and Moore Machines: Topic
Mealy and Moore Machines: Topic
PPT SL.NO.: - 01
lines. Here, 0/0, 1/0 & 1/1 denotes input/output. In the above
figure, there are two transitions from each state based on the value
of input, x.
Mealy Machines
◻ The state table of a Mealy Machine is shown below −
Next state
Present
input = 0 input = 1
state
State Output State Output
→a b x1 c x1
b b x2 d x3
c d x3 c x1
d d x3 d x2
/x2
a /x3 d
/x1 c
/x1
Example of Mealy Machine
module mealy( clk, rst, inp, outp); 2'b01: begin
input clk, rst, inp; if( inp ) begin
state <= 2'b00;
output outp;
outp <= 1;
reg [1:0] state; end
reg outp; else begin
always @( posedge clk, posedge rst state <= 2'b10;
) begin outp <= 0;
if( rst ) begin end
end
state <= 2'b00;
2'b10: begin
outp <= 0; if( inp ) begin
end state <= 2'b01;
else begin outp <= 0;
case( state ) end
2'b00: begin else begin
state <= 2'b00;
if( inp ) begin
outp <= 1;
state <= 2'b01; end
outp <= 0; end
end default: begin
else begin state <= 2'b00;
state <= 2'b10; outp <= 0;
end
outp <= 0;
endcase
end end
end end
endmodule
Moore Machine
◻A Finite State Machine is said to be Moore state machine, if
outputs depend only on present states.
◻The block diagram of Moore state machine is shown in the
following figure.
Moore Machine
◻In the given figure, there are four states, namely A, B, C & D.
These states and the respective outputs are labelled inside the
circles. Here, only the input value is labeled on each transition. In
the given figure, there are two transitions from each state based on
the value of input, x.
Moore Machine
In the moore machine shown in Figure, the output is repr
esentedwith each input state separated by /. The length
of output for a moore machine is greater than input by 1.
Input: 11
Transition: δ (q0,11)=> δ(q2,1)=>q2
Output: 000 (0 for q0, 0 for q2 and again 0 for q2)
Moore Machine
◻ The state table of a Moore Machine is shown below −
Next State
Present state Output
Input = 0 Input = 1
→a b c x2
b b d x1
c c d x2
d d d x3
NIELI www.nielit.gov.in/haridwar