Module 7 Latches and Flip-Flops (Student)
Module 7 Latches and Flip-Flops (Student)
LATCH
• S-R Latch
• Gated S-R Latch
• Gated D Latch
FLIP-FLOPS
• Edge-Triggered D Flip-Flop
• S-R Flip-Flop
• J-K Flip-Flop
• T Flip-Flop
1
FACULTY OF COMPUTER SCIENCE & INFORMATION SYSTEM 2
3 4
5 6
2012/2013-I @m 1
11/1/12
Latch Flip-Flop
• Latch is a type of temporary storage device LOW HIGH • Flip-flop (FF) are synchronous bi-stable storage devices
capable of storing one bit, where the output state only
• It has two stable states (bi-stable). changes at a specified point on a triggering input called the
INFO :
Clock (C).
A bi-stable
state is one • So FF are edge-triggered, means that the output changes
with two-stable are synchronized with the Clock signal.
• Latch is level sensitive, or level-triggered.
output states.
– are dependent on the voltage level • This may either be a LOW-to-HIGH (rising edge) or a HIGH-to-
applied , not on any signal transition. LOW (falling edge) transition.
• Type of Flip-Flop:
• Type of Latch : S à Set INFO :
i) D Rising edge = positive edge
i) S-R
R à Reset ii) S-R Falling edge = negative edge
ii) Gated S-R
D à Data iii) J-K
iii) Gated D J K à Two control inputs
iv) T
7 8
Difference:
Latch vs Flip-Flop
Latch Set
Reset
• Set is HIGH, Reset is LOW à Q will be HIGH • Set à means that Q output is HIGH
• Set is LOW, Reset is HIGH à Q will be LOW • Reset à means that Q output is LOW
Flip-flop Set
Reset
Clock
Jam
9 10
S-R Latch
Latches
i) S-R
ii) Gated S-R
iii) Gated D
11 12
2012/2013-I @m 2
11/1/12
Explanation :
§ The Q and not-Q outputs are supposed to be in opposite states.
§ Q=1 and not-Q=0 is defined as Set (by making S=1 and R=0)
§ Q=0 and not-Q=1 is conversely defined as Reset
(by making S=0 and R=1)
§ When S and R are both equal to 0, the multivibrator's outputs
“Not Change” in their prior states.
§ If Q and not-Q happen to be forced to the same state
(both 0 or both 1), that state is referred to as invalid.
13 14
Explaination:
continue...
15 16
Ex
tr
a Gated S-R Latch
Exercise 7.1: If the S and R waveform in (a) are applied to the • Is a gated latch requires an enable input (EN).
inputs of latch (active-LOW), determine the
waveform that will be observed on the Q output in • The S and R inputs control the state to which the latch
(b). Assume that Q is initially LOW. will go when a HIGH level is applied to the EN input.
• The latch will not change until EN is HIGH, but as long as
it remains HIGH, the output is controlled by the state of
the S and R input.
2012/2013-I @m 3
11/1/12
EN S R Output
0 0 0 No Change
0 0 1 No Change
0 1 0 No Change
S-R Latch
(Active LOW) 0 1 1 No Change
1 0EN 0S R ChangeOutput
No
Y = Z =1 1 00 0/1
1 0/1 Q=0 No Change
Y = (S ⋅ EN ) Z = (R ⋅ EN ) 1 11 00 0 Q=1 No Change
1 11 10 1 Invalid Q=0
1 1 0 Q=1
1 1 1 Invalid
20
19
EN
Q
Resource: Floyd, Digital Fundamentals, 10th Edition 21 22
EN
Q
23 24
2012/2013-I @m 4
11/1/12
Gated D Latch:
Logic diagram & logic symbol
Gated D Latch
Gated D Latch:
Truth Table
EN D Output
0 0 No Change
0 1 No Change
1 0 Q=0
1 1 Q=1
EN=1 Q=D
Solution:
Flip-Flops
i) Edge-Triggered D
ii) S-R
iii) J-K
iv) T (Toggle)
Resource: Floyd, Digital Fundamentals, 10th Edition 29 30
2012/2013-I @m 5
11/1/12
31
EN / CLK
(Positive
edge- Gated
triggered) Latch Q
Flip-flop
Q
(Negative
edge-
triggered)
Level-triggered EN
edge-triggered CLK
Figure : Edge-Triggered FF logic symbol
31 32
S-R Flip-Flop
1 1 ? ? Invalid
33 34
2012/2013-I @m 6
11/1/12
Solution:
Once Q is
determined, Q’
is easily found
since it is simply
the complement
Clock S R Q of Q.
Pulse
1 LOW LOW Does not change
2 LOW HIGH LOW (RESET)
3 HIGH LOW HIGH (SET)
4 LOW HIGH LOW (RESET)
5 HIGH LOW HIGH (SET)
6 HIGH LOW Stay HIGH
Resource: Floyd, Digital Fundamentals, 10th Edition 37 38
D Flip-Flop
D Data or Delay
§ The addition of an inverter to an S-R FF creates basic D FF (for positive edge-triggered)
where a positive edge-triggered type is shown.
J-K Flip-Flop
TRUTH TABLE
§ The JK FF is versatile and is a widely used type
of FF. = clock transition LOW
to HIGH
§ The difference between J-K and S-R: Q0= output level prior to
clock transition
J-K has no invalid state as SR. Positive or
negative
triggered ?
Logic Symbol
41 42
2012/2013-I @m 7
11/1/12
Positive or Positive
Example: J-K Flip-Flop. negative triggered
Find the waveform for Q. triggered?
Assume that Q is initially LOW. Solution:
Positive or negative
Example: J-K Flip-Flop. negative triggered
Find the waveform for Q. triggered? Solution:
Assume that Q is initially LOW.
Resource: Floyd, Digital Fundamentals, 10th Edition 45 Resource: Floyd, Digital Fundamentals, 10th Edition 46
T Flip-Flop
Timing
Diagram for
§ Also called as toggle flip flop. T Flip-Flop
(Negative-
§ Frequently used in building counters Edge
Trigger)
T J T
Logic Symbol
47 48
2012/2013-I @m 8
11/1/12
Priority FF Input
Highest PRE, CLR (Asynchronous input)
Medium Clock
Lowest S-R, J-K, D, T (Synchronous input)
49 50
HIGH
clk
pulse
PRE CLR J K FF Comment
4,5,6,
1 1 1 1 Toggle Synchronous mode.
7
8,9 1
1 0 1 1 RESET JK inputs - dont care
51 52
HIGH
Positive or Positive
Exercise 7.3: PRE and CLR negative triggered
triggered?
Find the waveform for Q.
Assume that Q is initially LOW.
Solution:
53 54
53 54
2012/2013-I @m 9
11/1/12
Ex Extra notes :
tr
a Master Slave Flip Flops (JK Example)
Positive or
Exercise 7.4: PRE and CLR negative
Find the waveform for Q. triggered?
Assume that Q is initially HIGH.
57 58
59
2012/2013-I @m 10