SlideShare una empresa de Scribd logo
1 de 8
Descargar para leer sin conexión
Mealy and Moore Type Finite State Machines
Objectives
     There are two basic ways to design clocked sequential circuits. These are
     using:
         1. Mealy Machine, which we have seen so far.
         2. Moore Machine.

     The objectives of this lesson are:
        1. Study Mealy and Moore machines
        2. Comparison of the two machine types
        3. Timing diagram and state machines

Mealy Machine
     In a Mealy machine, the outputs are a function of the present state and the
     value of the inputs as shown in Figure 1.

     Accordingly, the outputs may change asynchronously in response to any
     change in the inputs.




                          Figure 1: Mealy Type Machine

Mealy Machine
     In a Moore machine the outputs depend only on the present state as shown in
     Figure 2.

     A combinational logic block maps the inputs and the current state into the
     necessary flip-flop inputs to store the appropriate next state just like Mealy
     machine.

     However, the outputs are computed by a combinational logic block whose
     inputs are only the flip-flops state outputs.




                                                                                 1
The outputs change synchronously with the state transition triggered by the
     active clock edge.




                          Figure 2: Moore Type Machine


Comparison of the Two Machine Types
     Consider a finite state machine that checks for a pattern of ‘10’ and asserts
     logic high when it is detected.

     The state diagram representations for the Mealy and Moore machines are
     shown in Figure 3.

     The state diagram of the Mealy machine lists the inputs with their associated
     outputs on state transitions arcs.

     The value stated on the arrows for Mealy machine is of the form Zi/Xi where
     Zi represents input value and Xi represents output value.
     A Moore machine produces a unique output for every state irrespective of
     inputs.

     Accordingly the state diagram of the Moore machine associates the output
     with the state in the form state-notation/output-value.

     The state transition arrows of Moore machine are labeled with the input value
     that triggers such transition.

     Since a Mealy machine associates outputs with transitions, an output sequence
     can be generated in fewer states using Mealy machine as compared to Moore
     machine. This was illustrated in the previous example.




                                                                                2
Figure 3: Mealy and Moore State Diagrams for '10' Sequence Detector




Timing Diagrams
     To analyze Mealy and Moore machine timings, consider the following
     problem. A state-machine outputs ‘1’ if the input is ‘1’ for three consecutive
     clocks.




              Figure 4: Mealy State Machine for '111' Sequence Detector




                                                                                 3
Mealy State Machine

   The Mealy machine state diagram is shown in Figure 4.

   Note that there is no reset condition in the state machine that employs two flip-
   flops. This means that the state machine can enter its unused state ‘11’ on start
   up.

   To make sure that machine gets resetted to a valid state, we use a ‘Reset’
   signal.

   The logic diagram for this state machine is shown in Figure 5. Note that
   negative edge triggered flip-flops are used.




              Figure 5: Mealy State Machine Circuit Implementation



   Timing Diagram for the circuit is shown in Figure 6.

   Since the output in Mealy model is a combination of present state and input
   values, an unsynchronized input with triggering clock may result in invalid
   output, as in the present case.

   Consider the present case where input ‘x’ remains high for sometime after
   state ‘AB = 10’ is reached. This results in ‘False Output’, also known as
   ‘Output Glitch’.




                                                                                  4
Figure 6: Timing Diagram for Mealy Model Sequence Detector


Moore State Machine

The Moore machine state diagram for ‘111’ sequence detector is shown in
Figure 7.

The state diagram is converted into its equivalent state table (See Table 1).

The states are next encoded with binary values and we achieve a state
transition table (See Table 2).




                  Figure 7: Moore Machine State Diagram




                                                                                5
Table 1: State Table
               Present           Next State                    Output
               Present           Next State                    Output
                State         x=0      x=1                       Z
                Initial       Initial Got-1                      0
                Got-1         Initial Got-11                        0
               Got-11         Initial Got-111                       0
               Got-111        Initial Got-111                       1

            Table 2: State Transition Table and Output Table
                 Present         Next State                   Output
                  State         x=0    x=1                      Z
                   Initial     Initial        Got-1             0
                   Got-1       Initial        Got-11            0
                  Got-11       Initial     Got-111              0
                 Got-111       Initial     Got-111              1


