Professional Documents
Culture Documents
Topics
Asynchronous counter
Synchronous counter
Design of synchronous counter
Counter applications
Counter
Counter a group of flip-flops that are connected together to perform
counting operations.
Counters are categorized into two categories based on the way they
are clocked:
Asynchronous counter (or known as ripple counters)
the first flip-flop is clocked by the external clock pulse and then each
successive flip-flop is clocked by the output of the preceding flip-flop
do not have a common clock pulse
flip-flops within the counter do no change states at exactly the same
time
Synchronous counter
the clock input is connected to all the flip-flops so that they are
clocked simultaneously by a common clock pulse
Asynchronous counters
Clk Q0
/Q0 Q1
LSB
Clk
Q0
/Q0
Q1
/Q1
Q2
Clk no.
Clk
Q0 Q1 Q2 Q3
Clk no.
Clk
Q0
Q1 Q2 Q3
10
11
12
13
14
15
16
Propagation delay
Asynchronous counters are known as ripple counters because the effect of
the input clock pulse does not affect all the outputs of the flip-flops
simultaneously but ripples through the counter due to propagation delay.
Q1 is delayed by 1 delay
Q2 is delayed by 2 delays
Q3 is delayed by 3 delays
Modulus of a counter
modulus of a counter number of unique states through which the counter will
sequence
maximum modulus the maximum possible of states of a counter is 2n, where n
is the number of flip-flops in the counter
truncated sequence the number of states with a sequence less than the
maximum of 2n
decade counter a counter with ten states in their sequence (MOD10). A
common modulus for counters
binary coded decimal (BCD) decade counter a decade counter with a count
sequence of zero (0000) through (1001). The ten-state sequence produce the
BDC code
to obtain a truncated sequence, it is necessary to force the counter to recycle
before going through all its possible states (e.g. a BCD counter must recycle back
to 0000 after 1001 state)
/CLR
10
10
glitch
A glitch on Q1 waveform because Q1 must first go HIGH before the count of
ten can be decoded. When the counter goes into the count of ten (1010), the
output of the NAND gate goes LOW.
Thus, the counter is in the 1010 state for a short time before it is RESET to
0000, thus producing a glitch on Q1 and /CLR line.
Show how an asynchronous counter can be implemented having a modulus
of 14 with a straight binary sequence from 0000 through 1101.
Answer
An asynchronous counter having a modulus of 14 with a
straight binary sequence from 0000 through 1101.
Logic diagram
modulus-8 counter
(a)
(b)
Answer
counter
Timing details
J0 = K0 =1
J1 = K1
J0 = K0
NC
Toggle
Toggle
Toggle
NC
Toggle
Toggle
Toggle
NC
Toggle
Timing diagram
Timing diagram
1. Determine
the flip-flop
input equations
No.
Outputs
Flip-flops inputs
Q0 Q1 Q2 Q3
J0 = K0 = 1
J1 = K1 = Q0
J2 = K2 = Q0Q1
J2 = K2 = Q0Q1Q2
No.
Outputs
Flip-flops inputs
Q 0 Q1 Q2 Q 3
J0 = K0 = 1
J1 = K1 = Q0
J2 = K2 = Q0Q1
J2 = K2 = Q0Q1Q2
10
11
12
13
14
15
16
Clk
Outputs
Flip-flops inputs
Q0 Q1 Q2 Q3 J0 = K0 = 1
J1 = K1 = Q0Q3
J2 = K2 = Q0Q1
J2 = K2 =
Q0 Q1 Q2 + Q0 Q3
B4
Outputs
Flip-flops inputs
Q0 Q1 Q2 Q3 J0 = K0 = 1
J1 = K1 = Q0Q3
J2 = K2 = Q0Q1
J2 = K2 =
Q0 Q1 Q2 + Q0 Q3
10
No glitch is observed
in Q1 waveform for
the synchronous
decade counter
This counter can be synchronously preset to any 4-bit binary number by applying
the proper levels to the parallel data inputs.
When a LOW is applied to the LOAD input, counter will assume the state of the
data inputs on the next clock pulse. Thus, the counter sequence can start with any 4bit binary number.
An active-LOW CLR input synchronously resets all four flip-flops in the counter.
The two enable inputs, ENP and ENT must both be HIGH for the counter to
sequence through its binary states.
The ripple clock output (RCO) goes HIGH when the counter reaches the last state in
its sequence of fifteen, called the terminal count (TC = 15). This output, in
conjunction with the enable inputs, allows these counters to be cascaded for higher
count sequences.
Question:
How do you connect this counter to
count from 4 to 11?
State diagram
A graphical representation of the progression of states through which the
circuit advances when it is clocked
For example, the state diagram for a 3-bit up/down binary counter that
counts from the binary states of 0 to 7 when X (user selection) is HIGH and
counts from binary states of 7 to 0 when X is LOW is
Directed line
(transition from
the present state to
the next state)
Input during
present state
(labeled along the
directed line)
The derivation of state table consists of first listing all possible binary combinations of
present states and inputs
For example, the state table for the 3-bit up/down binary counter that counts from the
binary states from 0 to 7 when X (user selection) is HIGH and counts from 7 to 0
when X is LOW is given as
Present state
Next state
X=0
X=1
Present state
Next state
Y=0
Q2 Q1
1. State diagram
The up-down selection by
the user is represented by a
variable Y
Y=1
2. State table
Q Q+ J
Next state
Y=0
Q2 Q1
Flip-flop inputs
Y=1
Y=0
Y=1
J2K2J1K1J0K0
J2K2J1K1J0K0
1X1X1X
0X0X1X
0X0XX1
0X1XX1
0XX11X
0XX01X
0XX0X1
1XX1X1
X11X1X
X00X1X
X00XX1
X01XX1
X0X11X
X0X01X
X0X0X1
X1X1X1
4. State table for a 3-bit up-down synchronous counter with J-K flip-flops
01
11
QY
10 Q Q 0 00
2 1
00 1
0
01
11
10
QY
10 Q Q 0 00
2 1
00 1
0
01
11
01
01
01
11
11
11
10
10
10
01
11
10
J2 = Q0Q1Y + Q0Q1Y
Q0Y
00
Q2Q1
00 X
J1 = Q0Y + Q0Y
J0 = 1
01
01
Q0Y
10 Q2Q1 00
00 X
X
01 X
0
11
11
11
10
10
10
01
11
QY
10 Q Q 0 00
2 1
00 X
X
K2 = Q0Q1Y + Q0Q1Y
01
11
K1 = Q0Y + Q0Y
K0 = 1
FF2
FF1
FF0
J2 = K2 = Q0Q1Y + Q0Q1Y
J1 = K1 = Q0Y + Q0Y
J0 = K0 = 1
6. Counter implementation
Q+
Next state
Y=0
Flip-flop inputs
Y=1
Y=0
Y=1
Q0Y
Q2Q1 00
00 1
01
1
11
1
Q0Y
10 Q2Q1 00
1
00 1
01
0
11
1
QY
10 Q Q 0 00
2 1
00 1
0
01
0
11
10
01
01
01
11
11
11
10
10
10
T0 = 1
T1 = Q0Y + Q0Y
T2 = Q0Q1Y + Q0Q1Y
Decimal
Binary
Gray code
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
0000
0001
0011
0010
0110
0111
0101
0100
1100
1101
1111
1110
1010
1011
1001
1000
Newly added
1. State diagram
Q2
Q1
Q Q+ J
0 X
1 X
FF2
FF1
FF0
J0 = Q2Q1 + Q2Q1
J1 = Q2Q0
J2 = Q1Q0
K0 = Q2Q1 + Q2Q1
K1 = Q2Q0
K2 = Q1Q0
6. Counter implementation
Unused states
In all the previous examples, all the three / four bit combinations were
used in the state assignment.
With p bits, the number of states, s, that can be coded is 2p-1 < s <= 2p
In general, when coding s states with p bits, some binary information are
not assigned to any state (unused states). Hence, the Karnaugh maps (Kmaps) constructed from the next-state table have no entries.
When a network is initially started, the network may enter one of the
unused states, for example, as a result of noise or some hardware failure.
self-correcting - the counter in which all the states are not included in the
original counting sequence eventually lead to the normal counting
sequence after one or more count pulses applied to the control input
To avoid a counter hanged-up, it should always be designed as selfcorrecting
There are two approaches to design networks with unused states i.e.:
replace the unused entries in K-maps with dont cares (X) (however,
the designed counter is not necessarily self-correcting) or
to ensure that the counter always go to a well-defined state, specify a
valid next-state entry for each of the unused state
1. State diagram
There are two unused states
i.e. 011 and 111
QA
QB
Next-state
QC QA+
QB+
QC+
2. Next-state table
dont cares
QB
Next-state
QC QA+
Flip-flop inputs
QB+
QC+
DA
DB
DC
0 X X 1
DA+ = QAQB + QAQB
QAQB
QC
00
0 0
1
QAQB
QC
00
0 1
1
01
0
11 10
0 0
X X
DB+ = QC
01 11 10
0 0 1
X
DC+ = QBQC
5. Counter implementation
Outputs
Flip-flop inputs
QA
QB
QC
Next state
DA =
DB =
DC =
QAQB+QAQB
QC
QBQC
QA+
QB+
QC+
The next state is the same as the flip flop inputs for D flipflops
Newly added
1. State diagram
There are two unused states
i.e. 011 and 111
QA
QB
Next-state
QC QA+
QB+
QC+
2. Next-state table
Initialize the unused states with 000 state
Modulus of a counter
modulus of a counter number of unique states through which the counter will
sequence
maximum modulus the maximum possible of states of a counter is 2n, where n
is the number of flip-flops in the counter
truncated sequence the number of states with a sequence less than the
maximum of 2n
decade counter a counter with ten states in their sequence (MOD10). A
common modulus for counters
binary coded decimal (BCD) decade counter a decade counter with a count
sequence of zero (0000) through (1001). The ten-state sequence produce the
BDC code
to obtain a truncated sequence, it is necessary to force the counter to recycle
before going through all its possible states (e.g. a BCD counter must recycle back
to 0000 after 1001 state)
1. State diagram
The counter only uses SIX (6) out
of the EIGHT (8) available states.
States 110 and 111 are not used in
the design
Next-state
2. Next-state table
Dont cares (X)
Q+
TA
TB
TC
QAQB
QC
00
0 1
01 11 10
1 X 1
1
1
TC+ = 1
DA
DB
DC
Q Q+
0
1 X 0
DA+ = QAQC + QBQC
QAQB
QC
00
0 0
1
01 11 10
1 X 0
QAQB
QC
00
0 1
01 11 10
1 X 1
1 0
0 X
0 X 0
DC+ = QC
DB+ = QAQBQC + QBQC
6. Counter implementation
Timing Diagram
Newly added
Q3 Q 2 Q 1 Q 0
Asynchronous cascading
An example of a 2-bit and a 3-bit ripple counter connected in cascade. The
final output of the modulus-8 counter, Q4, occurs once for every 32 input
clock pulses. The overall modulus of the two cascaded counters is 4 8 =
32; that is, they act as a divide-by-32 counter.
Cascade: arrange (a
number of devices or
objects) in a series or
sequence
Synchronous cascading
The terminal count (TC) output of counter 1 is connected to the count enable
(CTEN) input of counter 2.
TC output of counter 1 goes HIGH when counter 1 completed the entire cycle
(when counter 1 reaches its terminal count).
This HIGH enables counter 2 that goes from its initial state to its 2 nd state.
Upon completion of the entire second cycle of counter 1 (when counter 1 reaches
terminal count the second time), counter 2 is again enabled and advances to its next
state. This sequence continues.
Since these are decade counters, counter 1 must go through ten complete cycles
before counter 2 completes its first cycle i.e., for every ten cycles of counter 1,
counter 2 goes through one cycle.
Thus, counter 2 will complete one cycle after one hundred clock pulses.
The overall modulus of these two cascaded counters is 10 10 = 100.
Counter decoding
To decode a binary state 6 (110) of a 3-bit binary counter, the outputs of Q2,
Q1, and Q0 are connected to the input of a AND gate.
A HIGH appears on the output of the decoding gate, indicating that the
counter is at state 6. This is called active-HIGH decoding.
Replacing the AND gate with a NAND gate provides active-LOW decoding.
Question: How do you connect the circuit to decode a binary state 5 and 0?
Counter applications
Digital clock
Automobile parking
Parallel-to-Serial Data Conversion (Multiplexing)
Digital clock
A divide-by-60 counter
The counter counts from 0 to 59 and then recycle to 0
The divide-by-10 portion is formed with a synchronous decade counter
The divide-by-6 portion is formed with a decade counter with a truncated
sequence achieved by using the decoder count 6 to asynchronously clear the
counter.
The terminal count, 59, is also decoded to enable the next counter in the
chain.
**Q0 = LSB
**Q3 = MSB
Automobile parking
The use of an up/down counter to monitor the available spaces in a onehundred space parking garage and provide for an indication of a full
condition by illuminating a display sign and lowering a gate bar at the
entrance.
The system consists of optoelectronic sensors at the entrance and exit of the
garage, an up/down counter and associated circuitry, and an interface circuit
that uses the counter output to turn the FULL sign on or off as required and
lower or raise the gate bar at the entrance.
Up/down counter
Optoelectronic sensors
The up/down counter is initially preset to 0 using the parallel data inputs
Each automobile entering the garage activates a light sensor that produces an
electrical pulse (positive pulse).
This electrical pulse SETs the S-R latch. The LOW on the output of the latch puts
the counter in the UP mode. Also, the electrical pulse goes through the NOR gate
and clocks the counter on the LOW-to-HIGH transition counter is increased by 1
When the one-hundredth automobile enters, the counter goes to its last state
(10010). The MAX/MIN output goes HIGH and activates the interface circuit which
lights the FULL sign and lowers the gate bar.
When an automobile exits, the optoelectronic sensor produces a positive pulse,
which RESETs the S-R latch and puts the counter in the DOWN mode counter is
decreased by 1
If the garage is full and an automobile leaves, the MAX/MIN output of the counter
goes LOW, turning off the FULL sign and raising the gate.
Multiplexer
Multiplexing conversion of the parallel data bits to serial data bits on the
single transmission line.
parallel data - a group of bits appearing simultaneously on parallel lines
serial data - a group of bits appearing on a single line in a time sequence
Parallel-to-serial conversion is generally accomplished using a counter to
provide a binary sequence for the data-select inputs of a data
selector/multiplexer.
An example of the Q outputs of the modulus-8 counter connected to the
data-select inputs of an 8-bit multiplexer.