Professional Documents
Culture Documents
PRACTICAL: 15
TO STUDY COUNTERS
1.0 AIM :
3.0 INTRODUCTION :
61 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
An asynchronous (ripple) counter is a single D-type flip-flop, with its D (data)
input fed from its own inverted output.
This circuit can store one bit, and hence can count from zero to one before it
overflows (starts over from 0).
This counter will increment once for every clock cycle and takes two clock cycles
to overflow, so every cycle it will alternate between a transition from 0 to 1 and a
transition from 1 to 0.
This creates a new clock with a 50% duty cycle at exactly half the frequency of
the input clock.
If this output is then used as the clock signal for a similarly arranged D flip-flop
(remembering to invert the output to the input), you will get another 1 bit
counter that counts half as fast. Putting them together yields a two bit counter:
You can continue to add additional flip-flops, always inverting the output to its
own input, and using the output from the previous flip-flop as the clock signal.
The result is called a ripple counter, which can count to 2n -1 where n is the
number of bits (flip-flop stages) in the counter.
Ripple counters suffer from unstable outputs as the overflows "ripple" from stage
to stage, but they do find frequent application as dividers for clock signals, where
the instantaneous count is unimportant, but the division ratio overall is.
The use of flip-flop outputs as clocks leads to timing skew between the count data
bits, making this ripple technique incompatible with normal synchronous
circuit design styles.
62 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
This circuit would yield the following output waveforms, when "clocked" by
a repetitive source of pulses from an oscillator:
63 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
For example, bit 1 toggles when bit 0 is logic high; bit 2 toggles when both bit 1
and bit 0 are logic high; bit 3 toggles when bit 2, bit 1 and bit 0 are all high; and
so on.
The only way we can build such a counter circuit from J-K flip-flops is to connect
all the clock inputs together, so that each and every flip-flop receives the exact
same clock pulse at the exact same time:
64 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
Each of the higher-order flip-flops are made ready to toggle (both J and K
inputs "high") if the Q outputs of all previous flip-flops are "high."
Otherwise, the J and K inputs for that flip-flop will both be "low," placing it
into the "latch" mode where it will maintain its present output state at the
next clock pulse.
Since the first (LSB) flip-flop needs to toggle at every clock pulse, its J
and K inputs are connected to Vcc or Vdd, where they will be "high" all the
time.
The next flip-flop need only "recognize" that the first flip-flop's Q output is
high to be made ready to toggle, so no AND gate is needed.
65 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
Since each J-K flip-flop comes equipped with a Q' output as well as a Q
output, we can use the Q' outputs to enable the toggle mode on each
succeeding flip-flop, being that each Q' will be "high" every time that the
respective Q is "low:".
Taking this idea one step further, we can build a counter circuit with
selectable between "up" and "down" count modes by having dual lines of
AND gates detecting the appropriate bit conditions for an "up" and a
"down" counting sequence, respectively, then use OR gates to combine
the AND gate outputs to the J and K inputs of each succeeding flip-flop:
66 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
The Up/Down control input line simply enables either the upper string or
lower string of AND gates to pass the Q/Q' outputs to the succeeding
stages of flip-flops.
If the Up/Down control line is "high," the top AND gates become enabled,
and the circuit functions exactly the same as the first ("up") synchronous
counter circuit shown in this section.
If the Up/Down control line is made "low," the bottom AND gates become
enabled, and the circuit functions identically to the second ("down"
counter) circuit shown in this section.
67 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
At the first pulse, the 1 shifts from Q3 to Q2 and the counter is in the
0100 state. The next pulse produces the 0010 state and the third, 0001.
At the fourth pulse, the 1 at Q0 is transferred back to Q3, resulting in the
68 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
1000 state, which is the initial state. Subsequent pulses will cause the
sequence to repeat, hence the name ring counter.
The ring counter above functions as a MOD-4 counter since it has four
distinct states and each flip-flop output waveform has a frequency equal
to one-fourth of the clock frequency.
A ring counter can be constructed for any MOD number. A MOD-N ring
counter will require N flip-flops connected in the arrangement as the
diagram above.
A ring counter requires more flip-flops than a binary counter for the same
MOD number. For example, a MOD-8 ring counter requires 8 flip-flops
while a MOD-8 binary counter only requires 3 (23 = 8).
In fact, ring counters can be decoded without the use of logic gates. The
decoding signal is obtained at the output of its corresponding flip-flop.
For the ring counter to operate properly, it must start with only one flip-
flop in the 1 state and all the others at 0.
One way to do this is to apply a pulse to the PRESET input of one of the
flip-flops and the CLEAR inputs of all the others. This will place a single 1
in the ring counter.
7.0 EXERCISE :
7.1 What is meant by DUTY CYCLE?
Ans:
69 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
Ans:
Ans:
7.4 State the reason, why Asynchronous Counter are called Ripple counter?
Ans :
7.5 What is the basic design difference between Asynchronous counter and
Synchronous counter?
Ans :
70 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
8.0 ASSIGNMENT :
71 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))