SlideShare a Scribd company logo
1 of 10
Finite-State Machine

Muhammad Irfan Anjum

1
OUTLINE

•

Introduction

•

Types of Finite State Machines
•
•

•

Mealy State Machine
Moore State Machine

Example

2
Finite State Machine

• FSMs are different from counters in the sense that they
have external I/Ps, and state transitions are dependent on
these I/Ps and the current state.
• Simple forms of pattern matching.
• Models for sequential logic circuits, of the kind on which
every present-day computer and many device controllers is
based.
3
Mealy and Moore Machines

External I/Ps

External
I/Ps
m1

External O/Ps

m1

Comb.
Logic

n

FFs

m2

Next State
Comb.
Logic

n even
↓
odd

n

Output
Logic

CLK

m2

FFs

n

CLK
External Outputs

Moore Machine Model

Mealy Machine Model
4
Difference Between Mealy and Moore Machine
Mealy
(1) O/Ps depend on the present
state and present I/Ps
(2) The O/P change asyn
-chronously with the
enabling clock edge

(3)
(4)

Moore
O/Ps depend only on the
present state
Since the O/Ps change
when the state changes,
and the state change is
synchronous with the
enabling clock edge, O/Ps
change synchronously
with this clock edge
A counter is a Moore
machine

A counter is not a Mealy
machine
A Mealy machine will have
the same # or fewer states
than a Moore machine
5
Finite State Machine (FSM) Design
Example:
There is a one bit-serial I/P line. Design an FSM that outputs a ‘0’ if an
even # of 1’s have been received on the I/P line and the outputs a ‘1’
otherwise.
x

FSM

O/p y
CLK

CLK

x
# of
1s

even
(0)

odd
(1)

even
(2)

odd
(3)
6

odd
(3)
Solution 1: (Mealy)

Solution 2: (Moore)
0

0/0

Reset
Even

Transition
Arc

Input

1/1

1/0
Odd

Reset

Output

Even

Output

[0]
O/P is dependent
on current state and
input in Mealy

1

1
Odd
[1]

0

0/1
Mealy Machine: Output is associated
with the state transition, and appears
before the state transition is completed
(by the next clock pulse).

Input
Output is
dependent only
on current state

Moore Machine: Output is associated
with the state and hence appears
after the state transition take place.
7
State Transition Table
(Even-Parity Checker)
Even State: 0 ;
Present
State

Input

A

Odd State: 1;
Next
State

x

State Variable A
Mealy
O/P

Moore
O/P

A+

y1

D-FF
Excit.

y2

DA

0

0

0

0

0

0

0

1

1

0

1

1

1

1

0

1x

1
0
Input variables
to comb. logic
1

1

DA= A⊕x ;
y1 = A for Moore
y2 = A⊕x for Mealy

Output functions 1
1
y2

0
N.S. & O/P
Logic

Q
A FF

x

N.S.
Logic

Or

Q

DA

CLK
8

0

A
O/P
Logic

FFs

y1

DA
Moore M/C Implementation

a) D-FF
0

D

x=1

R

CLK

A

Q

y1

Q

Reset

Moore O/P is synchronized with clock.

Mealy M/C Implementation
y2

0

1

D

x=1
CLK

Q
R

A

Q

Reset

a) D-FF
Mealy O/P is not synchronized with clock.
9
Moore M/C Implementation

a) D-FF
0

D

x=1

R

CLK

A

Q

y1

Q

Reset

Moore O/P is synchronized with clock.

Mealy M/C Implementation
y2

0

1

D

x=1
CLK

Q
R

A

Q

Reset

a) D-FF
Mealy O/P is not synchronized with clock.
9

More Related Content

What's hot

Finite state automaton
Finite state automatonFinite state automaton
Finite state automatonAmmAr mobark
 
Mealy moore machine model
Mealy moore machine modelMealy moore machine model
Mealy moore machine modeldeepinderbedi
 
Registers and counters
Registers and counters Registers and counters
Registers and counters Deepak John
 
Asynchronous sequential circuit analysis
Asynchronous sequential circuit analysisAsynchronous sequential circuit analysis
Asynchronous sequential circuit analysisDr Naim R Kidwai
 
Fsm sequence detector
Fsm sequence detector Fsm sequence detector
Fsm sequence detector lpvasam
 
Flip flop conversions
Flip flop conversionsFlip flop conversions
Flip flop conversionsuma jangaman
 
Sequential Logic Circuit
Sequential Logic CircuitSequential Logic Circuit
Sequential Logic CircuitRamasubbu .P
 
Introduction state machine
Introduction state machineIntroduction state machine
Introduction state machineShreyans Pathak
 
