SlideShare a Scribd company logo
1 of 23
1CSE370, Lecture 19
Lecture 19
Logistics
Lab 8 this week to be done in pairs
Find a partner before your lab period
Otherwise you will have to wait for a pairing which will slow you down
HW5 and HW6 solutions out today
Graded HW5 available at review session tomorrow
HW7 out today due Wednesday March 4
Midterm 2 Wednesday
Covers material up to simple FSM
Review session tomorrow, 4:30 here, EEB 037
Last lecture
Counter FSM design
General Finite State Machine Design
Vending machine example
Today
Moore/Mealy machines
Midterm 2 topics and logistics
2CSE370, Lecture 19
The “WHY” slide
Moore/Mealy machines
There are two different ways to express the FSMs with
respect to the output. Both have different advantages so it is
good to know them.
3CSE370, Lecture 19
Inputs
Outputs
Next State
Current State
output
logic
Next-state
logic
Generalized FSM model: Moore and
Mealy
Combinational logic computes next state and outputs
Next state is a function of current state and inputs
Outputs are functions of
Current state (Moore machine)
Current state and inputs (Mealy machine)
4CSE370, Lecture 19
Moore versus Mealy machines
outputs
state feedback
inputs
reg
combinational
logic for
next state logic for
outputs
Moore machine
Outputs are a function
of current state
Outputs change
synchronously with
state changes
Mealy machine
Outputs depend on state
and on inputs
Input changes can cause
immediate output changes
(asynchronous)
inputs outputs
state feedback
reg
combinational
logic for
next state
logic for
outputs
5CSE370, Lecture 19
Impacts start of the FSM design procedure
Counter-design procedure
1. State diagram
2. State-transition table
3. Next-state logic minimization
4. Implement the design
FSM-design procedure
1. State diagram
2. State-transition table
3. State minimization
4. State encoding
5. Next-state logic minimization
6. Implement the design
6CSE370, Lecture 19
State Diagrams
Moore machine
Each state is labeled by a pair:
state-name/output or state-name [output]
Mealy machine
Each transition arc is labeled by a pair:
input-condition/output
7CSE370, Lecture 19
D Q
Q
D Q
Q
D Q
Q
D Q
Q
A
B
clock
out
D Q
Q
D Q
Q
A
B
clock
out
Example 10 → 01: Moore or Mealy?
Circuits recognize AB=10 followed by AB=01
What kinds of machines are they?
Moore
Mealy
8CSE370, Lecture 19
Example “01 or 10” detector: a Moore machine
Output is a function of state only
Specify output in the state bubble
D/1
E/1
B/0
A/0
C/0
1
0
0
0
0
1
1
1
1
0
reset
current next current
reset input state state output
1 – – A 0
0 0 A B 0
0 1 A C 0
0 0 B B 0
0 1 B D 0
0 0 C E 0
0 1 C C 0
0 0 D E 1
0 1 D C 1
0 0 E B 1
0 1 E D 1
9CSE370, Lecture 19
Example “01 or 10” detector: a Mealy machine
Output is a function of state and inputs
Specify outputs on transition arcs
current next current
reset input state state output
B
A
C
0/1
0/0
0/0
1/1
1/0
1/0
reset/0
1 – – A 0
0 0 A B 0
0 1 A C 0
0 0 B B 0
0 1 B C 1
0 0 C B 1
0 1 C C 0
10CSE370, Lecture 19
Comparing Moore and Mealy machines
Moore machines
+ Safer to use because outputs change at clock edge
– May take additional logic to decode state into outputs
Mealy machines
+ Typically have fewer states
+ React faster to inputs — don't wait for clock
– Asynchronous outputs can be dangerous
We often design synchronous Mealy machines
Design a Mealy machine
Then register the outputs
11CSE370, Lecture 19
Synchronous (registered) Mealy machine
Registered state and registered outputs
No glitches on outputs
No race conditions between communicating machines
inputs outputs
state feedback
reg
combinational
logic for
next state
logic for
outputs
reg
12CSE370, Lecture 19
D Q
Q
B
A
clock
out
D Q
Q
D Q
Q
clock
out
A
B
Example “=01”: Moore or Mealy?
Recognize AB = 01
Mealy or Moore?
Registered Mealy
(actually Moore)
Moore
13CSE370, Lecture 19
Example: A parity checker
Serial input string
OUT=1 if odd # of 1s in input
OUT=0 if even # of 1s in input
Let’s do this for Moore and Mealy
14CSE370, Lecture 19
Example: A parity checker
Even
[0]
Odd
[1]
0
1 1
1. State diagram
Moore Mealy
Even
[0]
Odd
[1]
0
1 1
0/0
1/1 1/0
0/1
15CSE370, Lecture 19
Example: A parity checker
Present Input Next Present
State State Output
Even 0 Even 0
Even 1 Odd 0
Odd 0 Odd 1
Odd 1 Even 1
1. State-transition table
Present Input Next Present
State State Output
Even 0 Even 0
Even 1 Odd 1
Odd 0 Odd 1
Odd 1 Even 0
Moore
Mealy
16CSE370, Lecture 19
3. State minimization: Already minimized
Need both states (even and odd)
Use one flip-flop
Example: A parity checker
17CSE370, Lecture 19
4. State encoding
Present Input Next Present
State State Output
0 0 0 0
0 1 1 0
1 0 1 1
1 1 0 1
Assignment
Even 0
Odd 1
Present Input Next Present
State State Output
0 0 0 0
0 1 1 1
1 0 1 1
1 1 0 0
Moore
Mealy
Example: A parity checker
18CSE370, Lecture 19
Example: A parity checker
5. Next-state logic minimization
Assume D flip-flops
Next state = (present state) XOR (present input)
6. Implement the design
CLK
Input
Output
D Q
Q
CLK
Input
Current
State
D Q
Q
OutputMoore
Mealy
19CSE370, Lecture 19
What was covered after midterm 1
Combinational logic applications
PLAs/PALs
ROMs
Adders
Multi-level logic
Timing diagrams
Hazards
1010
+ 0110
-------------
????
20CSE370, Lecture 19
What was covered after midterm 1
Sequential logic building blocks
Latches (R-S and D)
Flip-flops (D and T)
Latch and flip-flop timing (setup/hold time, prop delay)
Timing diagrams
Asynchronous inputs and metastability
Registers
Remember that
the last number was 1
21CSE370, Lecture 19
What was covered after midterm 1
Counters
Timing diagrams
Shift registers
Ring counters
State diagrams and state-transition tables
Counter design procedure
1. Draw a state diagram
2. Draw a state-transition table
3. Encode the next-state functions
4. Implement the design
Self-starting counters
1, 2, 3, 4, …
22CSE370, Lecture 19
Finite state machines
FSM design procedure
1. State diagram
2. State-transition table
3. State minimization
4. State encoding
5. Next-state logic minimization
6. Implement the design
 No Mealy machines