We will use JK and D flip-flops for the Moore circuit implementation. The
excitation tables for JK and D flip-flops (Table 3 & 4) are referenced to
tabulate excitation table (See Table 5).

                Table 3: Excitation Table for JK flip-flop

                             Q(t)       Q(t+1)    J       K
                               0          0       0       X
                               0          1       1       X
                               1          0       X       1
                               1          1       X       0


                Table 4: Excitation Table for D flip-flop

                              Q(t)       Q(t+1)       D
                                    0         0       0
                                    0         1       1
                                    1         0       0
                                    1         1       1




                                                                        6
Table 5: Excitation Table for the Moore Implementation
              Inputs of                  Outputs of
            Comb.Circuits     Next      Comb.Circuit
                                                         Output
           Present            State       Flip-flop
                      Input
            State                          Inputs
           A      B     X     A   B    JA    KA     DB      Z
            0     0     0     0   0    0      X     0       0
            0     0     1     0   1    0      X     1       0
            0     1     0     0   0    0      X     0       0
            0     1     1     1   0    1      X     0       0
            1     0     0     0   0    X      1     0       0
            1     0     1     1   1    X      0     1       0
            1     1     0     0   0    X      1     0       1
            1     1     1     1   1    X      0     1       1



Simplifying Table 5 using maps, we get the following equations:
   o JA = X.B
   o KA = X’
   o DB =X(A + B)
   o Z=A.B

Note that the output is a function of present state values only.

The circuit diagram for Moore machine circuit implementation is shown in
Figure 8.

The timing diagram for Moore machine model is also shown in Figure 9.

There is no false output in a Moore model, since the output depends only on
the state of the flop flops, which are synchronized with clock. The outputs
remain valid throughout the logic state in Moore model.




   Figure 8: Moore Machine Circuit Implementation for Sequence Detector.




                                                                           7
Figure 9: Timing Diagram for Moore Model Sequence Detector.




                                                              8

Más contenido relacionado

La actualidad más candente

Finite state machines
Finite state machinesFinite state machines
Finite state machinesdennis gookyi
 
Lecture 5 Synchronous Sequential Logic
Lecture 5 Synchronous Sequential LogicLecture 5 Synchronous Sequential Logic
Lecture 5 Synchronous Sequential LogicJames Evangelos
 
Registers-shift register
Registers-shift registerRegisters-shift register
Registers-shift registerBilawal Fiaz
 
COUNTERS(Synchronous & Asynchronous)
COUNTERS(Synchronous & Asynchronous)COUNTERS(Synchronous & Asynchronous)
COUNTERS(Synchronous & Asynchronous)Sairam Adithya
 
Moore and Mealy machines
Moore and Mealy machinesMoore and Mealy machines
Moore and Mealy machinesIrfan Anjum
 
Moore and mealy machines
Moore and mealy machinesMoore and mealy machines
Moore and mealy machinesAYESHA JAVED
 
MASTER SLAVE JK FLIP FLOP & T FLIP FLOP
MASTER SLAVE JK FLIP FLOP & T FLIP FLOPMASTER SLAVE JK FLIP FLOP & T FLIP FLOP
MASTER SLAVE JK FLIP FLOP & T FLIP FLOPSmit Shah
 
variable entered map
variable entered mapvariable entered map
variable entered mapBansari Shah
 
Register in Digital Logic
Register in Digital LogicRegister in Digital Logic
Register in Digital LogicISMT College
 
UNIT-IV .FINITE STATE MACHINES
UNIT-IV .FINITE STATE MACHINESUNIT-IV .FINITE STATE MACHINES
UNIT-IV .FINITE STATE MACHINESDr.YNM
 
J - K & MASTERSLAVE FLIPFLOPS
J - K & MASTERSLAVE FLIPFLOPSJ - K & MASTERSLAVE FLIPFLOPS
J - K & MASTERSLAVE FLIPFLOPSKrishma Parekh
 
Types of flip flops ppt
Types of flip flops pptTypes of flip flops ppt
Types of flip flops pptViraj Shah
 

La actualidad más candente (20)

Finite state machines
Finite state machinesFinite state machines
Finite state machines
 
Ring counter
Ring counterRing counter
Ring counter
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuits
 
Counters
CountersCounters
Counters
 
Lecture 5 Synchronous Sequential Logic
Lecture 5 Synchronous Sequential LogicLecture 5 Synchronous Sequential Logic
Lecture 5 Synchronous Sequential Logic
 