UNIT-IV .FINITE STATE MACHINES
UNIT-IV .FINITE STATE MACHINESUNIT-IV .FINITE STATE MACHINES
UNIT-IV .FINITE STATE MACHINESDr.YNM
 
Moore Mealy Machine Conversion
Moore Mealy Machine Conversion Moore Mealy Machine Conversion
Moore Mealy Machine Conversion Aiman Hafeez
 
Presentation on Flip Flop
Presentation  on Flip FlopPresentation  on Flip Flop
Presentation on Flip FlopNahian Ahmed
 
COUNTERS(Synchronous & Asynchronous)
COUNTERS(Synchronous & Asynchronous)COUNTERS(Synchronous & Asynchronous)
COUNTERS(Synchronous & Asynchronous)Sairam Adithya
 
Latches and flip flop
Latches and flip flopLatches and flip flop
Latches and flip flopShuaib Hotak
 

What's hot (20)

Finite state automaton
Finite state automatonFinite state automaton
Finite state automaton
 
Mealy moore machine model
Mealy moore machine modelMealy moore machine model
Mealy moore machine model
 
Registers and counters
Registers and counters Registers and counters
Registers and counters
 
Asynchronous sequential circuit analysis
Asynchronous sequential circuit analysisAsynchronous sequential circuit analysis
Asynchronous sequential circuit analysis
 
Fsm sequence detector
Fsm sequence detector Fsm sequence detector
Fsm sequence detector
 
flip flops
flip flops flip flops
flip flops
 
Flip flop conversions
Flip flop conversionsFlip flop conversions
Flip flop conversions
 
Sequential Logic Circuit
Sequential Logic CircuitSequential Logic Circuit
Sequential Logic Circuit
 
Introduction state machine
Introduction state machineIntroduction state machine
Introduction state machine
 
Shift Register
Shift RegisterShift Register
Shift Register
 
UNIT-IV .FINITE STATE MACHINES
UNIT-IV .FINITE STATE MACHINESUNIT-IV .FINITE STATE MACHINES
UNIT-IV .FINITE STATE MACHINES
 
Moore Mealy Machine Conversion
Moore Mealy Machine Conversion Moore Mealy Machine Conversion
Moore Mealy Machine Conversion
 
Presentation on Flip Flop
Presentation  on Flip FlopPresentation  on Flip Flop
Presentation on Flip Flop
 
Counters
Counters Counters
Counters
 
Counters
CountersCounters
Counters
 
COUNTERS(Synchronous & Asynchronous)
COUNTERS(Synchronous & Asynchronous)COUNTERS(Synchronous & Asynchronous)
COUNTERS(Synchronous & Asynchronous)
 
Meley & moore
Meley & mooreMeley & moore
Meley & moore
 
FSM and ASM
FSM and ASMFSM and ASM
FSM and ASM
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuits
 
Latches and flip flop
Latches and flip flopLatches and flip flop
Latches and flip flop
 

Similar to Moore and Mealy machines

melay and moore machine.pptx
melay and moore machine.pptxmelay and moore machine.pptx
melay and moore machine.pptxssuser1b2fab
 
Logic and computer design.ppt
Logic and computer design.pptLogic and computer design.ppt
Logic and computer design.ppteissaalesayi1
 
state_machines1.pdf
state_machines1.pdfstate_machines1.pdf
state_machines1.pdfrdjo
 
Ade(unit 4) Counters
Ade(unit 4) CountersAde(unit 4) Counters
Ade(unit 4) CountersANKITSURWADE
 
MOC2.PPT[1].pptx introduction to mealy machine and moore machine with eample ...
MOC2.PPT[1].pptx introduction to mealy machine and moore machine with eample ...MOC2.PPT[1].pptx introduction to mealy machine and moore machine with eample ...
MOC2.PPT[1].pptx introduction to mealy machine and moore machine with eample ...PranavHendre1
 
Mealy Machine by Daniyal Khan
Mealy Machine by Daniyal KhanMealy Machine by Daniyal Khan
Mealy Machine by Daniyal KhanDaniyal Khan
 
Applications of Mealy & Moore Machine
Applications of  Mealy  & Moore Machine Applications of  Mealy  & Moore Machine
Applications of Mealy & Moore Machine SardarKashifKhan
 
Digital Counter Design
 Digital Counter Design Digital Counter Design
Digital Counter DesignGargiKhanna1
 
07 seq logicii-ix2
07 seq logicii-ix207 seq logicii-ix2
07 seq logicii-ix2SHIVA PRASAD
 
