02 01 Latch & Flip Flop
02 01 Latch & Flip Flop
Combination Logic
Logic that performs some transformation
operation on the inputs to produce outputs
which are simple logic functions of the input.
Present State – the logic value of all the state variables of the
system.
These are stored in the state memory.
Next State – Given the present state and the current values on the
inputs, the next state represents the next logic state the circuit will
transition to on the next clock.
Latch Circuit
A latch is an electronic logic circuit that has two inputs and one
output.
One of the inputs is called the SET input; the other is called the RESET input.
a) Active-high circuit: Both inputs are normally tied to ground (LOW), and
the latch is triggered by a momentary HIGH signal on either of the inputs.
b) Active-low circuit: Both inputs are normally HIGH, and the latch is
triggered by a momentary LOW signal on either input.
Latch Circuit …
In an active-high latch, both the SET and RESET inputs are connected
to ground.
When the SET input goes HIGH, the output also goes HIGH.
When the SET input returns to LOW, however, the output remains HIGH.
The output of the active-high latch stays HIGH until the RESET input
goes HIGH.
Then, the output returns to LOW and will go HIGH again only when the SET
input is triggered once more.
In other words, the latch remembers that the SET input has been
activated.
If the SET input goes HIGH for even a moment, the output goes HIGH and stays
HIGH, even after the SET input returns to LOW.
The output returns to LOW only when the RESET input goes HIGH.
Latch Circuit …
On the other hand, in an active-low latch the inputs are
normally held at HIGH.
When the SET input momentarily goes LOW, the output goes HIGH.
The output then stays HIGH until the RESET input momentarily goes
LOW.
Note that most latch circuits actually have a second output that
is simply the first output inverted.
In other words, whenever the first output is HIGH, the second output is
LOW, and vice versa.
These outputs are usually referred to as Q and Q-bar with the latter
notated as follows:
Latch Circuit …
The notation is usually pronounced either “bar Q” or “Q bar,” though
some people pronounce it “not Q.”
The horizontal bar symbol over a label is a common logical shorthand for
inversion.
That is, Q-bar is the inverse of Q. If Q is HIGH, Q-bar is LOW, and if Q is LOW,
Q-bar is HIGH.
You can easily create an active-high latch from a pair of NOR gates.
The output of a NOR gate is HIGH if both inputs are LOW; otherwise, the
output is LOW.
In this circuit, the SET input is connected to one of the inputs of the
first NOR gate, and the RESET input is connected to one of the
inputs of the second NOR gate.
Latch Circuit …
The trick of the latch circuit is that the output of the NOR gates
are cross-connected to the remaining NOR gate inputs.
In other words, the output from the first NOR gate is connected to one
of the inputs of the second NOR gate, and the output from the second
NOR gate is connected to one of the inputs of the first NOR gate.
Latch Circuit …
The next schematic is for an active-low latch.
The only difference between this schematic and the one shown
previously is that the active-low latch uses NAND gates instead of NOR
gates.
Notice also in this diagram that the inputs are referred to as SET-bar
and RESET-bar rather than SET and RESET, which indicates that the
inputs are active-low.
Different types of Latch
1) SR Latch
Gated SR Latch
2) D latch
The SR Latch
The SR (Set-Reset) Latch (With NAND Gates)
And adding a
control input
The D Latch
The most common element in today’s VLSI
The D (or Data) Latch
The most common element in today’s VLSI
Another implementation
The implementation used in VLSI used
properties of the technology to reduce
circuit elements and power consumption.
The VLSI implemention
The VLSI implementation uses the
transmission gate.
With control input of 1 the input = the output
With control input of 0 it is an open circuit
Used inverter feedback pair to store state.
Transmission gate requires 2 transistors.
Inverts require 2 transistors
T-gate Latch – 8 or 10 transistors (depends on
availability of clk’
Contrast with the gate circuit
The D latch circuit in the text would take 18
transistors in a VLSI circuit.
This is contrasted to 8 or 10 transistors.
Synchronous vs. Asynchronous
There are two types of sequential circuits:
Synchronous sequential circuit: circuit output
changes only at some discrete instants of time.
This type of circuits achieves synchronization by
using a timing signal called the clock.
X Y NAND
00 1
01 1
10 1
11 0
SR Latch (NAND version)
1 S’ S’ R’ Q Q’
Q 1
0 0
0 1 1 0 Set
1 0
Q’ 0
1 R’ 1 1 1 0 Hold
X Y NAND
00 1
01 1
10 1
11 0
SR Latch (NAND version)
1 S’ S’ R’ Q Q’
Q 0
0 0
0 1 1 0 Set
1 0 0 1 Reset
Q’ 1
0 R’ 1 1 1 0 Hold
X Y NAND
00 1
01 1
10 1
11 0
SR Latch (NAND version)
1 S’ S’ R’ Q Q’
Q 0
0 0
0 1 1 0 Set
1 0 0 1 Reset
Q’ 1
1 R’ 1 1 1 0 Hold
0 1 Hold
X Y NAND
00 1
01 1
10 1
11 0
SR Latch (NAND version)
0 S’ S’ R’ Q Q’
Q 1
0 0 1 1 Disallowed
0 1 1 0 Set
1 0 0 1 Reset
Q’ 1
0 R’ 1 1 1 0 Hold
0 1 Hold
X Y NAND
00 1
01 1
10 1
11 0
SR Latch with Clock signal
A flip-flop continuously checks its inputs and Latch is a device which continuously checks all its
correspondingly changes its output only at times input and correspondingly changes its output,
determined by clocking signal. independent of the time determined by clocking
signal.
Flip-flop circuits are interconnected to form the logic gates for the digital
integrated circuits (IC s) used in memory chips and microprocessors.
Flip-flops can be used to store one bit, or binary digit, of data.
The data may represent the state of a sequencer, the value of a counter, an ASCII
character in a computer's memory or any other piece of information.
Flip-Flops (or bistable gates) …
There are several different kinds of flip-flop circuits, with designators such
as
T (toggle),
S-R (set/reset)
J-K (possibly named for Jack Kilby) and
D (delay or data)
Latches are also used to do the same task except that they do not use a clock signal.
Hence to say it simply, “Flip – flops are clocked latches”.
They are used to store only 1 – bit of information and it can remain in the same state
until the clock signal affects the state of the input.
Numerous varieties of JK flip – flop and D flip – flop are available in the
semiconductor market.
The less popular SR flip – flop and T flip – flop are not available in the
market as integrated circuits (IC’s) (even though a very few number of SR
flip – flops are available as IC’s, they are not frequently used).
There might be a situation where the less popular flip – flops are required in
order to implement a logic circuit.
Flip-Flops …
In order use the less popular flip – flops, we will convert one type of flip –
flop into another.
An excitation table has the current state as the first column, the
next state as the second column, and the control bit as the third
column.
Basically, think of this as the state you have (first column), the state you
want (second column), and what you must set the control bit (third
column) to get the desired state you want.
Flip-Flops
Latches are “transparent” (= any change on
the inputs is seen at the outputs
immediately).
This causes synchronization problems.
Solution: use latches to create flip-flops
that can respond (update) only on specific
times (instead of any time).
Types: RS flip-flop and D flip-flop
SR Flipflop
Master-Slave FF configuration
using SR latches (cont.)
S R CLK Q Q’ • When C=1, master is enabled and
0 0 1 Q0 Q0’ Store stores new data, slave stores old
0 1 1 0 1 Reset data.
1 0 1 1 0 Set • When C=0, master’s state passes
1 1 1 1 1 Disallowed to enabled slave, master not
X X 0 Q 0 Q0 ’ Store sensitive to new data (disabled).
Edge-triggered Flip-Flops
D-Type Positive Edge-Triggered Flip-Flop:
Characteristic Tables
Defines the logical properties of a flip-flop
(such as a truth table does for a logic gate).
Q(t) – present state at time t
Q(t+1) – next state at time t+1
Characteristic Tables (cont.)
SR Flip-Flop
S R Q(t+1) Operation
0 0 Q(t) No change/Hold
0 1 0 Reset
1 0 1 Set
1 1 ? Undefined/Invalid
Characteristic Tables (cont.)
D Flip-Flop
D Q(t+1) Operation
0 0 Set
1 1 Reset
The difference this time is that the “JK flip flop” has no invalid or
forbidden input states of the SR Latch even when S and R are both
at logic “1”.
The JK Flip Flop …
The JK flip flop is basically a gated SR Flip-flop Loading product
data.
The two 2-input AND gates of the gated SR bistable have now
been replaced by two 3-input NAND gates with the third input
of each gate connected to the outputs at Q and Q-bar.
This cross coupling of the SR flip-flop allows the previously invalid
condition of S = “1” and R = “1” state to be used to produce a “toggle
action” as the two inputs are now interlocked.
The JK Flip Flop …
If the circuit is now “SET” the J input is inhibited by
the “0” status of Q-Bar through the lower NAND gate.
If the circuit is “RESET” the K input is inhibited by the “0”
status of Q through the upper NAND gate.
1 1 0 1
toggle
action Toggle
1 1 1 0
The Master-Slave JK Flip-flop
The Master-Slave Flip-Flop is basically two gated SR flip-flops
connected together in a series configuration with the slave
having an inverted clock pulse.
The outputs from Q and Q from the “Slave” flip-flop are fed back
to the inputs of the “Master” with the outputs of the “Master”
flip flop being connected to the two inputs of the “Slave” flip
flop.
The symbol for positive edge triggered T flip flop is shown below
Symbol Diagram Block Diagram
The T Flip-flop :Truth Table
Operation:
T = 0,
1 J=K=0 The output Q and Q bar won't change
There are of –
Positive edge-triggered (without bubble at Clock input): S-R, J-K, and D.
On the other hand, the direct set (SET) and clear (CLR) inputs
are called asynchronous inputs, as they are inputs that affect the
state of the flip-flop independent of the clock.