Beruflich Dokumente
Kultur Dokumente
11/29/2013
Page 1
Motivation
Analysis of a few simple circuits
11/29/2013
Page 2
Overview
Concept of the Synchronous Sequential Circuits
Partitioning into Datapath and Control When Inputs are Sampled and Outputs Asserted
Word Problems
Case Studies
11/29/2013 55:032 - Introduction to Digital Design Page 3
Control
Control
State Status Inputs
The Supervisor
Control Outputs
The worker
Datapath
11/29/2013
Page 4
11/29/2013
Page 7
State T ime
Cloc k
Delayed Outputs:
take effect on next clock edge propagation delays must exceed hold times
Inputs
Outputs
11/29/2013
Page 8
11/29/2013
Page 10
State diagram can have different forms depending on the type of sequential circuit output.
11/29/2013
Page 11
11/29/2013
Page 12
Open
11/29/2013
Page 13
Tabulate typical input sequences: three nickels nickel, dime dime, nickel two dimes two nickels, dime
Draw state diagram: Inputs: N, D, reset Output: open
N S7 [open] S3 N
Reset S0 N S1 D S2
D S4 [open]
N S5 [open]
D S6 [open]
D S8 [open]
11/29/2013
Page 14
Inputs D N 0 0 1 1 0 0 1 1 0 0 1 1 X 0 1 0 1 0 1 0 1 0 1 0 1 X
Next State 0 5 10 X 5 10 15 X 10 15 15 X 15
Output Open 0 0 0 X 0 0 0 X 0 0 0 X 1
N 5 D
5
N 10 D N, D 15 [open]
10
15
11/29/2013
Page 15
Inputs D N
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Next State Q1 + Q+ 0
0 0 0 1 1 0 X X 0 1 1 0 1 1 X X 1 0 1 1 1 1 X X 1 1 1 1 1 1 X X
Output Open
0 0 0 X 0 0 0 X 0 0 0 X 1 1 1 X
NOTE! For D-FFs the next state will be what is at the D input. So each FFs next state values in the state table must be the D inputs for that FF.
5
1 0
10
1 1
15
11/29/2013
Page 16
D FF easiest to use
Q1 Q0 00 DN 00 01 N 11 D 10 Q1 01 11 10
0 0 1
0 1 1
1 1 1
Q0
1 1 X 1
0 1 0
1 0 1
1 1 1
Q0
0 1 1
0 0 0
0 0 0
1 1 1
Q0
0 0 0
N
X X X
X X X X
X X
X X
Q1 D Q0 N N \ Q0 Q0 \N Q1 N Q1 D
D1 D CLK R \reset
Q Q
Q1 \ Q1
D1 = Q1 + D + Q0 N
OPEN
D0 = N Q0 + Q0 N + Q1 N + Q1 D
D0 D CLK R \reset Q Q0 Q \ Q0
OPEN = Q1 Q0 8 Gates
11/29/2013
Page 17
JK Characteristic Table
JK Excitation Table
J 0 0 0 0 1 1 1 1
K 0 0 1 1 0 0 1 1
Q 0 1 0 1 0 1 0 1
Q+ 0 1 0 0 1 1 1 0
Q 0 0 1 1
Q+ 0 1 0 1
J 0 1 X X
K X X 1 0
11/29/2013
Page 19
Q Q+
0 0 1 1 0 1 0 1
J K
0 1 X X X X 1 0
S R
0 1 0 X X 0 1 0
T
0 1 1 0
D
0 1 0 1
You can use any FF type for your implementation FF types can be mixed; I.e. in vending machinge you could use a JK FF for Q1 and a T FF for Q0
11/29/2013
Page 20
Present State Q1 Q0
0 0
Inputs D N
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Next State Q+ Q+ 1 0
0 0 1 X 0 1 1 X 1 1 1 X 1 1 1 X 0 1 0 X 1 0 1 X 0 1 1 X 1 1 1 X
J1
0 0 1 X 0 1 1 X X X X X X X X X
K1 X X X X X X X X 0 0 0 X 0 0 0 X
J0 K 0
0 1 0 X X X X X 0 1 1 X X X X X X X X X 0 1 0 X X X X X 0 0 0 X
Q 0 0 1 1
Q+ 0 1 0 1
J 0 1 X X
0
X X 1 0
11/29/2013
Page 21
J1 = D + Q0 N K1 = 0
N
X X
X X
01
11 D 10
0
1
1
1
X X
X X
Q0 Q1
01 N
11 D 10
X X
X X X X
0
0
Q0
0
0
Q1
X X X X
X X
J0 = N + Q1 D K0 = Q1 N
N Q0 D \ Q0 N Q1 OPEN Q0 \ Q0
Q1 Q0 00 DN 00 01
01
11
10
Q1 Q0 00 DN 00 01 N
J CLK
Q1 \ Q1
01
11
10
K RQ
0 1 0
X X X X X X
Q0
0 1 1
X X X
0 1 0
0 0 0
Q0
X X X
N
D \ Q1 N CLK
11
D 10
X X X X
11
D 10
X X X X
KR Q \reset
7 Gates
11/29/2013
Page 22
State Register
Combinational Logic for Next State (FF Inputs) Comb. Logic for Outputs)
Z Outputs
State Feedback
Clock
11/29/2013
Page 23
Moore Machine
N D/0 N/0
10 D/1
11/29/2013
Page 24
0/0 0 1
1/0
1
[0] 1 2 [1] 1
1/1
11/29/2013
Page 25
State Register
Combinational Logic for Next State (FF Inputs) Comb. Logic for Outputs)
Output Register
Z Outputs
State Feedback
Clock
Clock
Latched state AND outputs Avoids glitchy outputs! Outputs are delayed by up to 1 clock period Usually equivalent to the Moore form
11/29/2013
Page 26
Four Case Studies: Finite String Pattern Recognizer Complex Counter with Decision Making Traffic Light Controller Digital Combination Lock
11/29/2013
Page 27
11/29/2013
Page 28
11/29/2013
Page 29
11/29/2013
Page 30
11/29/2013
Page 31
11/29/2013
Page 32
Write down sequences of states and transitions for the sequences to be recognized
Add missing transitions; reuse states as much as possible Verify I/O behavior of your state diagram to insure it functions like the specification
11/29/2013
Page 33
11/29/2013
Page 34
S1 /001 0 1 S2 /010
0 S5 /101
0
0
1 S4 /100 0
S3 /011
11/29/2013
Page 35
A busy highway is intersected by a little used farmroad. Detectors C sense the presence of cars waiting on the farmroad. With no car on farmroad, light remain green in highway direction. If vehicle on farmroad, highway lights go from Green to Yellow to Red, allowing the farmroad lights to become green. These stay green only as long as a farmroad car is detected but never longer than a set interval. When these are met, farm lights transition from Green to Yellow to Red, allowing highway to return to green. Even if farmroad vehicles are waiting, highway gets at least a set interval as green. Assume you have an interval timer that generates a short time pulse (TS) and a long time pulse (TL) in response to a set (ST) signal. TS is to be used for timing yellow lights and TL for green lights. Note: The interval timer is just another sequential circuit!
11/29/2013
Page 36
Farmroad C FL HL Highway
Highway HL FL C Farmroad
11/29/2013
Page 37
11/29/2013
Page 38
S0
TLC/ST TS S1 TS/ST TS/ST S3 TS
S0: HG, FR
S1: HY, FR
S2: FG, HR S3: FY, HR
TL + C/ST
S2
TL C
Note: This sequential circuit has both Mealy and Moore outputs!
11/29/2013
Page 39
"3 bit serial lock controls entry to locked room. Inputs are RESET, ENTER, 2 position switch for bit of key data. Locks generates an UNLOCK signal when key matches internal combination. ERROR light illuminated if key does not match combination. Sequence is: (1) Press RESET, (2) enter key bit, (3) Press ENTER, (4) repeat (2) & (3) two more times."
Problem specification is incomplete: how do you set the internal combination? exactly when is the ERROR light asserted?
Make reasonable assumptions: hardwired into next state logic vs. stored in internal register assert as soon as error is detected vs. wait until full combination has been entered
Our design: registered combination plus error after full combination
11/29/2013
Page 40
Operator Data
ENTER KEY-IN
Internal Combination
L0 L1 L2
11/29/2013
Page 41
Si Enter=1
Enter=0
11/29/2013
Page 42
State Diagram
KI = L0 Enter Idle0 Enter Comp1 KI = L1 Enter Idle1 Enter Comp2 KI = L2 Reset Done [Unlock] Reset
Enter
Enter
Reset
Reset
11/29/2013
Page 43