What was covered after midterm 1
The last coin was 25cents and
already had 50cents deposited
so let’s pop out a soda
Don’ t expect to know a ton of FSM.
Just understand what was presented in the lectures.
23CSE370, Lecture 19
Midterm 2 logistics
45 minutes long (starts 10:35)
Materials covered from
Lectures 9 to 18 (but not Sequential Verilog or Moore/Mealy)
HW 4, 5, and 6
Closed book/notes, no calculator
Scratch papers provided
Just have your pencil/pen and eraser
Raise hand for questions (don’t walk to get help)

More Related Content

What's hot

Electronics 1 : Chapter # 06 : Bipolar Junction Transistor
Electronics 1 : Chapter # 06 : Bipolar Junction TransistorElectronics 1 : Chapter # 06 : Bipolar Junction Transistor
Electronics 1 : Chapter # 06 : Bipolar Junction TransistorSk_Group
 
2 bit comparator (Digital Electronics)
2 bit comparator (Digital Electronics)2 bit comparator (Digital Electronics)
2 bit comparator (Digital Electronics)Shail Nakum
 
Three phase-controlled-rectifiers
Three phase-controlled-rectifiersThree phase-controlled-rectifiers
Three phase-controlled-rectifiersTejas Deshpande
 
Proyecto final curso – Electrónica Digital I
Proyecto final curso – Electrónica Digital IProyecto final curso – Electrónica Digital I
Proyecto final curso – Electrónica Digital IDaniel A. Lopez Ch.
 
