CH5 Latch and Flip Flop 1
CH5 Latch and Flip Flop 1
Easy to build
R 0 0
Q
S Q
0 1
Initial Value
LATCHES
S R Q0 Q Q’
SR Latch 0 0 0 0 1 Q = Q0
0 0 1 1 0 Q = Q0
R 0 1
Q
S Q
0 0
LATCHES
S R Q0 Q Q’
SR Latch 0 0 0 0 1
Q = Q0
0 0 1 1 0
0 1 0 0 1 Q=0
R 1 0
Q
S Q
0 1
LATCHES
S R Q0 Q Q’
SR Latch 0 0 0 0 1
Q = Q0
0 0 1 1 0
0 1 0 0 1 Q=0
R 1 1
Q
0 1 1 0 1 Q=0
S Q
0 0
LATCHES
S R Q0 Q Q’
SR Latch 0 0 0 0 1
Q = Q0
0 0 1 1 0
0 1 0 0 1
R 0
Q=0
0 0 1 1 0 1
Q 1 0 0 1 0 Q=1
S Q
1 1
LATCHES
S R Q0 Q Q’
SR Latch 0 0 0 0 1
Q = Q0
0 0 1 1 0
0 1 0 0 1
R 0
Q=0
1 0 1 1 0 1
Q 1 0 0 1 0 Q=1
1 0 1 1 0 Q=1
S Q
1 0
LATCHES
S R Q0 Q Q’
SR Latch 0 0 0 0 1
Q = Q0
0 0 1 1 0
0 1 0 0 1
R 1
Q=0
0 0 1 1 0 1
Q 1 0 0 1 0
Q=1
1 0 1 1 0
1 1 0 0 0 Q = Q’
S Q
1 10
LATCHES
S R Q0 Q Q’
SR Latch 0 0 0 0 1
Q = Q0
0 0 1 1 0
0 1 0 0 1
R 1
Q=0
10 0 1 1 0 1
Q 1 0 0 1 0
Q=1
1 0 1 1 0
1 1 0 0 0 Q = Q’
1 1 1 0 0 Q = Q’
S Q
1 0
SR LATCH
S R Q
R Q Q0 No change
0 0
0 1 0 Reset
1 0 1 Set
S Q 1 1 Q=Q’=0 Invalid
S S R Q
Q
0 0 Q=Q’=1 Invalid
0 1 1 Set
1 0 0 Reset
R Q
1 1 Q0 No change
SR LATCH
S R Q
R Q Q0 No change
0 0
0 1 0 Reset
1 0 1 Set
S Q 1 1 Q=Q’=0 Invalid
S S’ R’ Q
Q Invalid
0 0 Q=Q’=1
0 1 1 Set
Q 1 0 0 Reset
R Q0 No change
1 1
CONTROLLED LATCHES
SR Latch with Control Input
R R S S
Q Q
C C
S Q R Q
S R
C S R Q
0 x x Q0 No change
1 0 0 Q0 No change
1 0 1 0 Reset
1 1 0 1 Set
1 1 1 Q=Q’ Invalid
CONTROLLED LATCHES
Timing Diagram
D Latch (D = Data)
C
D S
Q
D
C
R Q Q
t
C D Q
Output may
0 x Q0 No change
change
1 0 0 Reset
1 1 1 Set
CONTROLLED LATCHES
Timing Diagram
D Latch (D = Data)
D S C
Q
C D
R Q
Q
C D Q Output may
0 x Q0 No change change
1 0 0 Reset
1 1 1 Set
GRAPHIC SYMBOLS FOR LATCHES
LEVEL VERSUS EDGE SENSITIVITY
Since the output of the D latch is controlled by the
level (0 or 1) of the clock input, the latch is said to
be level sensitive
All of the latches we have seen have been level
sensitive
D D Q D Q Q
D Latch D Latch
(Master) (Slave)
C C
Master Slave
CLK CLK
D
Looks like it is negative
edge-triggered QMaster
QSlave
FLIP-FLOPS
The circuit samples the D input and changes its
output at the negative edge of the clock, CLK.
When the clock is 0, the output of the inverter is 1.
The slave latch is enabled and its output Q is equal
to the master output Y. The master latch is
disabled (CLK = 0).
When the CLK changes to high, D input is
transferred to the master latch. The slave remains
disabled as long as CLK is low. Any change in the
input changes Y,but not Q.
The output of the flip-flop can change when CLK
makes a transition 1 → 0
FLIP-FLOPS
Edge-Triggered D Flip-Flop
D Q
Q
Q
CLK Positive Edge
Q
D Q
D
Q
Negative Edge
FLIP-FLOPS:
EDGE-TRIGGERED D FLIP-FLOP
FLIP-FLOPS
D
Hold time is the minimum
time for the data to remain CLK
after the clock.
Hold time, tH
JK FLIP-FLOPS
J
D Q Q
K
CLK Q Q
J Q
D = JQ’ + K’Q
K Q
T FLIP-FLOPS
T Flip-Flop
T J Q T D Q
Q
K Q
T Q
D = JQ’ + K’Q
D = TQ’ + T’Q = T Q Q
FLIP-FLOP CHARACTERISTIC TABLES
D Q D Q(t+1)
0 0 Reset
Q 1 1 Set
J K Q(t+1)
J Q 0 0 Q(t) No change
0 1 0 Reset
K Q 1 0 1 Set
1 1 Q’(t) Toggle
T Q T Q(t+1)
0 Q(t) No change
Q 1 Q’(t) Toggle
FLIP-FLOP CHARACTERISTIC EQUATIONS
D Q D Q(t+1)
0 0 Q(t+1) = D
Q 1 1
J K Q(t+1)
J Q 0 0 Q(t)
0 1 0 Q(t+1) = JQ’ + K’Q
K Q 1 0 1
1 1 Q’(t)
T Q T Q(t+1)
0 Q(t) Q(t+1) = T Q
Q 1 Q’(t)
FLIP-FLOPS WITH ASYNCHRONOUS/DIRECT
INPUTS
Asynchronous Reset
D Q R’ D CLK Q(t+1)
0 x x 0
Q 1 0 ↑ 0
R 1 1 ↑ 1
Reset
FLIP-FLOPS WITH DIRECT INPUTS
Asynchronous Reset
FLIP-FLOPS WITH DIRECT INPUTS
Asynchronous Preset and Clear
Preset
Example
x
AB=00 D Q A
D Q B
CLK Q
y
ANALYSIS OF CLOCKED SEQUENTIAL
CIRCUITS: TERMINOLOGY
State Equation: A state equation (transition
equation) specifies the next state as a function of
the present state and inputs.
State Table: A state table (transition table)
consists of: present state, input, next state and
output.
State Diagram: The information in a state table
can be represented graphically in a state diagram.
The state is represented by a circle and the
transitions between states are indicated by
directed lines connecting the circles.
ANALYSIS OF CLOCKED SEQUENTIAL
CIRCUITS: STATE/TRANSITION EQUATIONS
x
A(t+1) = DA D Q A
= A’ x CLK Q
y(t) = [A(t)+ B(t)] x’(t)
= (A + B) x’ y
ANALYSIS OF CLOCKED SEQUENTIAL
CIRCUITS: STATE /TRANSITION TABLE
x
Present Next D Q A
Input Output
State State
Q
A B x A B y
0 0 0 0 0 0
D Q B
0 0 1 0 1 0
0 1 0 0 0 1 CLK Q
0 1 1 1 1 0 y
1 0 0 0 0 1
1 0 1 1 0 0
1 1 0 0 0 1 A(t+1) = A x + B x
1 1 1 1 0 0 B(t+1) = A’ x
y(t) = (A + B) x’
t t+1 t
ANALYSIS OF CLOCKED SEQUENTIAL
CIRCUITS: STATE/TRANSITION TABLE
x
Present Next State Output D Q A
t t+1 t A(t+1) = A x + B x
B(t+1) = A’ x
y(t) = (A + B) x’
ANALYSIS OF CLOCKED SEQUENTIAL
CIRCUITS: STATE DIAGRAM
Present Next State Output
State x=0 x=1 x=0 x=1
AB input/output A B A B A B y y
0 0 0 0 0 1 0 0
0 1 0 0 1 1 1 0
0/0 1/0
1 0 0 0 1 0 1 0
0/1 1 1 0 0 1 0 1 0
00 10
x
D Q A
0/1 Q
1/0 0/1 1/0
D Q B
CLK Q
01 11
y
1/0 46
ANALYSIS OF CLOCKED SEQUENTIAL
CIRCUITS: D FLIP-FLOPS
Example:
x D Q A
Present Next y
Input
State State CLK Q
A x y A
0 0 0 0
0 0 1 1 A(t+1) = DA = A x y
0 1 0 1
0 1 1 0
1 0 0 1 01,10
1 0 1 0
00,11 0 1 00,11
1 1 0 0
1 1 1 1 01,10
ANALYSIS OF CLOCKED SEQUENTIAL
CIRCUITS: JK FLIP-FLOPS
J Q A
Example: x K Q
Example: x K Q
0 0 0 0 1 0 0 1 0 CLK
0 0 1 0 0 0 0 0 1 1 0 1
0 1 0 1 1 1 1 1 0 00 11
0 1 1 1 0 1 0 0 1
0
1 0 0 1 1 0 0 1 1 0 0
1 0 1 1 0 0 0 0 0
1 1 0 0 0 1 1 1 1 01 10
1 1 1 1 1 1 0 0 0 1
1
ANALYSIS OF CLOCKED SEQUENTIAL
CIRCUITS: T FLIP-FLOPS x T Q
A
y
Example: R Q
Example: R Q
1 0 0 1 0 0 0 0
1 0 1 1 1 0 1 0 1 1
1 1 0 1 1 0 0 1 1 1/1 1 0/0
1 1 1 0 0 1 1 1 0 0
1
MEALY AND MOORE MODELS
The Mealy model: the outputs are functions of both
the present state and inputs
The outputs may change if the inputs change
during the clock pulse period.
The outputs may have momentary false values
unless the inputs are synchronized with the
clocks.
The Moore model: the outputs are functions of the
present state only
The outputs are synchronous with the clocks.
MEALY AND MOORE MODELS
State / Output
0 0
1
00/0 01/0
1 1
11/1 10/0
1
0 0
STATE REDUCTION
Sequential circuit analysis
Circuit diagram state table (or state diagram)
Sequential circuit design
State: a a b c d e f f g f g a
Input: 0 1 0 1 0 1 1 0 1 0 0
State diagram
STATE REDUCTION
Equivalent states
Two states are said to be equivalent
For each member of the set of inputs, they
State: a a b c d e d d e d e a
Input: 0 1 0 1 0 1 1 0 1 0 0
Output: 0 0 0 0 0 1 1 0 1 0 0
STATE REDUCTION: IMPLICATION TABLE
The state-reduction procedure for completely
specified state tables is based on the algorithm
that two states in a state table can be combined
into one if they can be shown to be equivalent.
There are occasions when a pair of states do not
have the same next states, but, nonetheless, go to
equivalent next states
(a, b) imply (c, d) and (c, d) imply (a, b). Both pairs
of states are equivalent; i.e., a and b are equivalent
as well as c and d.
63
STATE REDUCTION:IMPLICATION TABLE
STATE REDUCTION: IMPLICATION TABLE
Finally, all the squares that have no crosses are
recorded with check marks. The equivalent states
are: (a, b), (d, e), (d, g), (e, g).
DA = A x + B x D Q A
x
DB = A x + B’ x
y =AB Q
y
D Q B
CLK Q
FLIP-FLOP EXCITATION TABLES
Present Next F.F. Present Next F.F.
State State Input State State Input
Q(t) Q(t+1) D Q(t) Q(t+1) J K 0 0 (No change)
0 1 (Reset)
0 0 0 0 0 0 x 1 0 (Set)
0 1 1 0 1 1 x 1 1 (Toggle)
0 1 (Reset)
1 0 0 1 0 x 1 1 1 (Toggle)
1 1 1 1 1 x 0 0 0 (No change)
1 0 (Set)
Q(t) Q(t+1) T
0 0 0
0 1 1
1 0 1
1 1 0
DESIGN OF CLOCKED SEQUENTIAL
CIRCUITS WITH JK F.F.
Example:
Detect 3 or more consecutive 1’s
Present Next Flip-Flop
Input
State State Inputs
Synthesis using JK F.F.
A B x A B JA KA JB KB
0 0 0 0 0 0 x 0 x JA (A, B, x) = ∑ (3)
0 0 1 0 1 0 x 1 x dJA (A, B, x) = ∑ (4,5,6,7)
0 1 0 0 0 0 x x 1 KA (A, B, x) = ∑ (4, 6)
0 1 1 1 0 1 x x 1 dKA (A, B, x) = ∑ (0,1,2,3)
0 x JB (A, B, x) = ∑ (1, 5)
1 0 0 0 0 x 1
dJB (A, B, x) = ∑ (2,3,6,7)
1 0 1 1 1 x 0 1 x
KB (A, B, x) = ∑ (2, 3, 6)
1 1 0 0 0 x 1 x 1
dKB (A, B, x) = ∑ (0,1,4,5)
1 1 1 1 1 x 0 x 0
DESIGN OF CLOCKED SEQUENTIAL
CIRCUITS WITH JK F.F.
Example:
Detect 3 or more consecutive 1’s
Synthesis using JK Flip-Flops
B B
JA = B x KA = x’ 0 0 1 0 x x x x
JB = x KB = A’ + x’ A x x x x A 1 0 0 1
x x
J Q A
B B
x K Q y 0 1 x x x x 1 1
A 0 1 x x A x x 0 1
J Q B x x
K Q
CLK
DESIGN OF CLOCKED SEQUENTIAL
CIRCUITS WITH T F.F.
Example:
Detect 3 or more consecutive 1’s
Present Next F.F.
Input
State State Input
Synthesis using T Flip-Flops
A B x A B TA TB
0 0 0 0 0 0 0 TA (A, B, x) = ∑ (3, 4, 6)
0 0 1 0 1 0 1 TB (A, B, x) = ∑ (1, 2, 3, 5, 6)
0 1 0 0 0 0 1
0 1 1 1 0 1 1
1 0 0 0 0 1 0
1 0 1 1 1 0 1
1 1 0 0 0 1 1
1 1 1 1 1 0 0
DESIGN OF CLOCKED SEQUENTIAL
CIRCUITS WITH T F.F.
Example:
Detect 3 or more consecutive 1’s
Synthesis using T Flip-Flops
TA = A x’ + A’ B x A
T Q
TB = A’ B + B x x
Q y
B B
T Q B
0 0 1 0 0 1 1 1
Q
A 1 0 0 1 A 0 1 0 1
x x
CLK
DESIGN OF CLOCKED SEQUENTIAL
CIRCUITS WITH T F.F.
Example:
3-bit binary counter
DESIGN OF CLOCKED SEQUENTIAL
CIRCUITS WITH T F.F.
DESIGN OF CLOCKED SEQUENTIAL
CIRCUITS WITH D F.F.
Design a one-input, one-output serial 2's
complementer. The circuit accepts a string of bits
from the input and generates the 2's complement
at the output. The circuit can be reset
asynchronously to start and end the operation.
DESIGN OF CLOCKED SEQUENTIAL
CIRCUITS WITH D F.F.
DESIGN OF CLOCKED SEQUENTIAL
CIRCUITS WITH D F.F.
SYLLABUS
Chapter 5 (Excluding Section 5.6)