Synchronous state machines. Moore and Mealy state machines (FSM)
Synchronous state machines.  Moore and Mealy state machines (FSM)Synchronous state machines.  Moore and Mealy state machines (FSM)
Synchronous state machines. Moore and Mealy state machines (FSM)Mumbi Chishimba
 
mealy moore machine conversion
mealy moore machine conversion mealy moore machine conversion
mealy moore machine conversion Chandnigupta80
 
9flipflopsupdated-191016140658.pptx
9flipflopsupdated-191016140658.pptx9flipflopsupdated-191016140658.pptx
9flipflopsupdated-191016140658.pptxudhayaveenaa
 
Mealy and moore machines
Mealy and moore machinesMealy and moore machines
Mealy and moore machinesgrahamwell
 
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
 
UNIT-IV.pptx
UNIT-IV.pptxUNIT-IV.pptx
UNIT-IV.pptxamudhak10
 
synchronous state machine design
synchronous state machine designsynchronous state machine design
synchronous state machine designAdarsh Patel
 

Similar to Moore and Mealy machines (20)

Lecture 3
Lecture 3Lecture 3
Lecture 3
 
19-MooreMealy.ppt
19-MooreMealy.ppt19-MooreMealy.ppt
19-MooreMealy.ppt
 
melay and moore machine.pptx
melay and moore machine.pptxmelay and moore machine.pptx
melay and moore machine.pptx
 
Logic and computer design.ppt
Logic and computer design.pptLogic and computer design.ppt
Logic and computer design.ppt
 
state_machines1.pdf
state_machines1.pdfstate_machines1.pdf
state_machines1.pdf
 
Ade(unit 4) Counters
Ade(unit 4) CountersAde(unit 4) Counters
Ade(unit 4) Counters
 
MOC2.PPT[1].pptx introduction to mealy machine and moore machine with eample ...
MOC2.PPT[1].pptx introduction to mealy machine and moore machine with eample ...MOC2.PPT[1].pptx introduction to mealy machine and moore machine with eample ...
MOC2.PPT[1].pptx introduction to mealy machine and moore machine with eample ...
 
Mealy Machine by Daniyal Khan
Mealy Machine by Daniyal KhanMealy Machine by Daniyal Khan
Mealy Machine by Daniyal Khan
 
Applications of Mealy & Moore Machine
Applications of  Mealy  & Moore Machine Applications of  Mealy  & Moore Machine
Applications of Mealy & Moore Machine
 
Digital Counter Design
 Digital Counter Design Digital Counter Design
Digital Counter Design
 
Modeling FSMs
Modeling FSMsModeling FSMs
Modeling FSMs
 
07 seq logicii-ix2
07 seq logicii-ix207 seq logicii-ix2
07 seq logicii-ix2
 
Synchronous state machines. Moore and Mealy state machines (FSM)
Synchronous state machines.  Moore and Mealy state machines (FSM)Synchronous state machines.  Moore and Mealy state machines (FSM)
Synchronous state machines. Moore and Mealy state machines (FSM)
 
9920Lec12 FSM.ppt
9920Lec12 FSM.ppt9920Lec12 FSM.ppt
9920Lec12 FSM.ppt
 
mealy moore machine conversion
mealy moore machine conversion mealy moore machine conversion
mealy moore machine conversion
 
9flipflopsupdated-191016140658.pptx
9flipflopsupdated-191016140658.pptx9flipflopsupdated-191016140658.pptx
9flipflopsupdated-191016140658.pptx
 
Mealy and moore machines
Mealy and moore machinesMealy and moore machines
Mealy and moore 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
 
UNIT-IV.pptx
UNIT-IV.pptxUNIT-IV.pptx
UNIT-IV.pptx
 
synchronous state machine design
synchronous state machine designsynchronous state machine design
synchronous state machine design
 

More from Irfan Anjum

DLD Lec 8 multiplexers.pptx
DLD Lec 8 multiplexers.pptxDLD Lec 8 multiplexers.pptx
DLD Lec 8 multiplexers.pptxIrfan Anjum
 
Control hazards MIPS pipeline.pptx
Control hazards MIPS pipeline.pptxControl hazards MIPS pipeline.pptx
Control hazards MIPS pipeline.pptxIrfan Anjum
 
BitCoin Price Predictor.pptx
BitCoin Price Predictor.pptxBitCoin Price Predictor.pptx
BitCoin Price Predictor.pptxIrfan Anjum
 
Logical instructions (and, or, xor, not, test)
Logical instructions (and, or, xor, not, test)Logical instructions (and, or, xor, not, test)
Logical instructions (and, or, xor, not, test)Irfan Anjum
 