Sequential Logic Circuit
Sequential Logic CircuitSequential Logic Circuit
Sequential Logic CircuitYong Heui Cho
 
Sequential cmos logic circuits
Sequential cmos logic circuitsSequential cmos logic circuits
Sequential cmos logic circuitsSakshi Bhargava
 
Moore and Mealy machines
Moore and Mealy machinesMoore and Mealy machines
Moore and Mealy machinesIrfan Anjum
 
decoder and encoder
 decoder and encoder decoder and encoder
decoder and encoderUnsa Shakir
 
Logic design and switching theory
Logic design and switching theoryLogic design and switching theory
Logic design and switching theoryjomerson remorosa
 
8086 MICROPROCESSOR
8086 MICROPROCESSOR8086 MICROPROCESSOR
8086 MICROPROCESSORAkhila Rahul
 
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECEDigital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECESeshaVidhyaS
 
multiplexers and demultiplexers
 multiplexers and demultiplexers multiplexers and demultiplexers
multiplexers and demultiplexersUnsa Shakir
 
To designing counters using verilog code
To designing counters using verilog codeTo designing counters using verilog code
To designing counters using verilog codeBharti Airtel Ltd.
 
The BCD to excess-3 converter
The BCD to excess-3 converterThe BCD to excess-3 converter
The BCD to excess-3 converterMahady Hasan
 

What's hot (20)

Electronics 1 : Chapter # 06 : Bipolar Junction Transistor
Electronics 1 : Chapter # 06 : Bipolar Junction TransistorElectronics 1 : Chapter # 06 : Bipolar Junction Transistor
Electronics 1 : Chapter # 06 : Bipolar Junction Transistor
 
2 bit comparator (Digital Electronics)
2 bit comparator (Digital Electronics)2 bit comparator (Digital Electronics)
2 bit comparator (Digital Electronics)
 
Three phase-controlled-rectifiers
Three phase-controlled-rectifiersThree phase-controlled-rectifiers
Three phase-controlled-rectifiers
 
Sequential circuits
Sequential circuitsSequential circuits
Sequential circuits
 
Arduino dc motor
Arduino dc motor Arduino dc motor
Arduino dc motor
 
Proyecto final curso – Electrónica Digital I
Proyecto final curso – Electrónica Digital IProyecto final curso – Electrónica Digital I
Proyecto final curso – Electrónica Digital I
 
Sequential Logic Circuit
Sequential Logic CircuitSequential Logic Circuit
Sequential Logic Circuit
 
Sequential cmos logic circuits
Sequential cmos logic circuitsSequential cmos logic circuits
Sequential cmos logic circuits
 
Moore and Mealy machines
Moore and Mealy machinesMoore and Mealy machines
Moore and Mealy machines
 
Digital Electronics Notes.pdf
Digital Electronics Notes.pdfDigital Electronics Notes.pdf
Digital Electronics Notes.pdf
 
Flip Flop
Flip FlopFlip Flop
Flip Flop
 
decoder and encoder
 decoder and encoder decoder and encoder
decoder and encoder
 
Logic design and switching theory
Logic design and switching theoryLogic design and switching theory
Logic design and switching theory
 
8086 MICROPROCESSOR
8086 MICROPROCESSOR8086 MICROPROCESSOR
8086 MICROPROCESSOR
 
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECEDigital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
 
Digital Logic Design
Digital Logic DesignDigital Logic Design
Digital Logic Design
 