Registers-shift register
Registers-shift registerRegisters-shift register
Registers-shift register
 
COUNTERS(Synchronous & Asynchronous)
COUNTERS(Synchronous & Asynchronous)COUNTERS(Synchronous & Asynchronous)
COUNTERS(Synchronous & Asynchronous)
 
Moore and Mealy machines
Moore and Mealy machinesMoore and Mealy machines
Moore and Mealy machines
 
Moore and mealy machines
Moore and mealy machinesMoore and mealy machines
Moore and mealy machines
 
MASTER SLAVE JK FLIP FLOP & T FLIP FLOP
MASTER SLAVE JK FLIP FLOP & T FLIP FLOPMASTER SLAVE JK FLIP FLOP & T FLIP FLOP
MASTER SLAVE JK FLIP FLOP & T FLIP FLOP
 
variable entered map
variable entered mapvariable entered map
variable entered map
 
Chapter 6 register
Chapter 6 registerChapter 6 register
Chapter 6 register
 
Register in Digital Logic
Register in Digital LogicRegister in Digital Logic
Register in Digital Logic
 
FSM and ASM
FSM and ASMFSM and ASM
FSM and ASM
 
Verilog hdl
Verilog hdlVerilog hdl
Verilog hdl
 
UNIT-IV .FINITE STATE MACHINES
UNIT-IV .FINITE STATE MACHINESUNIT-IV .FINITE STATE MACHINES
UNIT-IV .FINITE STATE MACHINES
 
J - K & MASTERSLAVE FLIPFLOPS
J - K & MASTERSLAVE FLIPFLOPSJ - K & MASTERSLAVE FLIPFLOPS
J - K & MASTERSLAVE FLIPFLOPS
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Latches and flip flops
Latches and flip flopsLatches and flip flops
Latches and flip flops
 
Types of flip flops ppt
Types of flip flops pptTypes of flip flops ppt
Types of flip flops ppt
 

Similar a Meley & moore

Synchronous design process
Synchronous design processSynchronous design process
Synchronous design processAbhilash Nair
 
DD Slides6.pptx aaaaaaaaaaaaaaaaaaaaaaaaaaaa
DD Slides6.pptx  aaaaaaaaaaaaaaaaaaaaaaaaaaaaDD Slides6.pptx  aaaaaaaaaaaaaaaaaaaaaaaaaaaa
DD Slides6.pptx aaaaaaaaaaaaaaaaaaaaaaaaaaaakasheenp
 
Introduction state machine
Introduction state machineIntroduction state machine
Introduction state machineShreyans Pathak
 
Analysis of state machines
Analysis of state machinesAnalysis of state machines
Analysis of state machinesAbhilash Nair
 
Finite State Machines
Finite State Machines Finite State Machines
Finite State Machines Basel Mansour
 
Preparatory_questions_final_exam_DigitalElectronics1 (1).pdf
Preparatory_questions_final_exam_DigitalElectronics1 (1).pdfPreparatory_questions_final_exam_DigitalElectronics1 (1).pdf
Preparatory_questions_final_exam_DigitalElectronics1 (1).pdfrdjo
 
Sequential logic circuit
Sequential logic circuitSequential logic circuit
Sequential logic circuitAswiniT3
 
Moore and mealy machine
Moore and mealy machineMoore and mealy machine
Moore and mealy machineMian Munib
 
Sequential Circuit
Sequential CircuitSequential Circuit
Sequential CircuitHeman Pathak
 
Sequential Circuits-ppt_2.pdf
Sequential Circuits-ppt_2.pdfSequential Circuits-ppt_2.pdf
Sequential Circuits-ppt_2.pdfimadshaheen2
 
Sequential Circuitsdddddddddddddddddsssssssssss-ppt.pptx
Sequential Circuitsdddddddddddddddddsssssssssss-ppt.pptxSequential Circuitsdddddddddddddddddsssssssssss-ppt.pptx
Sequential Circuitsdddddddddddddddddsssssssssss-ppt.pptxAhmedAlAfandi5
 
Designing Clocked Synchronous State Machine
Designing Clocked Synchronous State MachineDesigning Clocked Synchronous State Machine
Designing Clocked Synchronous State MachineAbhilash Nair
 
