You are on page 1of 4

Electronics for Scientists Lab, PHYS 2371/2, Northeastern University, Fall 2014

Lab-11, Flip-Flop, Counters, Displays


Samantha Bell
Lab partner Dalton Cox
November 21, 2014
Lab-11, Flip-Flop, Counters, Displays is all about using flip flops to cycle through sequential numbers. We
wound up using our JK flip flops to toggle the value of the output as the clock pulse changed to act as a
binary counter. Using a BCD-to-seven-segment decoder/driver we were able to using the outputs from
the binary counter and convert them into the decimal numbers 0-7 and display them on a seven-segment
display. Then, using a network of logic gates designed using a truth table and Karnaugh map as outlined
in Lab-10, we were able to limit the seven segment display to the numbers 1-6 to simulate the rolling of
actual dice. The frequency used for the clock pulse square wave input affected the speed at which the
numbers were cycled through; a higher frequency meant cycling through the numbers faster, and a lower
frequency meant the cycling went slower.

I. INTRODUCTION
In Lab-11, Flip-Flop, Counters, Displays, we eventually created a circuit to cycle through the decimal
numbers 1-6 on a seven segment display. To be able to do this, we needed to take advantage of flip flops
and logical networks. Flip flops allow for the setting and resetting of a value, essentially acting as memory
where the output will stay high until it is reset. We mostly took advantage of the toggle function of a flip
flop, which is where a high input allows for the toggling, or switching, of the output value from high to
low or from low to high. This function allows us to create a binary counter to count in binary (0s and 1s)
from 000 to 111 (decimal numbers 0-7). The logic gates that we needed to use in the lab were AND, OR,
and NOT. Each gate we used was a chip of 14 pins where pin 7 was ground and pin 14 was Vcc, which in
our case was 5 V power to the chip. For the AND, and OR chips, pins 1 and 2 were inputs to the output on
pin 3, and this pattern repeated throughout the chip in numerical order skipping pins 7 and 14 which we
already defined. The NOT gate is different from the other gates in the sense that it can only have one
input per output since it just negates the input and is not a comparator like the other functions. Vcc and
ground were on the same pins, but the patter for input and outputs was pin 1 was the input to the output
on pin 2 and that pattern continued through pin 6, and then pin 8 was the output to the input on pin 9
and that pattern continued through pin 13. We also needed to design logical networks using truth tables
and Karnaugh maps. Karnaugh maps take the values in the truth table and change the format so the
outputs can be simplified. For a 4-bit Karnaugh map, the top row is composed of the values for the A and
B inputs, and each column in that row can only change in value by 1-bit, so the common order for the
Karnaugh map is 00, 01, 11, 10. The same rules are applied for the left-most column which applies to the
values of the C and D inputs where the same ordering rules apply, so the rows commonly go in the order
00, 01, 11, 10. The values of the truth tables are then filled in to the Karnaugh map, and even numbers of
adjacent 1s can be grouped into miniterms where inputs that are both 0 and 1 within that miniterm
are not needed and can be dropped from the output. To find miniterms, you can wrap around the cylinder,
so the 00 column can move to be adjacent to the 10 column since only one bit changes, and you can do
the same with the rows.

II. APPARATUS
The apparatus consisted of the following.
Project Board K2400 Pacesetter Projects

Electronics for Scientists Lab, PHYS 2371/2, Northeastern University, Fall 2014

GW Instek GFG-8216A Function Generator


3x Red LED
3x 470 5% Resistor
6x 1000 5% Resistor
8x 200 5% Resistor
2x 74112 Flip-Flop Chips
SN74LS47N BCD-to-seven-segment decoder/driver
LTS-2801AB seven-segment blue LED decimal digit
display
AND-7408 Digital Chip
OR-7432 Digital Chip
NOT-7404 Digital Chip
Chip extraction tool
Jumper wires

III. PROCEDURES AND RESULTS


I. Truth Table

Figure-1. Circuit used to determine the


truth table of the 74112 flip-flop chip
with 470 resistors and variable
inputs on 1K and 1J.

