Flip Flop Circuits
Flip Flop Circuits
Flip Flop Circuits
Objective:
Overview:
So far you have encountered with combinatorial logic, i.e. circuits for which the output
depends only on the inputs. In many instances it is desirable to have the next output
depending on the current output. A simple example is a counter, where the next number
to be output is determined by the current number stored. Circuits that remember their
current output or state are often called sequential logic circuits. Clearly, sequential logic
requires the ability to store the current state. In other words, memory is required by
sequential logic circuits, which can be created with boolean gates. If you arrange the
gates correctly, they will remember an input value. This simple concept is the basis of
RAM (random access memory) in computers, and also makes it possible to create a wide
variety of other useful circuits.
Memory relies on a concept called feedback. That is, the output of a gate is fed
back into the input. The simplest possible feedback circuit using two inverters is shown
below (Fig.1):
If you follow the feedback path, you can see that if Q happens to be 1 (or 0), it will
always be 1 (or 0). Since it's nice to be able to control the circuits we create, this one
doesn't have much use -- but it does let you see how feedback works. It turns out that in
"real" sequential circuits, you can actually use this sort of simple inverter feedback
approach. The memory elements in these circuits are called flip-flops. A flip-flop circuit
has two outputs, one for the normal value and one for the complement value of the stored
bit. Binary information can enter a flip-flop in a variety of ways and gives rise to
different types of flip-flops.
1
RS Flip-Flop
RS flip-flop
flop is the simplest possible memory element. It can be constructed from
two NAND gates or two NOR gates. Let us understand the operation of the RS flip-flop
flip
using NOR gates as shown below using the truth table for A NOR B gate. The inputs R
and S are referred to as the Reset and Set inputs, respectively. The outputs Q and Q' are
complements of each other and are referred to as the normal and complement outputs,
respectively. The binary state of the flip
flip-flop
flop is taken to be the value of the normal
output. When Q=1 and Q'=0, it is in the set state (or 1-state).
state). When Q=0 and Q'=1, it is in
the reset/clear state (or 0-state).
state).
Circuit Diagram:
A B A+B
0 0 1
0 1 0
1 0 0
1 1 0
S=1 and R=0: The output of the bottom NOR gate is equal to zero, Q'=0. Hence
both inputs to the top NOR gate are equal to 0, thus, Q=1. Hence, the input
combination S=1 and R=0 leads to the flip-flop
flip being set to Q=1.
S=0 and R=1: Similar to the arguments above, the outputs become Q=0 and
Q'=1. We say that the flip-flop
flip is reset.
S=0 and R=0: Assume the flip flip-flop
flop was previously in set (S=1 and R=0)
condition. Now changing S to 0 results Q' still at 0 and Q=1. Similarly, when the
flip-flop
flop was previously in a reset st
state
ate (S=0 and R=1), the outputs do not change.
Therefore, with inputs S=0 and R=0, the flip flip-flop
flop holds its state.
S=1 and R=1: This condition violates the fact that both outputs are complements
of each other since each of them tries to go to 0, which is not no a stable
configuration. It is impossible to predict which output will go to 1 and which will
stay at 0. In normal operation this condition must be avoided by making sure that
1's are not applied to both inputs simultaneously, thus making it one of the m main
disadvantages of RS flip-flop.
flip
All the above conditions are summarized in the characteristic table below:
2
Characteristic Table:
R S Q Q' Comment
0 0 Q Q' Hold state
0 1 1 0 Set
1 0 0 1 Reset
1 1 ? ? Indeterminate
Debounce circuit
3
Circuit Diagram:
EN/Clock
pulse
Characteristic Table:
Qn R S Qn+1
0 0 0 0 (Hold)
0 1 0 0
0 0 1 1
0 1 1 Indeterminate
1 0 0 1 (Hold)
1 1 0 0
1 0 1 1
1 1 1 Indeterminate
D FLIP-FLOP
4
Circuit Diagram:
R
D Q
S Q
EN
Characteristic Table:
Qn D Qn+1
0 0 0
0 1 1
1 0 0
1 1 1
JK FLIP-FLOP:
The JK flip flop (JK means Jack Kilby, a Texas instrument engineer, who invented it) is
the most versatile flip-flop, and the most commonly used flip flop. Like the RS flip-flop,
it has two data inputs, J and K, and an EN/clock pulse input (CP). Note that in the
following circuit diagram NAND gates are used instead of NOR gates. It has no
undefined states, however. The fundamental difference of this device is the feedback paths
to the AND gates of the input, i.e. Q is AND-ed with K and CP and Q with J and CP.
Qn J K Qn+1
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1(Toggle, )
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0(Toggle, )
5
The JK flip-flop has the following characteristics:
If one input (J or K) is at logic 0, and the other is at logic 1, then the output is set
or reset (by J and K respectively), just like the RS flip-flop.
If both inputs are 0, then it remains in the same state as it was before the clock
pulse occurred; again like the RS flip flop. CP has no effect on the output.
If both inputs are high, however the flip-flop changes state whenever a clock
pulse occurs; i.e., the clock pulse toggles the flip-flop again and again until the CP
goes back to 0 as shown in the shaded rows of the characteristic table above.
Since this condition is undesirable, it should be eliminated by an improvised form
of this flip-flop as discussed in the next section.
MASTER-SLAVE JK FLIP-FLOP:
The master-slave JK flip flop consists of two flip flops arranged so that when the
clock pulse enables the first, or master, it disables the second, or slave. When the clock
changes state again (i.e., on its falling edge) the output of the master latch is transferred
to the slave latch. Again, toggling is accomplished by the connection of the output with
the input AND gates.
Circuit Diagram:
6
Characteristic Table:
Qn
CP J K Qm
01 0 0 Hold Hold
10 0 0 Hold Hold
01 0 1 0 1 Hold
10 0 1 Hold 0 1
01 1 0 1 0 Hold
10 1 0 Hold 1 0
01 1 1 Toggle Hold
10 1 1 Hold Toggle
T FLIP-FLOP:
Circuit Diagram:
The toggle, or T, flip-flop is a bistable device, where the output of the T flip-flop
"toggles" with each clock pulse.
Till CP=0, the output is in hold state (three input AND gate principle).
When CP=1, for T=0, previous output is memorized by the circuit. When T=1 along
with the clock pulse, the output toggles from the previous value as given in the
characteristic table below.
Characteristic Table:
Qn T Qn+1
0 0 0
0 1 1
1 0 1
1 1 0
7
Circuit components/Equipments:
Circuit Diagrams:
Procedure:
1. Assemble the circuits one after another on your breadboard as per the circuit
diagrams. Circuit diagrams given here do not show connections to power supply
and LEDs assuming that you are already familiar with it from your previous lab
experience.
2. Connect the ICs properly to power supply (pin 14) and ground (pin 7) following
the schematics for ICs given above.
3. Using dip switch and resistors, facilitate all possible combinations of inputs from
the power supply. Use the switch also to facilitate pulse input to the circuit.
4. Turn on power to your experimental circuit.
5. For each input combination, note the logic state of the normal and complementary
outputs as indicated by the LEDs (ON = 1; OFF = 0), and record the results in a
table.
6. Compare your results with the characteristic tables.
7. When you are done, turn off the power to your experimental circuit.
Observations:
Discussions:
Precautions: