Академический Документы
Профессиональный Документы
Культура Документы
In digital circuit theory, sequential logic is a type of logic circuit whose output depends not only on the present value of its input signals but on the past history of its inputs.
Introduction
A sequential circuit consists of a feedback
Combinational outputs Memory outputs
Combinational logic
Memory elements
External inputs
Introduction
There are two types of sequential circuits:
synchronous: outputs change only at specific
Bistable logic devices: latches and flip-flops. Latches and flip-flops differ in the method used
for changing their state.
Introduction
Memory Elements
Memory element: a device which can remember
value indefinitely, or change value on command from its inputs.
command Memory element Q stored value
Characteristic table:
Command (at time t) Set Reset Memorise / No Change Q(t) X X 0 1 Q(t+1) 1 0 0 1
4
Memory Elements
Memory Elements
Memory element with clock. Flip-flops are memory
elements that change state on clock signals.
command
Memory element
Q stored value
clock
Positive edges
Negative edges
Memory Elements
Memory Elements
Two types of triggering/activation:
pulse-triggered edge-triggered
Pulse-triggered
latches ON = 1, OFF = 0
Edge-triggered
flip-flops positive edge-triggered (ON = from 0 to 1; OFF = other
S-R Latch
Complementary outputs: Q and Q'. When Q is HIGH, the latch is in SET state. When Q is LOW, the latch is in RESET state. For active-HIGH input S-R latch (also known as NOR
gate latch), R=HIGH (and S=LOW) a RESET state S=HIGH (and R=LOW) a SET state both inputs LOW a no change both inputs HIGH a Q and Q' both LOW (invalid)!
S R
S-R Latch
Q Q
7
S-R Latch
For active-LOW input S'-R' latch (also known as
NAND gate latch), R'=LOW (and S'=HIGH) a RESET state S'=LOW (and R'=HIGH) a SET state both inputs HIGH a no change both inputs LOW a Q and Q' both HIGH (invalid)!
S-R Latch
S-R Latch
Characteristics table for active-high input S-R latch:
S 0 1 0 1 R 0 0 1 1 Q NC 1 0 0 Q' NC 0 1 0 No change. Latch remained in present state. Latch SET. Latch RESET. Invalid condition.
S R
Q Q'
S R
Q Q'
S-R Latch
S-R Latch
Active-HIGH input S-R latch
10 100 R Q 11000 Q' 0 0 1 1 0
S 1 0 0 0 1 R 0 0 1 0 1 Q Q' 1 0 initial 1 0 (afer S=1, R=0) 0 1 0 1 (after S=0, R=1) 0 0 invalid!
10 001 S
R'
R'
S' R' 1 0 1 1 0 1 1 1 0 0
S EN R
Q'
11
S R 0 0 1 1 0 1 0 1
12
JK latch
The JK latch is an SR latch that is made to toggle its output when passed the restricted combination of 11
JK latch J K Qnext Comment No change Reset Set Toggle
0 0 Q 0 1 0 1 0 1 1 1 Q
Gated D Latch
Make R input equal to S' gated D latch. D latch eliminates the undesirable condition
of invalid state in the S-R latch.
D EN Q' Q
D EN
Q
Q'
Gated D Latch
14
Gated D Latch
When EN is HIGH,
D=HIGH latch is SET D=LOW latch is RESET
Gated D Latch
15
circuits. When the enable signal is active, the excitation inputs are gated directly to the output Q. Thus, any change in the excitation input immediately causes a change in the latch output. The problem is solved by using a special timing control signal called a clock to restrict the times at which the states of the memory elements may change. This leads us to the edge-triggered memory elements called flip-flops.
Gated D Latch 16
Edge-Triggered Flip-flops
Flip-flops: synchronous bistable devices Output changes state at a specified point on a
triggering input called the clock. Change state either at the positive edge (rising edge) or at the negative edge (falling edge) of the clock signal.
Clock signal
Positive edges Negative edges
Edge-Triggered Flip-flops
17
Edge-Triggered Flip-flops
S-R, D and J-K edge-triggered flip-flops. Note
the > symbol at the clock input.
S C R Q Q' D C Q Q' J C K Q Q'
Q'
Q'
Q'
Edge-Triggered Flip-flops
18
S-R Flip-flop
S-R flip-flop: on the triggering edge of the clock
pulse,
S=HIGH (and R=LOW) a SET state R=HIGH (and S=LOW) a RESET state both inputs LOW a no change both inputs HIGH a invalid
S-R Flip-flop
It comprises 3 parts:
a basic NAND latch a pulse-steering circuit a pulse transition detector (or edge detector) circuit
SR Flip-flop
20
S-R Flip-flop
The pulse transition detector.
S CLK Pulse transitio n detector R
Q
Q'
CLK'
CLK*
CLK'
CLK*
D Flip-flop
D flip-flop: single input D (data)
D=HIGH a SET state D=LOW a RESET state
Q follows D at the clock edge. Convert S-R flip-flop into a D flip-flop: add an inverter.
D CLK S C R Q Q'
D 1 0 CLK Q(t+1) 1 0 Comments Set Reset
D Flip-flop
22
D Flip-flop
Application: Parallel data transfer.
To transfer logic-circuit outputs X, Y, Z to flipflops Q1, Q2 and Q3 for storage.
D X
Combinational logic circuit
Q Q' Q Q'
CLK D CLK
Q1 = X*
Y Z
Q2 = Y*
D
Transfer CLK
Q3 = Z*
J-K Flip-flop
J-K flip-flop: Q and Q' are fed back to the pulsesteering NAND gates. No invalid state. Include a toggle state.
J=HIGH (and K=LOW) a SET state K=HIGH (and J=LOW) a RESET state both inputs LOW a no change both inputs HIGH a toggle
J-K Flip-Ffop
24
J-K Flip-flop
J-K flip-flop.
J CLK K Pulse transition detector Q Q'
Characteristic table.
Q J K 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 Q(t+1) 0 0 1 1 1 0 1 0
25
J 0 0 1 1
K 0 1 0 1
CLK
0 0 0 0 1 1 1 1
T Flip-flop
T flip-flop: single-input version of the J-K flip flop,
formed by tying both inputs together.
T CLK Pulse transition detector Q
CLK T J C K Q Q'
Q'
Characteristic table.
T 0 1 CLK Q(t+1) Q(t) Q(t)' Comments No change Toggle
Q T 0 0 1 1 0 1 0 1 Q(t+1) 0 1 1 0
T Flip-flop
Application: Frequency division.
High J CLK C K CLK Q CLK QA QB
Divide clock frequency by 2. Divide clock frequency by 4.
High Q CLK J C K QA
High J C K QB
T Flip-flop
27
Asynchronous Inputs
S-R, D and J-K inputs are synchronous inputs, as
data on these inputs are transferred to the flipflops output only on the triggered edge of the clock pulse. Asynchronous inputs affect the state of the flip-flop independent of the clock; example: preset (PRE) and clear (CLR) [or direct set (SD) and direct reset (RD)] When PRE=HIGH, Q is immediately set to HIGH. When CLR=HIGH, Q is immediately cleared to LOW. Flip-flop in normal operation mode when both PRE and CLR are LOW.
Asynchronous Inputs
28
Asynchronous Inputs
A J-K flip-flop with active-LOW preset and clear
inputs.PRE
J C K
PRE J
Q
CLK
Q'
K
CLR
Q'
CLR CLK
PRE
J = K = HIGH CLR Q
Preset
Asynchronous Inputs
Toggle
Clear
29
SR Master-Slave Flip-Flop
Read input at first half of clock cycle Output only changed at second half of clock cycle The value that is produced at the output is the response of the value that is stored in the master stage immediately before negative edge occurred.
S C Master S C Y Slave S C Q
Y
R R
Shift Registers
Registers 1.33
Computer and Data Communications Serial and Parallel Communications Multi-bit number storage Sequencing Basic arithmetic such as scaling (a serial shift to the left or right will change the value of a binary number a power of 2) Logical operations
Registers 1.34
Parallel communications: provides a binary number as binary digits through multiple data lines at the same time.
Registers 1.35
Shift Registers
Shift Registers are devices that store and move data bits in serial (to the left or the right),
..or in parallel,
Registers 1.36
Configuration
In Shift Registers, the binary digit transfers (shifts) from the output of one flip-flop to the input of the next individual Flip-Flop at every clock edge. Once the binary digits are shifted in, the individual Flip-Flops will each retain a bit, and the whole configuration will retain a binary number.
Registers 1.37
Construction
Shift registers are constructed from flip-flops due to their characteristics:
Edge-triggered devices Output state retention
Each binary digit transfer operation requires a clock edge. Asynchronous inputs are useful in resetting the whole configuration.
Registers 1.38
Registers 1.39
10110
10110
10110 10110
D Q Q
D Q Q
D Q Q
Output
Registers 1.41
Input
D Q Q
D Q Q
D Q Q
Registers 1.42
D Q Q
D Q Q
D Q Q
Registers 1.43
Output
Output
Output
Registers 1.45
Registers 1.46
JK Shift Registers
J-K Shift registers are seldom used, as two inputs (J,K) are required to load the first flip-flop (note all others receive only set or reset inputs).
Input
Output
Input
Registers 1.48
Ring Counter
A ring counter takes the serial output of the last Flip-Flop of a shift register and provides it to the serial input of the first Flip-Flop.
Registers 1.49
Ring Counter
with initial register values of 100, the repeating pattern is: 100, 010, 001, 100... .
Registers 1.50
Registers 1.51
Johnson Counter
A Johnson Counter re-circulates the last flip-flop Q (inverted) output back to the input of the first Flip-Flop. It doesnt require an initialization value, and will provide a predictable output state sequence.
Registers 1.52
Re-Circulating Counters
A 4-bit Johnson counter has a modulus of 8, meaning there are 8 unique output states.
Johnson Counter 0000 1000 1100 1110 8 unique states 1111 0111 0011 0001
Registers 1.53
State Diagram
A State Diagram is used to describe the sequence of output states of a circuit. The state diagram for the previous Johnson counter looks like this:
1000
0000 0001 0011 0111
Registers 1.54
State Recognition
One application of registers is to recognize a specific binary number. Sequences of bits are loaded in series into a register. External detection gates will identify if the value matches a predetermined value:
55
Registers 1.55
Delay Line
A SISO shift register may be used to introduce delay del t in digital signals del t = N x (1/fc) N= number of stages Fc = clock frequency
D Q Q D Q Q
Output
Input
D Q Q
Introduction: Counters
Counters are circuits that cycle through a specified
number of states.
Introduction: Counters
58
Q0 Q0
J C K FF1
Q1
FF1
CLK Q0 Q1 Q2 0 0 0
1 1 0 0
2 0 1 0
3 1 1 0
4 0 0 1
5 1 0 1
6 0 1 1
7 1 1 1
8 0 0 0 Recycles back to 0
62
clocked) binary counter. If the accumulated delay is greater than the clock pulse, some counter states may be misrepresented!
CLK Q0 Q1 Q2 tPLH (CLK to Q0) 1 2 3 4
63
Q1
Q2 Q3
64
sequence. Technique: force counter to recycle before going through all of the states in the binary sequence. Example: Given the following circuit, determine the counting sequence (and hence the modulus no.)
C All J, K inputs are 1 (HIGH).
Q CLK Q CLR K Q J
Q CLK CLR
J K
Q CLK Q CLR
J K
B C
Asynchronous Counters with MOD number < 2^n 65
Q CLK CLR
J K
Q CLK Q CLR
J K
10 11 12
MOD-6 counter produced by clearing (a MOD-8 binary counter) when count of six (110) occurs.
1 0 0
0 1 1 1 0 0
0 0 1
1 0 1
0 1 0 0 0 0
Temporary state
67
Q Q
J K
Q Q
J K
Q Q
J K
Q Q
J K
Q Q
J K
CLR
CLR
CLR
CLR
CLR
CLR
C D E F
All J = K = 1.
68
with 10 states (modulus-10) in their sequence. They are commonly used in daily life (e.g.: utility meters, odometers, etc.). Design an asynchronous decade counter.
(A.C)' HIGH J CLK C K CLR Q D C B A
J C K CLR
J C K CLR
J C K CLR
69
J C K
J C K
(A.C)'
CLR
CLR
CLR
CLR
1
0 1
2
0
3
1
4
0
5
1
6
0
7
1
8
0
9
1
10
0 0 0 0
11
0
0 0
0
0 0
1
0 0
1
0 0
0
1 0
0
1 0
1
1 0
1
1 0
0
0 1
0
0 1
70
Q0
Q1
Q2
C Q' K 1 J Q Q0
C K Q'
C K Q'
Q1
Q2
CLK
C Q' K
C K Q'
C K Q'
71
111
110
100
CLK Q0 Q1 Q2 0 0 0 1 1 1 1 2 0 1 1 3 1 0 1 4 0 0 1 5 1 1 0 6 0 1 0 7 1 0 0 8 0 0 0
C Q' K
C K Q'
C Q' K
C K Q'
C K Q'
Modulus-4 counter
Modulus-8 counter
73
Count pulse
CTENDecade TC counter C Q3 Q2 Q1 Q0
freq/10
CTENDecade TC counter C Q3 Q2 Q 1 Q0
freq/10 0
75
clocked at the same time by a common clock pulse. We can design these counters using the sequential logic design process. Example: 2-bit synchronous binary counter (using T flip-flops, or JK flip-flops with identical J,K inputs).
Present state Next state Flip-flop inputs
00 11
01 10
A1 A0 0 0 0 1 1 0 1 1
A1+ A0+ 0 1 1 0 1 1 0 0
TA1 TA0 0 1 1 1 0 1 1 1
76
A1 A0 0 0 0 1 1 0 1 1
A1+ A0+ 0 1 1 0 1 1 0 0
1
TA1 TA0 0 1 1 1 0 1 1 1
TA1 = A0 TA0 = 1
A0
A1
C Q' K CLK
C K Q'
77
A2+ 0 0 0 1 1 1 1 0
A1
1 1 1 1
A2 A0
A2
A2
A0
A0
TA2 = A1.A0
TA1 = A0
Synchronous (Parallel) Counters
TA0 = 1
78
TA1 = A0 TA0 = 1
A1
Q K J
A0
Q K
CP 1
79
80
A2.A1.A0
J Q A3
C Q' K CLK
C K Q'
C K Q'
C K Q'
81
82
Q3
83
84
CLK
86
000
100
001
101
111 110 010
011
Q2+ 0 0 1 0 0 1 1 1
Q0+ 1 1 0 0 0 0 1 1
JQ2 KQ2 0 X 0 X 1 X 0 X X 1 X 0 X 0 X 0
Q2
Q 1Q 0
00 01 11 10 0 1 X X 1 X X
Q2
Q 1Q 0
00 01 11 10 0 1 X X 1 X X 1
JQ2 = Q1.Q0'
JQ1 = Q2'.Q0
Q2
Q 1Q 0
00 01 11 10 0 X X X X
Q2
Q 1Q 0
00 01 11 10 0 X X
Q2
Q 1Q 0
00 01 11 10 0 X 1 X
1 1
1 X
1 X
KQ2 = Q1'.Q0'
KQ1 = Q2.Q0
J C
Q0
J C
Q1 Q1'
J C
Q2 Q2'
K Q'
K Q'
89
Decoding A Counter
which state in the sequence the counter is in. Differentiate between active-HIGH and activeLOW decoding. Active-HIGH decoding: output HIGH if the counter is in the state concerned. Active-LOW decoding: output LOW if the counter is in the state concerned.
Decoding A Counter
90
Decoding A Counter
Example: MOD-8 ripple counter (active-HIGH
decoding).
Clock A' B' C' A' B' C A' B C' A B C
Decoding A Counter
10
. . .
91
Decoding A Counter
Example: To detect that a MOD-8 counter is in
state 0 (000) or state 1 (001).
Clock A' B'
0 1 2 3 4 5 6 7
A' B' C' A' B' C
10
Decoding A Counter
92
increment/decrement functionality.
93
Load I4 I3 I2 I1 0 0 1 1