Unit 2 - CS 203 DCES
Unit 2 - CS 203 DCES
3.2 FLIP-FLOPS:
A flip flop is a basic data storage element. A NAND or NOR gate individually act as a storage
element when they are cross coupled with feedback. Such cross coupled NAND or NOR gates
with feedback are known as flip flops. A flip flop is a bistable (output will remain permanently
either 0 or 1 until it is forced to change the state by an external trigger) circuit. A flip flop have
two outputs Q and Q’, and are complement to each other.
The truth table shown for NAND gate flip flop is inverted to that of NOR gate flip flop, hence
inverters gates are used to drive the inputs to the gates as shown:
S’ Truth Table:
S Q S R Q (output)
0 0 No Change
1 0 1 (SET)
0 1 0 (RESET)
Q’
R 1 1 Invalid
R’
Figure 3.2.3 RS Flip Flop
The truth table for NAND gate flip flop with inverters is similar to that of transistor flip flop,
hence this flip flop is used to realize the desired flip flop.
The clock signal or the enabling signal which makes the circuit to perform the required
operation. If clock = 0, the circuit output will remain unchanged. If clock = 1, the flip flop is
enabled and respond to the applied input signal.
K Q’
R’
R
Figure 3.2.5JK Flip Flop
Truth Table of J-K Flip Flop:
Qn represent the past state; Qn+1 represent the present state i.e. the state of the output
after the clock pulse is applied.
The J-input is analogous to the S input and K to the R input. So, when J=1 and K=0, the J-K flip
flop is in SET state and when, J = 0 and K = 1, the flip flop is in RESET state. When J=K=1, the
flip flop will complement its output condition, with high clock signal. This is the RACE around
condition and it is aproblem in JK flip flop. To overcome the problem of race around condition,
Master-Slave JK flip flop is used.
The input signals J and K are connected to the gated “master” SR flip flop which “locks” the
input condition while the clock (Clk) input is “HIGH” at logic level “1”. As the clock input of
the “slave” flip flop is the inverse (complement) of the “master” clock input, the “slave” SR
flip flop does not toggle. The outputs from the “master” flip flop are only “seen” by the gated
“slave” flip flop when the clock input goes “LOW” to logic level “0”.
When the clock is “LOW”, the outputs from the “master” flip flop are latched and any
additional changes to its inputs are ignored. The gated “slave” flip flop now responds to the
state of its inputs passed over by the “master” section.
Then on the “Low-to-High” transition of the clock pulse the inputs of the “master” flip flop are
fed through to the gated inputs of the “slave” flip flop and on the “High-to-Low” transition the
same inputs are reflected on the output of the “slave” making this type of flip flop edge or
pulse-triggered.
Then, the circuit accepts input data when the clock signal is “HIGH”, and passes the data to
the output on the falling-edge of the clock signal. In other words, the Master-Slave JK Flip
flop is a “Synchronous” device as it only passes data with the timing of the clock signal.
Truth Table:
D S
S’ Clock D Qn+1
J Q (output)
Clock 1 0 0
1 1 1
K Q’
R’
R
Figure 3.2.9D Flip Flop
Serial I/P
D Q D Q D Q D Q
F1 F2 F3 F4 Serial Output
Q’ Q’ Q’ Q’
Clock
Figure 3.4.1Serial Input Serial Output Shift Register
From the above diagram of SISO shift register, output of eah flip flop is connected to the input
of the next flip flop at its right. Each clock pulse shifts the contents of the register one bit to
the right.
Operation:
Serial loading of Information or data: Serial retriving of Information or data:
Q1 Q2 Q3 Q4
Serial I/P
D Q D Q D Q D Q
F1 F2 F3 F4
Q’ Q’ Q’ Q’
Clock
Figure 3.4.2 Serial Input Parallel Output Shift Register
Q1 Q2 Q3 Q4
D Q D Q D Q D Q
F1 F2 F3 F4
Q’ Q’ Q’ Q’
Clock
Figure 3.4.3 Parallel Input Parallel Output Shift Register
In PIPO shift register, input data D1,D2,D3 and D4 can be loaded into the flip flop
simultaneously through enable pulse and can be retrived simultaneously also from outputs
Q1,Q2,Q3 and Q4.
D1 D2 D3
Enable
D1 D2 D3 Serial
O/P
Q Q
Q
D Q D Q D Q
F1 F2 F3
Q’ Q’ Q’
Clock
From the above figure of PISO shift register, data input D1,D2 and D3 are loaded
simultaneously, when Enable = 1. When Enable = 0, loaded data is taken out serially from Q3
output of F3 flip flop. On application of clock pulse.
2. RING COUNTER:Ring counter is a shift register, in which output of last stage is feedback to
the input of first stage.
Q1 Q2 Q3 Q4
D1 Q D2 Q D3 Q D4 Q
F1 F2 F3 F4
Q’ Q’ Q’ Q’
Clock
Figure3.4.5: 4-bit Ring Counter
Q1 Q2 Q3 Q4 Clock pulse
Reference State 1 0 0 1
1 1 0 0 1
0 1 1 0 2
0 0 1 1 3
1 0 0 1 4
Count Sequence
Q1 Q2 Q3 Q4
D1 Q D2 Q D3 Q D4 Q
F1 F2 F3 F4
Q’ Q’ Q’ Q’
Clock
Figure3.5.1: 4-bit Johnson Counter
Q1 Q2 Q3 Q4 Clock pulse
Reference State 0 0 0 0
1 0 0 0 1
1 1 0 0 2
1 1 1 0 3
1 1 1 1 4
0 1 1 1 5
0 0 1 1 6
0 0 0 1 7
0 0 0 0 8
Table: Johnson Counter Count Sequence
Modulus of Counter(MOD): Modulus of counter is the number of different states before the
sequence repeats. Example- 3-bit binary counter has 8 different states, so MOD-8 counter.
Q1 Q2 Q3
T Q T Q T Q
A B C
Q’ Q’ Q’
Clock Figure 3.6.01: 3-Bit Binary Ripple Counter
3-bit binary ripple counter using T-Flip flop is shown above. From the figure, negative edge
triggered clock drives the flip flop “A”. Output Q1 of flip flop “A” drives the flip flop “B” and
output Q2 of flip flop “B” drives flip flop “C”. Flip flop “A” change state before it can trigger the
flip flop “B” and flip flop “B” has to change state before it can trigger the flip flop “C”. The
trigger moves through the flip flop like a ripple in water, hence the name Ripple Counter.
Operation: Let assume all flip flop are reset to produce “0”. Consider flip flop “A” as least
significant bit (LSB) and flip flop “C” as most significant bit (MSB), so the content of counter is
CBA = 0 0 0.
Cloc Q Q Q Coun a b c d e f g h
Time
0 0 0 0
a 0 0 1 1
Clock
b 0 1 0 2
c 0 1 1 3
Q1
d 1 0 0 4
e 1 0 1 5
f 1 1 0 6 Q2
g 1 1 1 7
h 0 0 0 0 Q3
TRUTH TABLE
Figure 3.6.02: Waveforms
From the waveform, for every negative clock transition, output Q1 of flip flop A will change
the state. Since flip flop A output Q1, act as a clock for flip flop B, each time the waveform at
Q1 goes low, output Q2 of flip flop B will toggle (change the state). Each time the output Q2 of
flip flop B goes low, output Q3 of flip flop C will toggle (change the state).
+Vcc
A B C
T A T B T C
FF1 FF2 FF3
A’ B’ C’
Clock Figure3.6.03: 3-bit Asynchronous down Counter
System clock is used to drive flip flop 1, but the complement A’ of flip flop-1, is used to drive
the flip flop-2 and complement B’ of flip flop-2, is used to drive the flip flop-3. Output A of flip
flop-1 toggles with every negative clock transition. But flip flop 2 will toggle each time A goes
high i.e. A’ goes low and it is this negative transition that triggers flip flop-2. On the time line,
flip flop-2 toggles at point a,c,e,g and i. similarly, flip flop-3 is triggered by B’ and so flip flop-3
will toggle each time flip flop-2 goes high. Thus flip flop-3 toggles high at point a on time line
and toggles back at point e and high at point i. Notice that the counter content are reduced by
one count with each clock transition i.e in count down mode.
TRUTH TABLE a b c d e f g h
Clock C B A Count Time
1 1 1 7
a 1 1 0 6 Clock
b 1 0 1 5
c 1 0 0 4 A
d 0 1 1 3
e 0 1 0 2 B
f 0 0 1 1
g 0 0 0 0 C
h 1 1 1 7
Figure 3.6.04: Waveforms
SYNCHRONOUS COUNTER OR PARALLEL COUNTER:
In a ripple counter (asynchronous counter) flip flop delay times are additive and the total
settling time for the counter is approximate the delay times the total number of flip flops.
These problem is overcome by the use of a synchronous counter or parallel counter. Here
every flip flop is triggered in synchronism with the clock.
T T T
To next Clock
stage
Count Enable
Figure 3.6.05: 3- Bit Synchronous Up Counter
Truth Table:
Count Clock A3 A2 A1 count a b c d e f g h
Enable pulse Time
0 0 0 0
1 1 0 0 1 1 Clock
1 1 0 1 0 2
1 1 0 1 1 3 A1
1 1 1 0 0 4
1 1 1 0 1 5 A2
1 1 1 1 0 6
1 1 1 1 1 7
1 1 0 0 0 0 A3
Figure 3.6.06: Waveforms
The truth table and waveforms of 3-bit synchronous up counter is shown above.
Q’ Q Q’ Q Q’ Q
T T T
To next
Clock
stage
Count Enable
Figure 3.6.07: 3- Bit Synchronous down Counter
TRUTH TABLE
Clock A3 A2 A1 Count Time
a b c d e f g h
a 1 1 1 7
b 1 1 0 6
Clock
c 1 0 1 5
d 1 0 0 4
A1
e 0 1 1 3
f 0 1 0 2
g 0 0 1 1 A2
h 0 0 0 0
1 1 1 7 A3
Waveforms
Figure 3.6.08: Waveform and truth table of 3-bit binary down counter
All flip-flops can be divided into four basic types: SR, JK, D and T. They differ in the number of
inputs and in the response invoked by different value of input signals. The four types of flip-
flops are defined in Table 1.
J K Q(next) Q Q(next) J K
0 0 Q 0 0 0 X
Q(next) = JQ' +
JK 0 1 0 0 1 1 X
K'Q
1 0 1 1 0 X 1
1 1 Q' 1 1 X 0
D Q(next) Q Q(next) D
0 0 0
D 0 0 Q(next) = D 0 1 1
1 1 1 0 0
1 1 1
Q Q(next) T
T Q(next) 0 0 0
0 Q Q(next) = TQ' + 0 1 1
T
1 Q' T'Q
1 0 1
1 1 0
Each of these flip-flops can be uniquely described by its graphical symbol, its characteristic
table, its characteristic equation or excitation table. All flip-flops have output signals Q and Q'.
The characteristic table in the third column of Table 1 defines the state of each flip-flop as a
function of its inputs and previous state. Q refers to the present state and Q(next) refers to
the next state after the occurrence of the clock pulse. The characteristic table for the RS flip-
flop shows that the next state is equal to the present state when both inputs S and R are
equal to 0. When R=1, the next clock pulse clears the flip-flop. When S=1, the flip-flop output
Q is set to 1. The equation mark (?) for the next state when S and R are both equal to 1
designates an indeterminate next state.
The characteristic table for the JK flip-flop is the same as that of the RS when J and K are
replaced by S and R respectively, except for the indeterminate case. When both J and K are
equal to 1, the next state is equal to the complement of the present state, that is, Q(next) =
Q'.
The next state of the D flip-flop is completely dependent on the input D and independent of
the present state.
The next state for the T flip-flop is the same as the present state Q if T=0 and complemented
if T=1.
The characteristic table is useful during the analysis of sequential circuits when the value of
flip-flop inputs are known and we want to find the value of the flip-flop output Q after the
rising edge of the clock signal. As with any other truth table, we can use the map method to
derive the characteristic equation for each flip-flop, which are shown in the third column of
Table 1.
During the design process we usually know the transition from present state to the next state
and wish to find the flip-flop input conditions that will cause the required transition. For this
reason we will need a table that lists the required inputs for a given change of state. Such a
list is called the excitation table, which is shown in the fourth column of Table 1. There are
four possible transitions from present state to the next state. The required input conditions
are derived from the information available in the characteristic table. The symbol X in the
table represents a "don't care" condition, that is, it does not matter whether the input is 1 or
0.