07 seq logicii-ix2
07 seq logicii-ix207 seq logicii-ix2
07 seq logicii-ix2SHIVA PRASAD
 
15CS32 ADE Module 4
15CS32 ADE Module 415CS32 ADE Module 4
15CS32 ADE Module 4RLJIT
 
digital-electronics_7.pdf
digital-electronics_7.pdfdigital-electronics_7.pdf
digital-electronics_7.pdfsarala9
 

Similar a Meley & moore (20)

Lec 25 26_27
Lec 25 26_27Lec 25 26_27
Lec 25 26_27
 
Synchronous design process
Synchronous design processSynchronous design process
Synchronous design process
 
DD Slides6.pptx aaaaaaaaaaaaaaaaaaaaaaaaaaaa
DD Slides6.pptx  aaaaaaaaaaaaaaaaaaaaaaaaaaaaDD Slides6.pptx  aaaaaaaaaaaaaaaaaaaaaaaaaaaa
DD Slides6.pptx aaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
19-MooreMealy.ppt
19-MooreMealy.ppt19-MooreMealy.ppt
19-MooreMealy.ppt
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Introduction state machine
Introduction state machineIntroduction state machine
Introduction state machine
 
Analysis of state machines
Analysis of state machinesAnalysis of state machines
Analysis of state machines
 
Finite State Machines
Finite State Machines Finite State Machines
Finite State Machines
 
Preparatory_questions_final_exam_DigitalElectronics1 (1).pdf
Preparatory_questions_final_exam_DigitalElectronics1 (1).pdfPreparatory_questions_final_exam_DigitalElectronics1 (1).pdf
Preparatory_questions_final_exam_DigitalElectronics1 (1).pdf
 
Sequential logic circuit
Sequential logic circuitSequential logic circuit
Sequential logic circuit
 
Moore and mealy machine
Moore and mealy machineMoore and mealy machine
Moore and mealy machine
 
Lec9
Lec9Lec9
Lec9
 
Sequential Circuit
Sequential CircuitSequential Circuit
Sequential Circuit
 
Sequential Circuits-ppt_2.pdf
Sequential Circuits-ppt_2.pdfSequential Circuits-ppt_2.pdf
Sequential Circuits-ppt_2.pdf
 
Sequential Circuitsdddddddddddddddddsssssssssss-ppt.pptx
Sequential Circuitsdddddddddddddddddsssssssssss-ppt.pptxSequential Circuitsdddddddddddddddddsssssssssss-ppt.pptx
Sequential Circuitsdddddddddddddddddsssssssssss-ppt.pptx
 
9920Lec12 FSM.ppt
9920Lec12 FSM.ppt9920Lec12 FSM.ppt
9920Lec12 FSM.ppt
 
Designing Clocked Synchronous State Machine
Designing Clocked Synchronous State MachineDesigning Clocked Synchronous State Machine
Designing Clocked Synchronous State Machine
 
07 seq logicii-ix2
07 seq logicii-ix207 seq logicii-ix2
07 seq logicii-ix2
 
15CS32 ADE Module 4
15CS32 ADE Module 415CS32 ADE Module 4
15CS32 ADE Module 4
 
digital-electronics_7.pdf
digital-electronics_7.pdfdigital-electronics_7.pdf
digital-electronics_7.pdf
 

Meley & moore

  • 1. Mealy and Moore Type Finite State Machines Objectives There are two basic ways to design clocked sequential circuits. These are using: 1. Mealy Machine, which we have seen so far. 2. Moore Machine. The objectives of this lesson are: 1. Study Mealy and Moore machines 2. Comparison of the two machine types 3. Timing diagram and state machines Mealy Machine In a Mealy machine, the outputs are a function of the present state and the value of the inputs as shown in Figure 1. Accordingly, the outputs may change asynchronously in response to any change in the inputs. Figure 1: Mealy Type Machine Mealy Machine In a Moore machine the outputs depend only on the present state as shown in Figure 2. A combinational logic block maps the inputs and the current state into the necessary flip-flop inputs to store the appropriate next state just like Mealy machine. However, the outputs are computed by a combinational logic block whose inputs are only the flip-flops state outputs. 1
  • 2. The outputs change synchronously with the state transition triggered by the active clock edge. Figure 2: Moore Type Machine Comparison of the Two Machine Types Consider a finite state machine that checks for a pattern of ‘10’ and asserts logic high when it is detected. The state diagram representations for the Mealy and Moore machines are shown in Figure 3. The state diagram of the Mealy machine lists the inputs with their associated outputs on state transitions arcs. The value stated on the arrows for Mealy machine is of the form Zi/Xi where Zi represents input value and Xi represents output value. A Moore machine produces a unique output for every state irrespective of inputs. Accordingly the state diagram of the Moore machine associates the output with the state in the form state-notation/output-value. The state transition arrows of Moore machine are labeled with the input value that triggers such transition. Since a Mealy machine associates outputs with transitions, an output sequence can be generated in fewer states using Mealy machine as compared to Moore machine. This was illustrated in the previous example. 2
  • 3. Figure 3: Mealy and Moore State Diagrams for '10' Sequence Detector Timing Diagrams To analyze Mealy and Moore machine timings, consider the following problem. A state-machine outputs ‘1’ if the input is ‘1’ for three consecutive clocks. Figure 4: Mealy State Machine for '111' Sequence Detector 3
  • 4. Mealy State Machine The Mealy machine state diagram is shown in Figure 4. Note that there is no reset condition in the state machine that employs two flip- flops. This means that the state machine can enter its unused state ‘11’ on start up. To make sure that machine gets resetted to a valid state, we use a ‘Reset’ signal. The logic diagram for this state machine is shown in Figure 5. Note that negative edge triggered flip-flops are used. Figure 5: Mealy State Machine Circuit Implementation Timing Diagram for the circuit is shown in Figure 6. Since the output in Mealy model is a combination of present state and input values, an unsynchronized input with triggering clock may result in invalid output, as in the present case. Consider the present case where input ‘x’ remains high for sometime after state ‘AB = 10’ is reached. This results in ‘False Output’, also known as ‘Output Glitch’. 4
  • 5. Figure 6: Timing Diagram for Mealy Model Sequence Detector Moore State Machine The Moore machine state diagram for ‘111’ sequence detector is shown in Figure 7. The state diagram is converted into its equivalent state table (See Table 1). The states are next encoded with binary values and we achieve a state transition table (See Table 2). Figure 7: Moore Machine State Diagram 5
  • 6. Table 1: State Table Present Next State Output Present Next State Output State x=0 x=1 Z Initial Initial Got-1 0 Got-1 Initial Got-11 0 Got-11 Initial Got-111 0 Got-111 Initial Got-111 1 Table 2: State Transition Table and Output Table Present Next State Output State x=0 x=1 Z Initial Initial Got-1 0 Got-1 Initial Got-11 0 Got-11 Initial Got-111 0 Got-111 Initial Got-111 1 We will use JK and D flip-flops for the Moore circuit implementation. The excitation tables for JK and D flip-flops (Table 3 & 4) are referenced to tabulate excitation table (See Table 5). Table 3: Excitation Table for JK flip-flop Q(t) Q(t+1) J K 0 0 0 X 0 1 1 X 1 0 X 1 1 1 X 0 Table 4: Excitation Table for D flip-flop Q(t) Q(t+1) D 0 0 0 0 1 1 1 0 0 1 1 1 6
  • 7. Table 5: Excitation Table for the Moore Implementation Inputs of Outputs of Comb.Circuits Next Comb.Circuit Output Present State Flip-flop Input State Inputs A B X A B JA KA DB Z 0 0 0 0 0 0 X 0 0 0 0 1 0 1 0 X 1 0 0 1 0 0 0 0 X 0 0 0 1 1 1 0 1 X 0 0 1 0 0 0 0 X 1 0 0 1 0 1 1 1 X 0 1 0 1 1 0 0 0 X 1 0 1 1 1 1 1 1 X 0 1 1 Simplifying Table 5 using maps, we get the following equations: o JA = X.B o KA = X’ o DB =X(A + B) o Z=A.B Note that the output is a function of present state values only. The circuit diagram for Moore machine circuit implementation is shown in Figure 8. The timing diagram for Moore machine model is also shown in Figure 9. There is no false output in a Moore model, since the output depends only on the state of the flop flops, which are synchronized with clock. The outputs remain valid throughout the logic state in Moore model. Figure 8: Moore Machine Circuit Implementation for Sequence Detector. 7
  • 8. Figure 9: Timing Diagram for Moore Model Sequence Detector. 8