multiplexers and demultiplexers
 multiplexers and demultiplexers multiplexers and demultiplexers
multiplexers and demultiplexers
 
To designing counters using verilog code
To designing counters using verilog codeTo designing counters using verilog code
To designing counters using verilog code
 
Uart
UartUart
Uart
 
The BCD to excess-3 converter
The BCD to excess-3 converterThe BCD to excess-3 converter
The BCD to excess-3 converter
 

Similar to 19 moore mealy

07 seq logicii-ix2
07 seq logicii-ix207 seq logicii-ix2
07 seq logicii-ix2SHIVA PRASAD
 
Sequential Logic Circuits
Sequential Logic CircuitsSequential Logic Circuits
Sequential Logic CircuitsDilum Bandara
 
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence CounterLab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence CounterKatrina Little
 
System design methodology
System design methodologySystem design methodology
System design methodologydennis gookyi
 
Analysis sequential circuits
Analysis sequential circuitsAnalysis sequential circuits
Analysis sequential circuitsG Subramaniamg
 
lecture25_algorithmic_state_machines.ppt
lecture25_algorithmic_state_machines.pptlecture25_algorithmic_state_machines.ppt
lecture25_algorithmic_state_machines.pptssuser2ae35a
 
Synchronous Loadable Up and Down Counter
Synchronous Loadable Up and Down Counter Synchronous Loadable Up and Down Counter
Synchronous Loadable Up and Down Counter Digital System Design
 
Logic and computer design.ppt
Logic and computer design.pptLogic and computer design.ppt
Logic and computer design.ppteissaalesayi1
 
Introduction state machine
Introduction state machineIntroduction state machine
Introduction state machineShreyans Pathak
 
Digital Electronics Registers and Counters.pptx
Digital Electronics Registers and Counters.pptxDigital Electronics Registers and Counters.pptx
Digital Electronics Registers and Counters.pptxnavaneethakrishnanec
 
Design System Design-ASM and Asynchronous Sequential Circuits
Design System Design-ASM and Asynchronous Sequential CircuitsDesign System Design-ASM and Asynchronous Sequential Circuits
Design System Design-ASM and Asynchronous Sequential CircuitsIndira Priyadarshini
 

Similar to 19 moore mealy (20)

19-MooreMealy.ppt
19-MooreMealy.ppt19-MooreMealy.ppt
19-MooreMealy.ppt
 
19-MooreMealy.ppt
19-MooreMealy.ppt19-MooreMealy.ppt
19-MooreMealy.ppt
 
9920Lec12 FSM.ppt
9920Lec12 FSM.ppt9920Lec12 FSM.ppt
9920Lec12 FSM.ppt
 
07 seq logicii-ix2
07 seq logicii-ix207 seq logicii-ix2
07 seq logicii-ix2
 
18-FSM.ppt
18-FSM.ppt18-FSM.ppt
18-FSM.ppt
 
Sequential Logic Circuits
Sequential Logic CircuitsSequential Logic Circuits
Sequential Logic Circuits
 
Lec17-Registers.ppt
Lec17-Registers.pptLec17-Registers.ppt
Lec17-Registers.ppt
 
04 comb ex
04 comb ex04 comb ex
04 comb ex
 
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence CounterLab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
 
System design methodology
System design methodologySystem design methodology
System design methodology
 
Analysis sequential circuits
Analysis sequential circuitsAnalysis sequential circuits
Analysis sequential circuits
 
lecture25_algorithmic_state_machines.ppt
lecture25_algorithmic_state_machines.pptlecture25_algorithmic_state_machines.ppt
lecture25_algorithmic_state_machines.ppt
 
Synchronous Loadable Up and Down Counter
Synchronous Loadable Up and Down Counter Synchronous Loadable Up and Down Counter
Synchronous Loadable Up and Down Counter
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
 
Logic and computer design.ppt
Logic and computer design.pptLogic and computer design.ppt
Logic and computer design.ppt
 
Introduction state machine
Introduction state machineIntroduction state machine
Introduction state machine
 
