Lab 6 State Machines Fall 2012 Allan Guan What is a State Machine A model of a machine that can be in one of several states eg traffic lights Different representations State tables State diagrams ID: 339891
Download Presentation The PPT/PDF document "ECE 3130 – Digital Electronics and Des..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
ECE 3130 – Digital Electronics and Design
Lab 6State MachinesFall 2012
Allan GuanSlide2
What is a State Machine?
A model of a machine that can be in one of several states (e.g. traffic lights)
Different representations:
State tables
State diagramsState equations
Allan GuanSlide3
Mealy and Moore State Machines
Mealy machineOutput values are determined by both the current state and the current inputsMoore machine
Output values are determined solely by the current state
Allan GuanSlide4
Objectives
Design both a Mealy and Moore machine to detect the sequence, 1010, in a bit patternDraw a state tableImplement a Mealy machine using D flip-flops
Allan GuanSlide5
Moore Machine
Present State
Next State
Output
Input=0
Input=1
S
1
(000)
S
1
(000)
S
2
(001)0S2 (001)S3(010)S2(001)0S3 (010)S1(000)S4(011)0S4 (011)S3(010)S2(001)0S5 (100)S1(000)S4(011)1
Allan GuanSlide6
Mealy Machine
Current State
Next State
Output
Input=0
Input=1
Input=0
Input=1
S
1
(00)
S
1
(00)
S2(01)00S2 (01)S3 (10)S2 (01)00S3 (10)S1 (00)S4 (11)00S4 (11)S3 (10)S2 (01)10
Allan GuanSlide7
Mealy Implementation using DFF
Inputs of combinational circuit
Output of combinational circuit
Present state
Input
Next state
Flip flop inputs
output
A
B
x
A
B
DA
DBy0000000000101010
0
1
0
1
0
1
000110101010000000101111101101010111101010
Allan GuanSlide8
Circuit Implementation
Allan GuanSlide9
Output
Allan Guan