Beruflich Dokumente
Kultur Dokumente
3 12.9.2007 12:07
Implementation of Sequential
Systems
Sequential networks implement sequential systems
General term for all kinds of sequential systems
Just like combinational networks implement combinational
systems
Most often implementations are for state machines
Only synchronous implementations are considered
Requires clocked components in the implementation
State changes are related to clock signal
4 12.9.2007 12:07
Canonical Sequential Network
State register stores the current state
Combinational network performs functions G and H
s(t+1) = G(s(t);x(t))
z(t) = H(s(t);x(t))
Initializing initialize
next
Combi national
sets s(0) state
State Register
s(t+1) present
s(t) state
present Network
input
x(t)
CLK present
z(t) output
5 12.9.2007 12:07
Mealey State Machine
Mealey state machine can be implemented as
canonical sequential network
State Register
s(t+1)
C1
x(t) s(t) z(t)
C2
State Register
s(t+1) z(t)
C1 C2
x(t) s(t)
CLK
state transition function G output function H
7 12.9.2007 12:07
State Machine with Binary
Variables
To simplify functions, denote s(t+1) = Y, s(t)=y
Initialize
Combinational Network
x0 z0
Inputs Outputs
x m-1 z n-1
Y0 y
0
Y1 y
1
State Register
y (binary cells)
Y k-1 k-1
x0
Initialize
Combinational
x1
Y0 y
Network
0
Y1 y z
1
Y2 y
2
Y3 y
3
CLK
10 12.9.2007 12:07
Most Known Problems Part 1
What is the whole
system output?
Initialize
What is the output of
Combinational Network
x0 z0
the state register?
z n-1
What is the input of the x m-1 Y0 y
0
whole system
Y1 y
What is the input of 1
combinational network y
inside? Y k-1 k-1
PRESENT NEXT
STATE STATE
s(t) s(t+1)
t
Ideal t
clock 0 1 2 3 4 5 6 7
13 12.9.2007 12:15
Ideal Timing (Mealey)
PS x(t)=a x(t)=b Notes:
1. All signals including
even even,1 odd,0 input changes sharply
odd odd,0 even,1 at clock edge
NS; z(t)
Input b b
State EVEN ODD
Output 1 0
Clock
Present state Next state
14 12.9.2007 12:15
Real Timing (Mealey)
Notes:
PS x(t)=a x(t)=b 1. Delays depend on
even even,1 odd,0 combinatorial networks and
odd odd,0 even,1 state register delays
NS; z(t) 2. Output depends on state and
input
3. If input changes during clock
Example real timing period, also output changes
Input b b
State EVEN ODD
Output 1 0
Clock
Present state Next state
15 12.9.2007 12:15
Input Effect on Output (Mealey)
Current output depends on current state and current
input –even if input changes during the clock cycle
Moore is more robust in this sense!
Input a b a b
State EVEN ODD
Output 1 0 1 0
Clock
Present state Next state
16 12.9.2007 12:15
Real Timing (Moore)
PS x(t)=a x(t)=b Notes:
1. Output follows only
even even odd 1 state (with a delay)
odd odd even 0 2. Input changes during
NS z(t) clock period does not
affect output
Example real timing
Input b b
State EVEN ODD
Output 1 0
Clock
Present state Next state
17 12.9.2007 12:16
What is the Input at Clock Edge?
The input present at the input just before the edge
always dictates the next state
Always assume real timing model, even if the input is
drawn as ideally changing sharply at clock edge!
a b
Input a b
State EVEN ODD
Output 1 0
Clock
18 12.9.2007 12:17
State Register
Implementation and
Timing
Implementation of State Register
Any clocked component can be used in principle
Gated latch (level sensitive cell)
Edge triggered cell (rising or falling edge)
Flip Flops (edge sensitive)
20 12.9.2007 12:17
Timing Basics: Clock
Clock has finite duration – pulse width defined as signal
being ”1”
Pulse width should not be smaller than required by
system components
Duty cycle is the ratio between 1 and 0 durations within
clock period
CLK
Clock period T
time
21 12.9.2007 12:18
Level-Sensitive Cells
Example: gated latch D
0
Q(t+t p)=D(t) E(t) Q(t)E (t)
Q
tp is propagation delay
Level sensitive: E
when E=1 then Q=D and latches when E=0
follow input latch
E
22
tp tp
12.9.2007 12:18
Edge-triggering Cell: D-Flip Flop
Specification (note: state is same as output)
Inputs : d (t ) {0,1}
PR {0,1} D (t)
PS=Q(t)
CLR {0,1} 0 1
0 0 1
CLK {0,1}
1 0 1
Outputs : Q(t ) {0,1} NS=Q(t+1)
Q (t ) {0,1}
Function : Q(t 1) D(t )
Q(t ) 0, if CLR 1 (asynchronous reset)
Q(t ) 1, if PR 1 (asynchronous set)
23 12.9.2007 12:18
D-Flip Flop Block and State Diagram
PR (preset)
INPUT D(t) D Q Q(t)
OUTPUTS
CLK
Q’ Q’(t) (optional)
CLR (clear)
1
0 Q=0 Q=1 1
0
24 12.9.2007 12:18
D-Flip Flop Timing Input
D
CLK input inverted in State
Input must be FF symbol = falling Q
stable: edge triggered! CLK
Before edge –
setup time
CLK tw
After edge –
hold time
Pulse width has tsu th
minimum set-up time hold time
duration
Propagation Input
delay is the time
from clock
edge to change State
in output
propagation delay
25 12.9.2007 12:19
tp
Physical Characteristics of D-FF
Propagation delays depend on the output loading L
Note minimum clock pulse width, setup and hold times
for proper operation
Input
Delays
factor Size
tpLH tpHL tsu th tw [std. [equiv.
[ns] [ns] [ns] [ns] [ns] loads] gates]
0:49+0:038L 0:54+0:019L 0:30 0:14 0.2 1 6
26 12.9.2007 12:19
Sequential Network
Timing
Timing of Sequential Network
Consider Moore state machine
C1: combinational network for next state transition
C2: combinational network for output function
State Register
next state Y
Y z
C1 C2
x y
State Registe r
Y z
System A C1 C2 System B
x y
x delay d2
delay d1
State Register
should be stabilized? Y z
C1 C2
x y
delay d1 x delay d2
CLK
Clock CLK
Network input x
tsu (net)
30 12.9.2007 12:20
txsu(net)=d1x +t su(cell)
Sequential Network Hold Time
How long after delay d1 y
State Register
clock edge network Y z
input should keep C1 C2
x y
stable?
delay d1 x delay d2
CLK
Clock CLK
Network input x
State Register
stabilized after Y z
clock edge? C1 C2
x y
delay d1 x delay d2
CLK
Clock CLK
Cell output y
Network output z
t (cell) d2
p
tp(net)=tp(cell)+d2
t (net)
p
32 12.9.2007 12:22
Example –Part 1
One flip-flop forms state register of the system under
consideration
What are input(s) and output(s)?
system under study
SET SET SET
D Q D Q D Q
U1 U3 U4 U6 U7
CLR Q CLR Q CLR Q
F1 F2 F3
U2
U5
U1 U3 U4 U6 U7
CLR Q CLR Q CLR Q
F1 F2 F3
U2
U5
34 12.9.2007 12:23
Example –Part 3
State register consists of FFs F1,F2 and F3
But not drawn as in canonical networks example diagram!
U1 U3 U4 U6 U7
CLR Q CLR Q CLR Q
F1 F2 F3
U2
U5
system under study
Obviously
tsu (net ) tsu ( F1), th (net ) th ( F1), t p (net ) t p ( F 3)
Should this system operate correctly if these timing
constraints are fulfilled?
No, must also consider what is the max clock speed!
35 12.9.2007 12:24
System Clock Speed
Maximum Clock Speed
Minimum clock period dictates maximum clock speed
System S
y
delay d1
State Registe r
Y z
System A C1 C2 System B
x y
x delay d2
delay d1
Delays delay d1
y
State Register
Y z
System A C1 C2 System B
x y
x delay d2
delay d1
38 12.9.2007 12:25
Maximum Clock Frequency –
Minimum Clock Perdiod
Clock CLK
Input x t p ( A)
x
Cell input from Sys A Y t p ( A) d1 tsu
Cell input from PS Y tp d 1y tsu Cell set-up
Network output z tp d2 tsu ( B ) System B set-up
U1 U3 U4 U6 U7
CLR Q CLR Q CLR Q
F1 F2 F3
U2
U5
41 12.9.2007 12:28
Example of Clock Skew
CLK Correct
Two FF-s connected
Skew causes x
malfunction Q1
Q1 Q2
x D Q
CLK
CLK Incorrect
FF1
delay
x
Q2
CLK* D Q z Q1
FF2 CLK*
Q2
43 12.9.2007 12:30