lecture23.pdf
lecture23.pdflecture23.pdf
lecture23.pdf
 
Digital Electronics Registers and Counters.pptx
Digital Electronics Registers and Counters.pptxDigital Electronics Registers and Counters.pptx
Digital Electronics Registers and Counters.pptx
 
Design System Design-ASM and Asynchronous Sequential Circuits
Design System Design-ASM and Asynchronous Sequential CircuitsDesign System Design-ASM and Asynchronous Sequential Circuits
Design System Design-ASM and Asynchronous Sequential Circuits
 
Eco
EcoEco
Eco
 

Recently uploaded

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 

Recently uploaded (20)

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 

19 moore mealy

  • 1. 1CSE370, Lecture 19 Lecture 19 Logistics Lab 8 this week to be done in pairs Find a partner before your lab period Otherwise you will have to wait for a pairing which will slow you down HW5 and HW6 solutions out today Graded HW5 available at review session tomorrow HW7 out today due Wednesday March 4 Midterm 2 Wednesday Covers material up to simple FSM Review session tomorrow, 4:30 here, EEB 037 Last lecture Counter FSM design General Finite State Machine Design Vending machine example Today Moore/Mealy machines Midterm 2 topics and logistics
  • 2. 2CSE370, Lecture 19 The “WHY” slide Moore/Mealy machines There are two different ways to express the FSMs with respect to the output. Both have different advantages so it is good to know them.
  • 3. 3CSE370, Lecture 19 Inputs Outputs Next State Current State output logic Next-state logic Generalized FSM model: Moore and Mealy Combinational logic computes next state and outputs Next state is a function of current state and inputs Outputs are functions of Current state (Moore machine) Current state and inputs (Mealy machine)
  • 4. 4CSE370, Lecture 19 Moore versus Mealy machines outputs state feedback inputs reg combinational logic for next state logic for outputs Moore machine Outputs are a function of current state Outputs change synchronously with state changes Mealy machine Outputs depend on state and on inputs Input changes can cause immediate output changes (asynchronous) inputs outputs state feedback reg combinational logic for next state logic for outputs
  • 5. 5CSE370, Lecture 19 Impacts start of the FSM design procedure Counter-design procedure 1. State diagram 2. State-transition table 3. Next-state logic minimization 4. Implement the design FSM-design procedure 1. State diagram 2. State-transition table 3. State minimization 4. State encoding 5. Next-state logic minimization 6. Implement the design
  • 6. 6CSE370, Lecture 19 State Diagrams Moore machine Each state is labeled by a pair: state-name/output or state-name [output] Mealy machine Each transition arc is labeled by a pair: input-condition/output
  • 7. 7CSE370, Lecture 19 D Q Q D Q Q D Q Q D Q Q A B clock out D Q Q D Q Q A B clock out Example 10 → 01: Moore or Mealy? Circuits recognize AB=10 followed by AB=01 What kinds of machines are they? Moore Mealy
  • 8. 8CSE370, Lecture 19 Example “01 or 10” detector: a Moore machine Output is a function of state only Specify output in the state bubble D/1 E/1 B/0 A/0 C/0 1 0 0 0 0 1 1 1 1 0 reset current next current reset input state state output 1 – – A 0 0 0 A B 0 0 1 A C 0 0 0 B B 0 0 1 B D 0 0 0 C E 0 0 1 C C 0 0 0 D E 1 0 1 D C 1 0 0 E B 1 0 1 E D 1
  • 9. 9CSE370, Lecture 19 Example “01 or 10” detector: a Mealy machine Output is a function of state and inputs Specify outputs on transition arcs current next current reset input state state output B A C 0/1 0/0 0/0 1/1 1/0 1/0 reset/0 1 – – A 0 0 0 A B 0 0 1 A C 0 0 0 B B 0 0 1 B C 1 0 0 C B 1 0 1 C C 0
  • 10. 10CSE370, Lecture 19 Comparing Moore and Mealy machines Moore machines + Safer to use because outputs change at clock edge – May take additional logic to decode state into outputs Mealy machines + Typically have fewer states + React faster to inputs — don't wait for clock – Asynchronous outputs can be dangerous We often design synchronous Mealy machines Design a Mealy machine Then register the outputs
  • 11. 11CSE370, Lecture 19 Synchronous (registered) Mealy machine Registered state and registered outputs No glitches on outputs No race conditions between communicating machines inputs outputs state feedback reg combinational logic for next state logic for outputs reg
  • 12. 12CSE370, Lecture 19 D Q Q B A clock out D Q Q D Q Q clock out A B Example “=01”: Moore or Mealy? Recognize AB = 01 Mealy or Moore? Registered Mealy (actually Moore) Moore
  • 13. 13CSE370, Lecture 19 Example: A parity checker Serial input string OUT=1 if odd # of 1s in input OUT=0 if even # of 1s in input Let’s do this for Moore and Mealy
  • 14. 14CSE370, Lecture 19 Example: A parity checker Even [0] Odd [1] 0 1 1 1. State diagram Moore Mealy Even [0] Odd [1] 0 1 1 0/0 1/1 1/0 0/1
  • 15. 15CSE370, Lecture 19 Example: A parity checker Present Input Next Present State State Output Even 0 Even 0 Even 1 Odd 0 Odd 0 Odd 1 Odd 1 Even 1 1. State-transition table Present Input Next Present State State Output Even 0 Even 0 Even 1 Odd 1 Odd 0 Odd 1 Odd 1 Even 0 Moore Mealy
  • 16. 16CSE370, Lecture 19 3. State minimization: Already minimized Need both states (even and odd) Use one flip-flop Example: A parity checker
  • 17. 17CSE370, Lecture 19 4. State encoding Present Input Next Present State State Output 0 0 0 0 0 1 1 0 1 0 1 1 1 1 0 1 Assignment Even 0 Odd 1 Present Input Next Present State State Output 0 0 0 0 0 1 1 1 1 0 1 1 1 1 0 0 Moore Mealy Example: A parity checker
  • 18. 18CSE370, Lecture 19 Example: A parity checker 5. Next-state logic minimization Assume D flip-flops Next state = (present state) XOR (present input) 6. Implement the design CLK Input Output D Q Q CLK Input Current State D Q Q OutputMoore Mealy
  • 19. 19CSE370, Lecture 19 What was covered after midterm 1 Combinational logic applications PLAs/PALs ROMs Adders Multi-level logic Timing diagrams Hazards 1010 + 0110 ------------- ????
  • 20. 20CSE370, Lecture 19 What was covered after midterm 1 Sequential logic building blocks Latches (R-S and D) Flip-flops (D and T) Latch and flip-flop timing (setup/hold time, prop delay) Timing diagrams Asynchronous inputs and metastability Registers Remember that the last number was 1
  • 21. 21CSE370, Lecture 19 What was covered after midterm 1 Counters Timing diagrams Shift registers Ring counters State diagrams and state-transition tables Counter design procedure 1. Draw a state diagram 2. Draw a state-transition table 3. Encode the next-state functions 4. Implement the design Self-starting counters 1, 2, 3, 4, …
  • 22. 22CSE370, Lecture 19 Finite state machines FSM design procedure 1. State diagram 2. State-transition table 3. State minimization 4. State encoding 5. Next-state logic minimization 6. Implement the design  No Mealy machines What was covered after midterm 1 The last coin was 25cents and already had 50cents deposited so let’s pop out a soda Don’ t expect to know a ton of FSM. Just understand what was presented in the lectures.
  • 23. 23CSE370, Lecture 19 Midterm 2 logistics 45 minutes long (starts 10:35) Materials covered from Lectures 9 to 18 (but not Sequential Verilog or Moore/Mealy) HW 4, 5, and 6 Closed book/notes, no calculator Scratch papers provided Just have your pencil/pen and eraser Raise hand for questions (don’t walk to get help)