Kalman filter partilce tracking
Kalman filter partilce trackingKalman filter partilce tracking
Kalman filter partilce trackingIrfan Anjum
 
Report kalman filtering
Report kalman filteringReport kalman filtering
Report kalman filteringIrfan Anjum
 

More from Irfan Anjum (7)

DLD Lec 8 multiplexers.pptx
DLD Lec 8 multiplexers.pptxDLD Lec 8 multiplexers.pptx
DLD Lec 8 multiplexers.pptx
 
Lec 04 DLD.pptx
Lec 04 DLD.pptxLec 04 DLD.pptx
Lec 04 DLD.pptx
 
Control hazards MIPS pipeline.pptx
Control hazards MIPS pipeline.pptxControl hazards MIPS pipeline.pptx
Control hazards MIPS pipeline.pptx
 
BitCoin Price Predictor.pptx
BitCoin Price Predictor.pptxBitCoin Price Predictor.pptx
BitCoin Price Predictor.pptx
 
Logical instructions (and, or, xor, not, test)
Logical instructions (and, or, xor, not, test)Logical instructions (and, or, xor, not, test)
Logical instructions (and, or, xor, not, test)
 
Kalman filter partilce tracking
Kalman filter partilce trackingKalman filter partilce tracking
Kalman filter partilce tracking
 
Report kalman filtering
Report kalman filteringReport kalman filtering
Report kalman filtering
 

Recently uploaded

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Recently uploaded (20)

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 

Moore and Mealy machines

  • 2. OUTLINE • Introduction • Types of Finite State Machines • • • Mealy State Machine Moore State Machine Example 2
  • 3. Finite State Machine • FSMs are different from counters in the sense that they have external I/Ps, and state transitions are dependent on these I/Ps and the current state. • Simple forms of pattern matching. • Models for sequential logic circuits, of the kind on which every present-day computer and many device controllers is based. 3
  • 4. Mealy and Moore Machines External I/Ps External I/Ps m1 External O/Ps m1 Comb. Logic n FFs m2 Next State Comb. Logic n even ↓ odd n Output Logic CLK m2 FFs n CLK External Outputs Moore Machine Model Mealy Machine Model 4
  • 5. Difference Between Mealy and Moore Machine Mealy (1) O/Ps depend on the present state and present I/Ps (2) The O/P change asyn -chronously with the enabling clock edge (3) (4) Moore O/Ps depend only on the present state Since the O/Ps change when the state changes, and the state change is synchronous with the enabling clock edge, O/Ps change synchronously with this clock edge A counter is a Moore machine A counter is not a Mealy machine A Mealy machine will have the same # or fewer states than a Moore machine 5
  • 6. Finite State Machine (FSM) Design Example: There is a one bit-serial I/P line. Design an FSM that outputs a ‘0’ if an even # of 1’s have been received on the I/P line and the outputs a ‘1’ otherwise. x FSM O/p y CLK CLK x # of 1s even (0) odd (1) even (2) odd (3) 6 odd (3)
  • 7. Solution 1: (Mealy) Solution 2: (Moore) 0 0/0 Reset Even Transition Arc Input 1/1 1/0 Odd Reset Output Even Output [0] O/P is dependent on current state and input in Mealy 1 1 Odd [1] 0 0/1 Mealy Machine: Output is associated with the state transition, and appears before the state transition is completed (by the next clock pulse). Input Output is dependent only on current state Moore Machine: Output is associated with the state and hence appears after the state transition take place. 7
  • 8. State Transition Table (Even-Parity Checker) Even State: 0 ; Present State Input A Odd State: 1; Next State x State Variable A Mealy O/P Moore O/P A+ y1 D-FF Excit. y2 DA 0 0 0 0 0 0 0 1 1 0 1 1 1 1 0 1x 1 0 Input variables to comb. logic 1 1 DA= A⊕x ; y1 = A for Moore y2 = A⊕x for Mealy Output functions 1 1 y2 0 N.S. & O/P Logic Q A FF x N.S. Logic Or Q DA CLK 8 0 A O/P Logic FFs y1 DA
  • 9. Moore M/C Implementation a) D-FF 0 D x=1 R CLK A Q y1 Q Reset Moore O/P is synchronized with clock. Mealy M/C Implementation y2 0 1 D x=1 CLK Q R A Q Reset a) D-FF Mealy O/P is not synchronized with clock. 9
  • 10. Moore M/C Implementation a) D-FF 0 D x=1 R CLK A Q y1 Q Reset Moore O/P is synchronized with clock. Mealy M/C Implementation y2 0 1 D x=1 CLK Q R A Q Reset a) D-FF Mealy O/P is not synchronized with clock. 9