Logic Design - EEE205: Dr. Hassan Sharabaty
Logic Design - EEE205: Dr. Hassan Sharabaty
CH 7
Latches & Flip-Flops
BY
Dr. Hassan
SHARABATY
Ankara – November 2017 1
Latches
A latch is a temporary storage device that has two stable states (bistable).
It is a basic form of memory.
The S-R (Set-Reset) latch is the most basic type.
Using NOR gates, the latch responds to active-HIGH inputs;
Using NAND gates, it responds to active-LOW inputs.
0 S
0 0R Q 0 1 0 Q
Latch
Q 1 0 1 Q
0 0 0 S R
Active-HIGH input Latch (NOR) Active-LOW input Latch (NAND)
2
Latches
The active-HIGH S-R latch will be in a stable condition (latched)
when both inputs are LOW.
Assume the latch is initially RESET (Q = 0)
0 R
10 Q
and the inputs are at their inactive level
Latch
(0). initially
To SET the latch (Q = 1), a brief HIGH
signal is applied to the S input while the R 10 RESET
Q
0 S
remains LOW.
To RESET the latch (Q = 0), a brief 0 R
10
Q
HIGH signal is applied to the R input
Latch
while the S remains LOW. initially
10 SET
Q
0 S
Latches
The active-LOW S-R latch is in a stable (latched) condition
4
Latches
Latches
6
Latches
Solution
8
The following waveforms are applied to an
active-HIGH input S-R latch.
- Draw the output waveform Q.
- Assume that Q starts LOW.
10
Gated Latches
Gated Latches
S
R
EN
When S is HIGH and R is LOW, a HIGH on the EN input sets the latch.
When S is LOW and R is HIGH, a HIGH on the EN input resets the latch.
When both S and R are LOW, the Q output does not change from its present state.
12
The following waveforms are applied to a
gated S-R latch. Determine the outputs
Q & Q, assuming that Q start in LOW.
13
14
The following waveforms are applied to a
gated S-R latch. Determine the outputs Q &
Q, assuming that Q start in LOW.
15
The D Latch
The truth table for the D latch summarizes its operation. Note:
17
The D Latch
D Q
EN
Determine the output Q for the given
Q
the inputs shown.
18
D Q
19
Flip-flops
Dynamic input
indicator
20
Flip-flops
21
Any change in R or S after the triggering edge of the clock has no effect
on the output
23
24
The Edge-Triggered D Flip-Flop
25
26
Draw the Q output relative to the clock for a D flip-flop.
Assume positive edge-triggering and Q initially
LOW.
27
28
The Edge-Triggered J-K Flip-Flop
J = K = 1,
output state
will be
inversed upon
the active
clock edge .
The truth table for a negative edge-triggered J-K
flip-flop is the same, except that the triggering
edge is the falling edge of the clock pulse.
29
31
CLK
Q 32
J Q
33
34
Asynchronous Preset and Clear Inputs
data on these inputs are transferred to output only on active edge of the
clock pulse.
Most flip-flops have other inputs that affect the output regardless of
the clock (not synchronized). PRE
35
PRE
Asynchronous Preset and Clear Inputs
Most flip-flops have other inputs that affect the J Q
Set
PRE
K Reset
CLR
Q
36
determine the output Q if it is initially LOW.
37
38
Ideal pulse
Flip-flop Characteristics
CLK
CLK
The typical propagation delay time for the 74AHC family (CMOS) is 4 ns.
39
Flip-flop Characteristics
Another propagation delay time specification is the time required
Set-up time and hold time are times required before and after
the clock transition that data must be present to be reliably clocked
into the flip-flop.
D
Setup time t s is the minimum
time for the data to be CLK
present
before the clock Set-up time, ts
transition.
Hold time tH is the minimum D
Hold time, tH
41
Flip-flop Characteristics
42
Flip-flop Applications
43
Flip-flop Applications
HIGH HIGH
Frequency division
To divide the frequency, we use a J QA J QB
fout
series of flip-flops (connected in CLK CLK
fin
toggle mode), so that each flip-flop
K K
divide the input frequency by two.
fin
One flip-flop will divide fin
QA
by 2, two flip-flops will
44
Flip-flop Applications
Example
Determine the fout waveform,
if an fin = 8 kHz square wave
is applied to the clock input
of flip-flop A.
Solution: 8 kHz
4 kHz
2 kHz
1 kHz
45
Flip-flop Applications
Counters
Both flip-flops should be
initially RESET.
Flip-flop A will be toggled on
the negative-going transition of
each clock pulse.
The Q output of flip-flop A
clocks flip-flop B, so each time
QA makes a HIGH-to-LOW
transition, flip-flop B toggles.
46
Flip-flop Applications
Example
Determine the output
waveforms for QA, QB, and
QC and show the binary
sequence represented by
these waveforms.
Solution:
The outputs go through the
binary sequence 000, 001,
010, 011, 100, 101, 110,
and 111 as indicated.
47
J-K flip-flop A type of flip-flop that can operate in the SET, RESET, no-
change, and toggle modes.
48
Selected Key Terms
Hold time The time interval required for the input levels to remain
steady to a flip-flop after the triggering edge in order to
reliably activate the device.
49
50
2. The D flip-flop shown will
a. set the output on the next clock pulse
b. reset the output on the next clock pulse
c. latch previous output on the next clock pulse
d. toggle the output on the next clock pulse
D Q
CLK CLK
51
For the inputs shown, on which clock pulse, will the output go from
HIGH to LOW?
a. 1 CLK
b. 2
K
1 2 3 4
c. 3
d. 4
52
4. The application illustrated is a
a. Timer. HIGH HIGH
53
Output
5. The application illustrated is a lines
D Q0
a. Timer. C
D Q1
c. frequency multiplier C
d. frequency divider D Q2
C
Parallel data
input lines R
D Q3
Clock C
R
Clear
54
6. For the J-K flip-flop shown, the number of inputs that
are asynchronous is
PRE
a. 1
b. 2 J Q
c. 3 CLK
d. 4 K Q
CLR
55
b. tPLH CLK
c. set-up time
Q 50% point on LOW-to-
HIGH transition of Q
d. hold time ?
56
8. The time interval illustrated is called
a. tPHL
b. tPLH D
d. hold time ?
57
Answers:
1. 6. b
b
2. 7. b
d
3. c 8. d
4. d
5.
b
58
59