Topic 5 - Flip Flops Sequential Circuits
Topic 5 - Flip Flops Sequential Circuits
Topic 5 - Flip Flops Sequential Circuits
The S-R, J-K and D inputs are called synchronous inputs because data on these
inputs are transferred to the flip-flop's output only on the triggering edge of the
clock pulse. 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. For the synchronous operations to work properly, these
asynchronous inputs must both be kept LOW.
Remember, the flip-flop cannot change state except on the triggering edge of the
clock pulse. The S and R inputs can be changed at any time when the clock input
is LOW or HIGH (except for a very short interval around the triggering transition
of the clock) without affecting the output.
S-R flip-flop can be wired from logic gates. NAND and NOR gates can be used to
form S-R flip-flop. An active-HIGH input S-R (SET-RESET) flip-flop is formed with
two cross-coupled NOR gates, as shown in figure (a) below; an active-LOW input
S.R flip-flop is formed with two cross-coupled NAND gates, as shown in figure (b)
below.
The operation and the truth table for a negative edge triggered S-R flip-flop are
the same as those for a positive edge-triggered device except that the falling edge
of the clock pulse is the triggering edge.
Example:
Determine the Q and Q output waveforms of the flip-flop
shown on the right, for the S, R, and CLK inputs in figure
below. Assume that the positive edge-triggered flip-flop is
initially RESET.
Solution
1. At clock pulse 1, S is LOW and R is LOW, so Q does not change.
2. At clock pulse 2, S is LOW and R is HIGH, so Q remains LOW (RESET).
3. At clock pulse 3, S is HIGH and R is LOW, so Q goes HIGH (SET).
4. At clock pulse 4, S is LOW and R is HIGH, so Q goes LOW (RESET).
5. At clock pulse 5, S is HIGH and R is LOW, so Q goes HIGH (SET).
6. At clock pulse 6, S is HIGH and R is LOW, so Q stays HIGH.
2.0 D Flip-Flop
The D flip-flop is useful when a single data bit (1 or 0) is to be stored. The addition
of an inverter to an S-R flip-flop creates a basic D flip-flop as shown below, where
a positive edge-triggered type is shown.
2.1 Operation
If there is a HIGH on the D input when a clock pulse is applied, the flip-flop will
set, and the HIGH on the D input is stored by the flip-flop on the positive-going
edge of the clock pulse. If there is a LOW on the D input when the clock pulse is
applied, the flip-flop will reset, and the LOW on the D input is stored by the flip-
flop on the leading edge of the clock pulse. In the SET state, the flip-flop is storing
a 1, and in the RESET state it is storing 0.
The operation of a negative edge-triggered device is, of course, the same, except
that triggering occurs on the falling edge of the clock pulse. Remember, Q follows
D at the active or triggering clock edge.
Example:
Given the waveforms in figure below for the D input
and the clock, determine the Q output waveform if the
flip-flop starts out RESET.
Solution
The Q output goes to the state of the D input at the time of the positive-going
clock edge. The resulting output is as shown below.
Figure below show the basic internal logic for a positive edge-triggered J-K flip-
flop. It differs from the S-R edge-triggered flip-flop in that the Q output is
connected back to the input of G2, and the Q output is connected back to the
input of gate G1.
1.1 Operation
If the J and K input are both at 1 and the clock pulse is applied, then the output
will change state, regardless of its previous condition.
If both J and K inputs are at 0 and the clock pulse is applied there will be no
change in the output. There is no indeterminate condition in the operation of JK
flip flop i.e. it has no ambiguous state.
When J = 0 and K = 0; these J and K inputs disable the AND gates, therefore clock
pulse have no effect on the flip flop. In other words, Q returns it last value.
The truth table for a negative edge-triggered device is identical except that it is
triggered on the falling edge of the clock pulse.
Example: 1
The waveforms in figure below are applied to the
J, K, and clock inputs as indicated. Determine the
Q output, assuming that the flip-flop is initially
RESET.
Solution
1. First, since this is a negative edge-triggered flip-flop, as indicated by the
“bubble” at the clock input, the Q output will change only on the negative-
going edge of the clock pulse.
2. At the first clock pulse, both J and K are HIGH; and because this is a toggle
condition, Q goes HIGH.
3. At clock pulse 2, a no-change condition exists on the inputs, keeping Q at
a HIGH level.
4. When clock pulse 3 occurs, J is LOW and K is HIGH, resulting in a RESET
condition; Q goes LOW.
5. At the clock pulse 4, J is HIGH and K is LOW, resulting in a SET condition;
Q goes HIGH.
Example: 2
The waveforms in figure below are applied to the flip-flop as shown. Determine
the Q output, starting in the RESET state.
Solution
The Q output assumes the state determined by the states of the J and K inputs at
the positive-going edge (triggering edge) of the clock pulse. A change in J or K
after the triggering edge of the clock has no effect on the output, as shown below.
The Q output of the second flip-flop is one-fourth the frequency of the original
clock input. This is because the frequency of the clock is divided by 2 by the first
flip-flop, and then divided by 2 again by the second flip-flop. If more flip-flops are
connected this way, the frequency division would be 2 to the power n, where n is
the number of flip-flops.
6.0 Registers
A register is a digital circuit with two basic functions: data storage and data
movement. The storage capability of a register makes it an important type of
memory device.
Example:
Show the states of the 5-bit register in figure below for the specified data input
and clock waveforms. Assume that the register is initially cleared (all 0’s).
Solution
The register contains 0110 after four clock pulses. See figure below.
Solution
On clock pulse 1, the parallel data (D0D1D2D3 = 1010) are loaded into the register,
making Q3 a 0. On clock pulse 2 the 1 from Q2 is shifted onto Q3; on clock pulse 3
the 0 is shifted onto Q3; on clock pulse 4 the last data bit (1) is shifted onto Q3;
and on clock pulse 5, all
data bits have been
shifted out, and only 1’s
remain in the register
(assuming the D input
remains a 1). See figure
on the right.