Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Digital Logic Design Lab No.

9 Design of Synchronous Counter

Lab No.9 Design of Synchronous Counter

Objectives:
 Design a synchronous counter with up to 16 states in any selected order.
 Construct and test the counter. Determine the state diagram of the counter.

Requirements:
 Two 74LS76A dual J-K flip-flops
 7408 quad AND gate

Summary of Theory:
The D flip-flop is an edge-triggered device that allows the output to change only during
the active clock edge.
The design of a synchronous counter begins with a description of the state diagram that
specifies
the required sequence. All states in the main sequence should be shown; states that are not
in the main sequence should be shown only if the design requires these unused states to
return to the main sequence in a specified way. If the sequence can be obtained from an
already existing IC, this is almost always more economical and simpler than designing a
special sequence.
From the state diagram, a next-state table is constructed. This procedure is illustrated
with the example in Figure 9-1 for a simple counter and again in Figure 9-3 for a more
complicated design. Notice in Figure 9-1 that the next state table is just another way of showing
the information contained in the state diagram. The advantage of the table is that the changes
made by each flip-flop going from one state to the next state are clearly seen.
The third step is to observe the transitions (changes) in each state. The required logic to
force these changes will be mapped onto a Karnaugh map. In this case, the Karnaugh map
takes on a different meaning than it did in combinational logic but it is read the same way.
Each square on the map represents a state of the counter. In effect, the counter sequence is just
moving from square to square on the Karnaugh map at each clock pulse. To find the logic that
will force the necessary change in the flip-flop outputs, look at the transition table for the JK flip-
flop, shown as Table 9-1. Notice that all possible output transitions are listed first;
then the inputs that cause these changes are given. The transition table contains a number of
X’s (don’t cares) because of the versatility of the J-K flip-flop, as explained in the text. The data
from the transition table are entered onto the Karnaugh maps as illustrated.

Assume you need to design a counter that counts 0-1-3-2 and stays in state 2 until a reset button
is pressed. Two flip-flops are required. Let QB= MSB and QA= LSB. Use a J-K flip-flop.
Step 1: Draw a state diagram.
Step 2: Draw next-state table.

Present State Next State


QB QA QB QA
0 0 0 1
0 1 1 1
1 1 1 0
1 0 1 0

Department of Electronic Engineering, Faculty of Engineering & Technology, IIUI Page 43


Digital Logic Design Lab No.9 Design of Synchronous Counter

Step 3: Determine inputs required for each flip-flop.


a) Read present state 00 on next-state table.
b) Note that QB does not change 0 —>0 (present to next state) and QA changes from 0 to 1.
c) Read the required inputs to cause these results from transition Table.
d) Map each input from transition table onto Karnaugh map.

Step 4: Draw the circuit and check.

Fig 9-1

Department of Electronic Engineering, Faculty of Engineering & Technology, IIUI Page 44


Digital Logic Design Lab No.9 Design of Synchronous Counter

Table 9-1

When the maps are completed, the logic can be read from the map. This logic is then
used to set up the circuit as shown in Step 4 of Figure 9-1. It is a good idea to check the
design by verifying that the count sequence is correct and that there are no lock-up states.
(A lock-up state is one that does not return to the main sequence of the counter.)
The design method described here is not the only way to obtain the desired sequence, but
it does lead to a fairly straightforward design. Figure 9-3 illustrates the detailed procedure for
designing this circuit. Note that only the main sequence is shown in the state diagram and on the
next-state table. The reason for this is that the unused states will show up as extra “don’t cares”
in
the logic, making the design simpler. All unused states are entered on the maps as “don’t care.”
After reading the logic equations for the inputs to each flip-flop, the design is checked for
lock-up problems. Corrections are made to prevent lock up by examining the “don’t- care” logic
and changing it if required.

Procedure
1. A Gray code synchronous counter is often used in state machine design. This problem
requires a six-state Gray code counter. The usual Gray code sequence is not used
because the sixth state would not be “Gray” when the counter returns to zero.
Instead, the sequence shown in Figure 9-4 is required. There are two unused states: state
5 and state7. For the initial design, these states are not shown. Complete the next-state
table in the report for the main sequence shown here.
2. Using the transition table for the J-K flip- flop, complete the Karnaugh maps shown
in the report. The J-K transition table (Table 9-1) is repeated in the report for
convenience.
3. Read the required logic expressions from each map that you completed in step 2. Check
that the unused states return to the main sequence. If they do not, modify the design to
assure that they do return. Then, construct and test your circuit. You can check the state
sequence with an oscilloscope or a logic analyzer. Summarize the results of your test in
your report.

Department of Electronic Engineering, Faculty of Engineering & Technology, IIUI Page 45


Digital Logic Design Lab No.9 Design of Synchronous Counter

Figure 9-2
Step 1: Draw the required state diagram. (Note that only the main sequence is shown as the
unused states are not important in this problem.)

Step 2: Draw the next-state table. Four flip-flops are required because of the number of bits used
in the sequence.

Step 3: Using the next-state and transition tables, draw the Karnaugh maps for each flip-flop. For
example, in state 1, note that QD and QC do not change in going to the next state. The transition
is 0 to 0. From the transition table, a 0 to 0 transition requires 7 = 0 and K = X. These values are
entered onto the maps for the D and C counters in the square that represents state 1. Unused
states are mapped as Xs. Only the D and C maps are shown in this example. (Note: QA and QB
are positioned to make the map below easier to read.)

Figure 9-3

Figure 9-4

Department of Electronic Engineering, Faculty of Engineering & Technology, IIUI Page 46


Digital Logic Design Lab No.9 Design of Synchronous Counter

Report for Experiment 9

Objectives:
 Design a synchronous counter with up to 16 states in any selected order.
 Construct and test the counter. Determine the state diagram of the counter.

Data and Observations:

Circuit Design:

Department of Electronic Engineering, Faculty of Engineering & Technology, IIUI Page 47

You might also like