The JK flip flops used can be used as either an RS, R S, or T flip flop. Using the J and K inputs the flip flop is
equivalent to an RS flip flop because using positive-going pulses J and K do the same thing as R and S
would do in an RS flip flop. We set up the circuit in Figure-1 with a frequency of 533.17 mHz to
determine the truth table for the JK flip flops with variable inputs on J, K, and
J K Q Q
CP. The inputs for J and K (pins 2 and 3) were left open on the circuit diagram
0 0 NC NC
because they varied between ground and 5V so that we could measure the
1 0 1
0
truth table. Table-1 shows the truth table as measured for the circuit in
Figure-1. When J and K were both 1 (not shown in the truth table), the flip
0 1 0
1
flop acted as a toggle, switching the value of Q when the clock pulse turn off.
Table-1. Truth table
for Figure-1.
II. Binary Counter JK Flip Flops in Series
The circuit shown in Figure-2 was
setup with a frequency of 533.54
mHz to create a binary counter
that would light red LEDs showing
binary numbers that correspond to
the decimal numbers 0-7. When
this circuit was setup it did just as it
was supposed to and the LEDs lit
up displaying binary numbers
where each LED was one bit, which
corresponded to the decimal
numbers 0-7. The LEDs lit up in the
pattern, 000, 001, 010, 011, 100,
101, 110, 111 where 1 was a lit
LED and 0 was a dark LED.

Figure-2. Circuit used to create a binary counter using two


74112 flip-flop chips.

Electronics for Scientists Lab, PHYS 2371/2, Northeastern University, Fall 2014

III. BCD-to-seven-segment Decoder/Driver and Display


The circuit shown in Figure-3 was setup with a
frequency of 533.39 mHz to connect out
binary counter to a seven-segment decoder
and then to a seven-segment display to display
the actual decimal numbers corresponding to
the binary outputs. We left the LEDs
connected to the main outputs (1Q, 2Q, 3Q) to
make sure our circuit still worked and to
compare the binary numbers to the displayed
decimal numbers. The circuit worked as
desired and the seven-segment display
showed the decimal numbers corresponding
to the binary outputs as shown on the LEDs for
the numbers 0-7.
IV. Roll of the Dice (Die)

Figure-3. Circuit used to light up the numbers 0-7


on a seven segment display.

The circuit in
Figure-4 was setup
to simulate the
rolling of dice. The
logic gates
connected to the
pin 8 of the sevensegment display
were not used at
first, and instead
pin 8 was
connected to a 5V
power supply. The
switch on the clock
pulse allowed us
to stop the display
on a number from
Figure-4. Circuit used to roll the dice for the numbers 1-6.
0-7 as it cycled
through. The
AB
00 01 11 10
frequency of the square wave from the function generator affected how
C
fast the seven-segment display cycled through the numbers. At a
0
0 1 1 1
frequency of 10 Hz it was cycling through the numbers very fast, but we
1
1 1 0 1
were still able to predict which number we would roll when we
Table-2. Karnaugh map for
stopped the switch. However, once we went to a frequency of about 15
rolling the dice from 1-6..
Hz we could no longer predict what number we would roll. To better
simulate the rolling of dice, we designed circuit to only cycle through the numbers 1-6, which are the
numbers on the face of a die. We used the same process to design the circuit as was used in the last lab
where we made a truth table and then used a Karnaugh map, as shown in Table-2 to simplify our circuit.

Electronics for Scientists Lab, PHYS 2371/2, Northeastern University, Fall 2014

The logic gates shown in Figrue-4 were attached to the circuit at pin 8 of the seven-segment display to
limit the display to only showing the numbers 0-6. Although each number still shows up with the same
probability on the display, it is easier to predict or roll a 1 since there is a period of time between the
display of 6 and 1 where the display is dark, and if that period is timed correctly it is easy to land on a 1.

IV. SUMMARY
The JK flip flop can be used to create RS, R S, and T flip flop. JK flip flops can then be used in conjunction
with a BCD-to-seven-segment decoder/driver, with a seven segment display to cycle through the numbers
0-7. Adding in a designed logic gate network, the display can then be limited to only displaying the number
1-6, as are on the face of a die. The frequency of the square wave input from the function generator on
the clock pulse determines how fast the numbers are cycled through, where a higher frequency equates
to faster cycling and vice versa.

You might also like