Update: 19/02/2020 CTS, BSC, SRT, TSK Page 1/15
2182212 Fundamental of Circuits and
Digital Electronics Laboratory
Faculty of Engineering, Chulalongkorn University
Flip Flop and Counter (FFC)
Ekachai Leelarasmee, 19 February 2009
Instructor: Date:
Name: 1) ID
2) ID
3) ID
A. Objectives
1. To understand the basic of clocked flip flops and their operations.
2. To learn how to construct counters from flip flops.
B. Introduction
Ever seen a system in which all actions or results are synchronized by one control
signal. ? Here are a few examples
1) In a school or university, all class activities are hourly synchronized.
2) In a marching band, the drum’s beat synchronizes the march.
3) In computers, mobile phones and many consumer electronic devices today, their
internal processes need a clock signal to synchronize.
Note that the clock plays no part in determining what activities or results are to be
made.
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 2/15
Input Output (State)
CLR CLK J K Q (after ) Operation
1 ↓ 0 0 Q (before ) Hold
1 ↓ 0 1 0 Reset
1 ↓ 1 0 1 Set
1 ↓ 1 1 Q (before ) Toggle
1 1, 0, ↑ Don’t Care Can’t Change -
0 Don’t Care 0 Clear
CLK
J Q
K QCLR
A flip flop (FF) is the simplest digital circuit that has a clock input for
synchronizing its output. The clocked JK-FF will be studied in this lab. It has 4 inputs,
i.e. J, K, CLK (CLOCK) and CLR (CLEAR), and one output Q with Q as its
compliment. Its symbol and truth table (or state table) is as follows.
The first 4 rows indicate that the output Q can change only when the clock transits
from HIGH to LOW (indicated by ↓). Thus its response is synchronized with the clock
and depends on the JK inputs. This flip flop is called a negative (or falling) edge
triggered JK flip flop and the output value between consecutive falling edges is called its
state. However, there is one exception when the input CLR is 0, as shown in the last row
of the table, that immediately clear Q to 0 without having to wait for the clock transition,
i.e. its action is asynchronous.
The output (or timing) waveform of a flip flop is usually accompanied by its clock
waveform. For example, when a JK-FF is put in a toggle mode with J=1, K=1 and
CLR =1, its waveform is as follows.
QCLR
Timing waveform of a JK-FF in toggle mode
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 3/15
Using states, we can conveniently and
concisely express its operation in the form
of a state diagram where the triggering
clock edges are represented as arrows as
shown in the right figure. In this case the
state sequences repeatedly between 0 and
1.
A sequential digital circuit is a clocked circuit that has one or more flip flops
connected together, possibly using combinational gates. Its simplest one is the counter
that has only a clock input. An example is the following two bit binary counter in which
each state consists of two outputs Q2 and Q1. Its state diagram indicates that the counter
sequences from Q2Q1 = 00, 01, 10, 11 and repeats, giving a count up output.
Q1CLR Q2CLR
Q2 Q1
It should be noted that there
are N2 possible states for a circuit
with N flip flops. However, a
counter sequence can be arbitrarily
designed and may not sequence
through all possible states. For
example, we can design a two bit
counter with either one of the
following state diagram. The left
one gives a counter with modulo 3
and the right one is a counter with
a count down output.
Q2 Q1 Q2 Q1
A more complicated form of a sequential circuit is a finite state machine (FSM)
which has additional inputs other than a clock. One example is a counter with has an
Up/Down input to change its counting sequence. A central processing unit (CPU) in a
computer is an example of a complex FSM.
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 4/15
C. Materials provided in the experiment
1) Breadboard with components and wires already inserted. During each experiment,
you have to add or delete wires to form a circuit. When the lab is done, please
reconnect them back as shown below.
2) Battery interface board. It is attached to the upper left part of the breadboard as
shown above. Plug a 6V battery jack into it to supply 0 and 6Volt to the horizontal
buses on the breadboard from which red and black wires are inserted. Note that red
wires carry 6Volt while black wires carry 0Volt. They energize all ICs on the
breadboard.
3) Digital ICs labeled 7408 (AND), 7432 (OR), 7404 (NOT), 7447 (BCD-7 Segment
Decoder), 555 (Clock Generator), and 7473 (JK Flip Flop). Their internal schematics
will be described when needed.
4) LED modules. It will shine when there is a current (~1mA or more) flowing from its
Anode (A) to Cathode (K) terminals. In this lab, we always insert its cathode (K) to
0V or Ground. Thus if its anode (A) gets a voltage of higher than 4V, it will shine.
So the LED brightness can indicate if its anode is at HIGH or LOW.
5) LED7 module. It consists of 7 LED modules arranged in a 7 segments display
format. This LED7 module is inserted with all anodes connected to 6V. Hence each
segment will shine if its corresponding cathode, labeled a,b,c,d,e,f and g, gets a
voltage of lower than 1V (LOW or a digital 0).
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 5/15
Experiment #1: Clock generator (555)
The 555 is a general purpose timer IC for generating a timing clock signal of varying
duration and period. We have already connected components to it on the board to make it
operate as a clock generator giving a clock signal at its OUT pin with frequency given by
the following formula
f = CRR BA )2(
44.1
With AR =10k BR = 140k ±1% and 10C F , we have frequency out = 0.498 Hz duty
cycle =51.71 %. This means that the LED will flash approximately once every two
seconds. If this does not happen, check to see if the circuit is correctly connected.
duty cycle ={RA+RB/(RA+2RB)}x100
=51.71%
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 6/15
Experiment #2: JK Flip Flop (7473)
The 7473 has two JK flip flops with the pin assignment as shown in the left figure
below. Connect the clock signal from 555 IC to CLK1 (pin #1) of 7473. This corresponds
to the circuit on the right. Note that we have left its JK inputs unconnected. They will be
treated as “1” by the IC. However, the CLR1 input must be connected to 6V in order to
input a “1”. Connect an LED to Q1. Observe its brightness and complete the timing/state
diagrams below.
Q1 (state)
Now move the red wire that connects CLR1 (pin#2) from 6V to 0V. This is to input
“0” to the CLR1 input. Then move it back to 6V again. You may repeat this a few times
to be sure about what happens. Report your observation here
…………………………………………………………………………………………
………………………………………………………………………………………….
……………………………………………………………………………………………………...
………………………………………………………………………………………………………
………………………………………………………………………………………………………
………………………………………………………………………………………………………
………………………………………………………………………………………………………
Before going on to the next experiment, connect the red wire from CLR1 back to 6V.
CLK1
J1 Q1
K1 Q1
1
1
1
CLR1
from 555
VCCK1
GNDJ1 1Q 1Q Q2Q2
K2
J2
Q2
Q2
1QK1
1QJ1
CLR1CLK1
K2
CLR2CLK2 J2
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 7/15
Experiment #3 : A two bits synchronous binary counter
VCCK1
GNDJ1 1Q 1Q Q2Q2
K2
J2
Q2
Q2
1QK1
1QJ1
CLR1C LK1
K2
CLR2C LK2 J2
Connect the circuit as shown below. You may leave J1 and K1 unconnected to input a
“1” but you have to make sure that both CLR1 and CLR2 are connected to 6V to input a
“1”. Also do not forget to input OV to C and D pins of the 7447. Connect LEDs to Q1
and Q2. Observe and fill in the timing/state-LED7 diagrams starting at state 00.
Q1CLR1 Q2CLR2
Q2 Q1
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 8/15
Experiment #4 : A two bits ripple binary counter
VCCK1
GNDJ1 1Q 1Q Q2Q2
K2
J2
Q2
Q2
1QK1
1QJ1
CLR1CLK1
K2
CLR2CLK2 J2
Connect the circuit as shown below. Then insert LEDs to monitor Q1 and Q2.
Connect Q1 and Q2 to the A and B inputs of 7447 while leaving its C and D inputs at 0V.
Observe and fill in the timing/state-LED7 diagram below starting at state 00. Comparing
this experiment with the previous one reveals that there can be several realizations of the
same sequential function. However, CLK2 in this circuit is derived from Q1 which can
incur a small delay. This counter is strictly called a ripple or asynchronous counter,
although its output appears synchronized with the clock.
Q1CLR1 Q2CLR2
Q2 Q1
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 9/15
Experiment #5 : A two bits synchronous counter with modulo 3 output.
VCCK1
GNDJ1 1Q 1Q Q2Q2
K2
J2
Q2
Q2
1QK1
1QJ1
CLR1CLK1
K2
CLR2CLK2 J2
Connect the circuit as shown below. Then insert LEDs to monitor Q1 and Q2.
Connect Q1 and Q2 to the A and B inputs of 7447 while leaving its C and D inputs at 0V.
Observe and fill in the timing/state-LED7 diagrams starting at state 00.
Q1CLR1 Q2CLR2
Q2 Q1
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 10/15
Experiment #6 : A 4 bit ripple binary counter.
VCCK1
GNDJ1 1Q 1Q Q2Q2
K2
J2
Q2
Q2
1QK1
1QJ1
CLR1C LK1
K2
CLR2C LK2 J2
Construct the circuit below. Insert LEDs to monitor Q1, Q2, Q3 and Q4. Then
connect Q1, Q2, Q3 and Q4 to the A,B,C and D inputs of 7447. Note that you have to
remove the 0V connection at C and D inputs first. Observe and fill in the timing/state-
LED7 diagrams starting at state 00.
Q1CLR1 Q2CLR2 Q3 Q4CLR3 CLR4
0 0 0 0
Q4 Q3 Q2 Q1
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 11/15
Experiment #7 : Converting a 4 bit ripple binary counter into a decimal counter.
CCVCCV
Modify the circuit in the previous experiment by reconnecting the CLR inputs as
shown below while leaving all connections to LEDs and 7447 intacted. Note that the
AND gate must get its inputs from Q4 and Q2. Observe and fill in the timing/state-LED7
diagrams starting at state 00. You may have to bypass some blank states if necessary.
Q1CLR1 Q2CLR2 CLR3 CLR4Q3 Q4
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 12/15
Remark: This experiment modifies an existing counter by exploiting its asynchronous
clear inputs. Its clear action is activated at 1010 state, causing the state to immediately
go to 0000. Thus the 1010 state becomes temporary or transient. Such a transient state
lasts only a few nanoseconds and is therefore un-noticed.
Problems
Problem #1: Give your own example about a system with a synchronizing signal
………………………………………………………………………………………………
……………………………………………………………………………………
………………………………………………………………………………………………
……………………………………………………………………………………
………………………………………………………………………………………………
……………………………………………………………………………………
Problem #2: For an 8 bits binary counter
a) How many flip flops does it use? ........................................
b) How many states does it have? ……………………………..
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 13/15
Problem #3: Fill in the timing/state diagrams of the following counter starting at state
0000. You may have to bypass some blank states in the diagram.
Q1CLR1 Q2CLR2 Q3 Q4CLR3 CLR4
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 14/15
Problem #4: Fill in the timing/state diagrams of the following counter starting at state
0000. You may have to bypass some blank states in the diagram.
Q1 Q2 Q3 Q4CLR1 CLR2 CLR3 CLR4
Update: 19/02/2020 CTS, BSC, SRT, TSK Page 15/15
Discussion (if you have any)