Professional Documents
Culture Documents
Latches and
Flip-Flops:
SR, D, JK, T
Module 4
Amacdalino2020
AMACDALINO2020
LATCHES AND FLIP-FLOPS: SR, D, JK, T
Table of Contents
LATCHES AND FLIP-FLOPS: SR, D, JK, T ........................................................................................................ 1
Introduction .......................................................................................................................................... 1
Learning Outcomes ............................................................................................................................... 1
Learning Content .................................................................................................................................. 1
Topic 1: Latches .................................................................................................................................... 2
Definition .......................................................................................................................................... 2
SR Latch ............................................................................................................................................ 2
i. SR Latch using NAND Gate .................................................................................................... 2
ii. SR Latch using NOR Gate ....................................................................................................... 3
Gated S-R Latch ................................................................................................................................. 4
D Latch .............................................................................................................................................. 5
Topic 2: Edge-triggered Latches or Flip-flops ........................................................................................ 5
Definition .......................................................................................................................................... 5
SR Flip-Flop ....................................................................................................................................... 7
D Flip-flop ......................................................................................................................................... 7
JK Flip-flop......................................................................................................................................... 8
Toggle Flip-flop ................................................................................................................................. 8
Flip-Flop Conversion ....................................................................................................................... 10
Example: JK to D flip-flop conversion .......................................................................................... 10
Teaching and Learning Activities ......................................................................................................... 11
Recommended learning materials and resources for supplementary reading ................................... 11
Flexible Teaching Learning Modality (FTLM) adopted ........................................................................ 11
Assessment Task ................................................................................................................................. 11
AMACDALINO2020 i
LATCHES AND FLIP-FLOPS: SR, D, JK, T
Module 4
Introduction
This module presents latches and flip-flops. It discusses what latches and flip-flops are
including their 4 basic types which are SR, D, JK and T. Operations, characteristic table, truth
table and excitation table are also presented including flip-flop conversion. At the end of the
lesson, assessment task will be given to check students’ understanding of the module.
Learning Outcomes
At the end of the lesson, students are expected to:
➢ Explain the operation of S-R and gated D latches.
➢ Explain the operation of D, D-CE, S-R, J-K, and T flip-flops.
➢ Analyze the operation of a flip-flop that is constructed of gates and latches
Learning Content
Topic 1: Latches
o Definition
o SR Latch
▪ SR Latch using NAND Gate
▪ SR Latch using NOR Gate
o Gated S-R Latch
o D Latch
Topic 2: Edge-triggered Latches or Flip-flops
o Definition
o SR Flip-Flop
o D Flip-flop
o JK Flip-flop
o Toggle Flip-flop
o Flip-Flop Conversion
▪ Example: JK to D flip-flop conversion
AMACDALINO2020 1
LATCHES AND FLIP-FLOPS: SR, D, JK, T
Latches Flip-Flops
Building blocks of sequential Building blocks of sequential
circuits and these can be built circuits but these can be built from
from logic gates the latches
Continuously checks its inputs and Continuously checks its inputs and
changes its output changes its output
correspondingly correspondingly only at times
determined by clocking signal
Based on the enable function It works on the basis of clock
input pulses
Level triggered, it means that the Edge triggered, it means that the
output of the present state and output and the next state input
input of the next state depends on changes when there is a change
the level that is binary input 1 or 0 in clock pulse
Asynchronous Synchronous
Topic 1: Latches
Definition
• Operate on signal levels
• Level-sensitive devices
• the basic circuits from which all flip-flops are constructed
• Graphic Symbols for Latches
SR Latch
- can be considered as one of the most basic sequential logic circuit possible.
- This simple circuit is basically a one-bit memory bistable device that has two inputs,
one which will “SET” the device (meaning the output = “1”), and is labelled S and
another which will “RESET” the device (meaning the output = “0”), labelled R.
- has two types:
o SR Latch using NAND Gates
o SR Latch using NOR Gates
AMACDALINO2020 2
LATCHES AND FLIP-FLOPS: SR, D, JK, T
•
S R Q Q’ Description
1 0 0 1 Set Q’ » 1
1 1 0 1 no change
0 1 1 0 Reset Q’ » 0
1 1 1 0 no change
0 0 1 1 Not used
* The condition of S = R = “0” causes both outputs Q and Q’ to be HIGH together at logic level
“1” when we would normally want Q’ to be the inverse of Q. The result is that the flip-flop loses
control of Q and Q’, and if the two inputs are now switched “HIGH” again after this condition
to logic “1”, the flip-flop becomes unstable and switches to an unknown data state.
Suppose that Q=0 and Q’=1. What happens with the circuit if
S is set to 1 and R is set to 0?
What happens if S and R are both set to 1?
What happens if S is set to 0 and R is set to 1?
What happens if S and R are both set to 1?
What happens if S and R are both set to 0?
AMACDALINO2020 3
LATCHES AND FLIP-FLOPS: SR, D, JK, T
S R Q Q’ Description
0 1 0 1 No change
0 0 0 1 Memory
1 0 1 0 No change
0 0 1 0 Memory
1 1 0 0 Not used
0 0 0 1 Not used
When E=0, the outputs of the two AND gates are forced to 0, regardless of the states of
either S or R. Consequently, the circuit behaves as though S and R were both 0, latching
the Q and not-Q outputs in their last states. Only when the enable input is activated (1)
will the latch respond to the S and R inputs.
AMACDALINO2020 4
LATCHES AND FLIP-FLOPS: SR, D, JK, T
D Latch
- Since the enable input on a gated S-R latch provides a way to latch the Q and not-
Q outputs without regard to the status of S or R, we can eliminate one of those
inputs to create a latch circuit with no “illegal” input states. Such a circuit is called
a D latch, and its internal logic looks like this:
Note that the R input has been replaced with the complement (inversion) of the old S
input, and the S input has been renamed to D. As with the gated S-R latch, the D latch
will not respond to a signal input if the enable input is 0—it simply stays latched in its last
state. When the enable input is 1, however, the Q output follows the D input.
Since the R input of the S-R circuitry has been done away with, this latch has no “invalid”
or “illegal” state. Q and not-Q are always opposite of one another.
In the first timing diagram, the outputs respond to input D whenever the enable (E)
input is high, for however long it remains high. When the enable signal falls back to a low state,
the circuit remains latched. In the second timing diagram, we note a distinctly different
response in the circuit output(s): it only responds to the D input during that brief moment of
AMACDALINO2020 5
LATCHES AND FLIP-FLOPS: SR, D, JK, T
time when the enable signal changes, or transitions, from low to high. This is known as positive
edge-triggering.
There is such a thing as negative edge triggering as well, and it produces the following
response to the same input signals:
To further discuss, the D-latch with pulses in its control input is essentially a flip-flop that
is triggered every time the pulse goes to the logic 1 level. The state transions of the latches start
as soon as the clock pulse changes to the logic 1 level. The state of a latch appears at the
output while the pulse is still active.
The problem with the latch is that it responds to a change in the level of a clock pulse.
The key to the proper operation of a flip-flop is to trigger it only during a signal transition. A
clock pulse goes through two transitions from 0 to 1 and the return from 1 to 0.
The positive transition is defined as the positive-edge and the negative transition as the
negative-edge.
AMACDALINO2020 6
LATCHES AND FLIP-FLOPS: SR, D, JK, T
SR Flip-Flop
- a 2-input NAND gate in series with each input terminal of the SR latch
- has extra conditional input called an “Clock” input and is given the prefix of “clk”
- The problems with S-R latches using NOR and NAND gate is the invalid state. This
problem can be overcome by using a bistable SR flip-flop that can change outputs
when certain invalid states are met, regardless of the condition of either the Set or
the Reset inputs. For this, a clocked S-R flip flop is designed by adding two AND
gates to a basic NOR Gate flip flop. The circuit diagram is shown below while the
other details for this flip flop is shown at the Summary section.
SR Flip-flop circuit
D Flip-flop
- Is a slight modification of the above explained clocked SR flip-flop. From the figure
below you can see that the D input is connected to the S input and the
complement of the D input is connected to the R input. The D input is passed on to
the flip flop when the value of CP is ‘1’. When CP is HIGH, the flip flop moves to the
SET state. If it is ‘0’, the flip flop switches to the CLEAR state.
AMACDALINO2020 7
LATCHES AND FLIP-FLOPS: SR, D, JK, T
JK Flip-flop
- is a modification of the S-R flip-flop. The only difference is that the intermediate
state is more refined and precise than that of S-R flip-flop. The behavior of inputs J
and K is the same as the S and R inputs of the S-R flip-flop. The letter J stands for SET
and the letter K stands for CLEAR.
When both the inputs J and K have a HIGH state, the flip-flop switches to the
complement state. So, for a value of Q = 1, it switches to Q=0 and for a value of Q = 0,
it switches to Q=1.
CP
When both J and K inputs are 1, however, something unique happens. Because of the
selective inhibiting action of those 3-input AND gates, a “set” state inhibits input J so
that the flip-flop acts as if J=0 while K=1 when in fact both are 1. On the next clock
pulse, the outputs will switch (“toggle”) from set (Q=1 and not-Q=0) to reset (Q=0 and
not-Q=1). Conversely, a “reset” state inhibits input K so that the flip-flop acts as if J=1
and K=0 when in fact both are 1. The next clock pulse toggles the circuit again from
reset to set.
Toggle Flip-flop
- a method of avoiding the indeterminate state found in the working of RS flip-flop is
to provide only one input (T) such, flip-flop acts as a toggle switch. Toggle means
to change in the previous stage i.e. switch to opposite state.
AMACDALINO2020 8
LATCHES AND FLIP-FLOPS: SR, D, JK, T
Truth Table – shows how a logic circuit's output responds to various combinations of the inputs
Characteristic Table – defines the state of each flip-flop as a function of its inputs and previous state.
Excitation Table – lists the required inputs for a given change of state
AMACDALINO2020 9
LATCHES AND FLIP-FLOPS: SR, D, JK, T
Flip-Flop Conversion
- flip-flops can be converted from one type to another.
- To successfully convert, follow the steps below:
Steps:
1. Identify available and required flip-flop.
2. Make characteristic table for required flip-flop.
3. Make excitation table for available flip-flop.
4. Write boolean expression for available flip-flop.
5. Draw the circuit.
1. Required FF = D, Available FF = JK
2. Characteristic table for required FF:
Qn D Qn+1
0 0 0
0 1 1
1 0 0
1 1 1
Qn Qn+1 J K
0 0 0 X
0 1 1 X
1 0 X 1
1 1 x 0
Then combine:
Qn D Qn+1 J K
0 0 0 0 X
0 1 1 1 X
1 0 0 X 1
1 1 1 X 0
J=D K = D’
AMACDALINO2020 10
LATCHES AND FLIP-FLOPS: SR, D, JK, T
Assessment Task
AMACDALINO2020 11