Escolar Documentos
Profissional Documentos
Cultura Documentos
Sequential circuits
primitive sequential elements
combinational logic
Models for representing sequential circuits
finite-state machines (Moore and Mealy)
Basic sequential circuits revisited
shift registers
counters
Design procedure
state diagrams
state transition table
next state functions
Ring counters
Shift registers can also be used as a kind of primitive counter
Uses minimal hardware for its implementation
Not efficient state encoding
Complex counter
repeats 5 states in sequence
not a binary number representation
Step 1: derive the state transition diagram
count sequence: 000, 010, 011, 101, 110
Step 2: derive the state transition table from the state transition diagram
note the don't care conditions that arise from the unused state codes
VII - Finite State Machines Contemporary Logic Design 8
More complex counter example (contd)
C+ C B+ C A+ C
0 0 0 X 1 1 0 X 0 1 0 X
A X 1 X 1 A X 0 X 1 A X 1 X 0
B B B
C+ <= A
B+ <= B + AC
A+ <= BC
Start-up states
at power-up, counter may be in an unused or invalid state
designer must guarantee that it (eventually) enters a valid state
Self-starting solution
design counter so that invalid states eventually transition to a valid state
may limit exploitation of don't cares
011 011
VII - Finite State Machines Contemporary Logic Design 10
Self-starting counters (contd)
A 1 1 1 1 A 1 0 0 1 A 0 1 0 0
B B B
Inputs Outputs
Combinational
Logic
Storage Elements
Sequential logic
sequences through a series of states
based on sequence of values on input signals
clock period defines elements of sequence
1
100 110
1 0 1 1
1
0
0 0 1 0
001 011
0
next state
Inputs Next State
logic
Current State
Outputs
output Outputs
logic
Inputs
next state Next State
logic
Current State
Current State
Next State
State
Clock 0 1 2 3 4 5
VII - Finite State Machines Contemporary Logic Design 19
Comparison of Mealy and Moore machines
Mealy machines tend to have less states
different outputs on arcs (n2) rather than states (n)
Moore machines are safer to use
outputs change at clock edge (always one cycle later)
in Mealy machines, input change can cause output change as soon as
logic is done a big problem when two machines are interconnected
asynchronous feedback may occur if one isnt careful
Mealy machines react faster to inputs
react in same cycle don't need to wait for clock
in Moore machines, more logic may be necessary to decode state into
outputs more gate delays after clock edge
state feedback
combinational
logic for reg
next state
state feedback
Synchronous Mealy
logic for
inputs outputs
outputs
combinational
logic for reg
next state
state feedback
VII - Finite State Machines Contemporary Logic Design 21
Specifying outputs for a Moore machine
1/0
output Outputs
logic
Inputs
next state
logic
Current State
N
Vending Open
Coin Machine Release
Sensor FSM Mechanism
D
Clock
two dimes
S1 S2
draw state diagram:
inputs: N, D, reset N D N D
Q0 Q0 Q0
D1 = Q1 + D + Q0 N
D0 = Q0 N + Q0 N + Q1 N + Q1 D
OPEN = Q1 Q0
0
N D 0 N D/0
[0]
N N/0
D 5 D/0
N D 5 N D/0
[0]
N N/0
10
D N D D/1 10 N D/0
[0]
N+D N+D/1
15
Reset 15 Reset/1
[1]
Reset/0 Reset/0
present state inputs next state output
Q1 Q0 D N D1 D0 open
0 N D/0 0 0 0 0 0 0 0
0 1 0 1 0
1 0 1 0 0
N/0
1 1
D/0 0 1 0 0 0 1 0
5 N D/0 0 1 1 0 0
1 0 1 1 1
N/0 1 1
1 0 0 0 1 0 0
D/1 10 N D/0 0 1 1 1 1
1 0 1 1 1
N+D/1 1 1
1 1 1 1 1
15 Reset/1
Q1
Open
0 0 1 0 D0 = Q0N + Q0N + Q1N + Q1D
0 0 1 1
N D1 = Q1 + D + Q0N
X X 1 X
D OPEN = Q1Q0 + Q1N + Q1D + Q0D
0 1 1 1
Q0 Q0
A
ou t
D Q
B
clock
Q
A
D Q ou t
B
D Q
clock
Q
A
D Q
B
D Q
Q
clock
ou t
A
D Q D Q
Q Q
B
D Q D Q
Q Q
clock
Moore Mealy
zero
[0] 0/0
zero
1 0 [0]
0 one1 0/0 1/0
[0]
one1
0 1 [0]
1 1/1
two1s
[1]