Counter
Counter
Chapter 1 : WEEK 2
Asynchronous counter
❑ Up-counter
❑ MOD counter
❑ Decade counter
Synchronous counter
❑ Up-counter
❑ Irregular binary counter
❑ Synchronous mod counter
❑ Up/down (bidirectional) synchronous counter
❑ Cascaded counter
❑ Decade counter & BCD counter
❑ Counter decoding
2
Introduction
Counter
◼ A counter is a type of sequential logic circuit consisting of a set of flip-
flops which can go through a sequence of states.
◼ Its function is to count the input pulses (clock signal) and store the
result till the arrival of the next signal.
◼ The counting process, therefore consists of a series of storage and
addition operations.
◼ The counters are built from flip-flops and of gate circuits.
3
Counters
High Speed
Slow speed
4
Classification of counters (cont.)
◼ According to the direction of counting:
❑ up counter
❑ down counter
❑ Up-down counter
6
Introduction (continue)
7
Asynchronous counter
◼ Also known as ripple counter. Ripple counters are the
simplest type of binary counters because they require
the fewest components to produce a given counting
operation.
◼ Each FF output drives the CLK input of the next FF.
◼ FFs do not change states in exact synchronism with the
applied clock pulses.
◼ There is delay between the responses of successive
FFs.
◼ It is also often referred to as a ripple counter due to the
way the FFs respond one after another in a kind of
rippling effect.
8
Up counter and down counter for negative
edge clock
1
Q0 Q1 Q2
J Q J Q J Q
CLK
Q0 Q1 Q2
J Q J Q J Q
CLK
9
Up counter and down counter for positive
edge clock
1
Q0 Q1 Q2
J Q J Q J Q
CLK
Q0 Q1 Q2
J Q J Q J Q
CLK
10
Asynchronous Counter Operation
11
Asynchronous Counter Operation (continue..)
0 1 0 1 0
0 0 1 1 0
12
Asynchronous Counter Operation (continue..)
13
A 3-bit Asynchronous Binary Counter
Is this FF an up
counter or down
counter?
Which FF is MSB?
14
A 3-bit Asynchronous Binary Counter (continue..)
15
Disadvantages of asynchronous counter: Propagation Delay
Propagation delay occurs through FF0 cause Q0 lags some time compare to CLK
This effect ‘ripples’ the next FF resulting Q1 delay some time from Q0
The cumulative delay of asynchronous counter is the major disadvantage of this
counter in many applications.
It limits the rate at which the counter can be clocked and creates decoding problems.
The maximum cumulative delay in a counter must be less than the period of the clk
waveform.
16
Disadvantages of asynchronous
counter (continue)
◼ Asynchronous counters are not useful at very
high frequencies, especially for counters with
large number of bits.
◼ Another problem caused by propagation
delays in asynchronous counters occurs
when we try to electronically detect (decode)
the counter’s output states.
17
Disadvantages of asynchronous
counter (continue)
◼ Eg: If you look closely at the figure below, for a short period of time (50ns) right after state 011,
you see that state 010 occurs before 100.
◼ This is obviously not the correct binary counting sequence and while the human eye is much too
slow to see this temporary state, our digital circuits will be fast enough to detect it.
◼ These erroneous count patterns can generate what are called glitches in the signals that are
produced by digital systems using asynchronous counters. In spite of their simplicity, these
problems limit the usefulness of asynchronous counters in digital applications.
glitch
18
Exercise: A 4-bit Asynchronous Binary Counter
Draw the timing diagram for 4-bit asynchronous up counter given below
19
A 4-bit Asynchronous Binary Counter (Continue)
◼ Each flip-flop has a propagation delay for 10ns. Determine the total propagation
delay time from the triggering edge of a clock pulse until a corresponding
change can occur in the state of Q3. Also determine the maximum clock
frequency at which the counter can be operated.
Answer:
For the total delay time, the effect of CLK8 or CLK16 must propagate through 4
flip-flops before Q3 changes.
* The counter should be operated below this frequency to avoid problems due to
the propagation delay.
20
Asynchronous MOD counter
◼ MOD number is generally equal to the number
of states that the counter goes through in each
complete cycle before it recycles back to its
starting state.
◼ MOD number can be increased simply by
adding more FFs to counter. MOD number = 2N
◼ The 2-bit ripple counter is called as MOD-4
counter and 3-bit ripple counter is called as
MOD-8 counter. So in general, an n-bit ripple
counter is called as modulo-N counter. Where,
MOD number = 2n.
21
Asynchronous MOD counter (cont.)
◼ Example
❑ A photocell and light source combination is used
to generate a single pulse each time an item
crosses its path. The counter must be able to
count as many as 1000 items. How many FFs are
required?
ans.)
2n = 1000
n = log1000/log2
= 10 FFs
22
Asynchronous MOD counter (cont.)
◼ Type of modulus:
❑ 2-bit up or down (MOD-4)
❑ 3-bit up or down (MOD-8)
Full sequence
❑ 4-bit up or down (MOD-16) counter
→ Ideal for use in frequency division
23
Asynchronous MOD counter (cont.)
◼ We can create truncated counter using
combinational logic gates.
◼ Eg: We can take the modulo-16 (4 FFs)
asynchronous counter and modified it with
additional logic gates it can be made to give a
decade (divide-by-10) counter output for use
in standard decimal counting and arithmetic
circuits.
24
Asynchronous Decade Counter (BCD counter/MOD-10 counter)
Counters can be designed to have a number of states in their sequence that
is less than the maximum of 2N. This type of sequence is called a truncated
sequence.
For example, asynchronous modulus ten (MOD-10) counter or decade
counter Partial
decoding
0 1 0 1
25
Asynchronous Decade Counter (continue..)
Timing diagram and binary state sequence for decade counter
26
Frequency Division
27
Frequency Division (continue)
◼ E.g: in a MOD-16 counter, the output from the last FF
will have a frequency of 1/16 of the input clock
frequency. Thus, it can also be called a divide-by-16
counter. Likewise, a MOD-8 counter has an output
frequency of 1/8 the input frequency; it is a divide-by-8
counter.
28
Example
29
Example: MOD counter
Determine the MOD number of the counter in the figure
below. Also determine the frequency at the D output.
30
Example: MOD counter (cont.)
The MOD-10 counter below will count from 0000 through
1001. Determine the frequency at the D output.
31
Exercise (cont.)
34
Answer:
1
0 1 0 0
Q0 Q1 Q2 Q3
J CLR Q J CLR Q J CLR Q J CLR Q
CLK
K PRE
Q' K PRE
Q' K PRE Q' K PRE Q'
35