You are on page 1of 30

2

Counters – 4 Bit Up/Down Counters


BY :
• UMAIR KHAN
Table Of Contents

• Counters.
• Need of Counters.
• Practical Application Of Counters.
• Ripple Counter.
• Up Counters.
• Down Counters.
• Bidirectional UP/Down Counters.
• Demo On Proteus.
0
What is Counter ?

Counters are the crucial hard ware components, and are


defined as:
“The digital circuit which is used to count the number
of pulses”.

 Counters are well known to us as “Timers”.


 Counter circuits are the best example for the flip flop
applications.
 Counters are designed by grouping of flip flops and
applying a single clock signal to them.
1
Why Do We Need Counter ?

• Counting means incrementing or decrementing the values of an


operator, with respect to its previous state value.
• So to perform the mathematical operation we use no devices
other than counters.
• We cannot perform this action (counting) with any other logic
devices rather than counters

2
A Slightly Fancier Counter

Let’s try to design a slightly different two-bit counter:


• Again, the counter outputs will be 00, 01, 10
and 11.
• Now, there is a single input, X. When X=0, the
counter value should increment on each clock
cycle. But when X=1, the value should
decrement on successive cycles.
We’ll need two flip-flops again. Here are the four
possible states:
3
Complete State Diagram And Table

Here’s the complete state diagram and state table for this
circuit.
Present State Inputs Next State
Q1 Q0 X Q1 Q0
0
00 01 0 0 0 0 1
1 0 0 1 1 1
0 1 0 1 0
0 1 1 0
0 1 1 0 0
1 0 0 1 1
1
11 10
1 0 1 0 1
0 1 1 0 0 0
1 1 1 1 0
4
.

-
Microwave Oven

• In our kitchen appliances, we use


microwave ovens.
• In that we set some temperature to heat
the food item kept in it. Internally the
counter calculates the increase or decrease
in temperature and time.
• If it reaches the pre-set temperature, then
it prevents from further heating and
spoiling of that food item
5
Washing Machine

• We also use counters in washing machines.


• Similar to the counting operation in microwave
oven, the counter in washing machine counts the
time which we set it to operate.
• In both microwave oven and washing machine, we
set the device to particular time, and it starts
decreasing for every second. When the value of
counter becomes zero, it activates the switch ON /
OFF. Thus the operation of the device is controlled
by counters
6
Auditorium

• To calculate the number of people entering and leaving a


stadium or auditorium we use , counters at entry gate or
door.
• These counters will count the persons. For entry of each
person, the value of counter increases by 1.
• In the same manner, for every leaving of each
person, the counter value decreases by 1
7
Parking Lot

A counter may be used to keep track of Vehicle in a parking lot .


As the vehicle enters the lot through an entrance gate ,the
counter counts up. As Vehicles exit the lot through an exit gate ,
the counter counts down. When the lot is full a sign at the
entrance gate turn on indicating the lot is full .

8
Other Applications

• Frequency counters
• Digital clocks
• System clocks
• Counting events
• Watches , clocks , alarms
• Sequence control
• Analog to digital converter

9
Ripple Counters

Ripple Counters:
“A ripple counter is an asynchronous
counter where only the first flip-flop is clocked by
an external clock.”

• All subsequent flip-flops are clocked by the


output of the preceding flip-flop.
• Asynchronous counters are also called ripple-
counters because of the way the clock pulse
ripples it way through the flip-flops.” 10
What is Binary Up Counters ?

Binary Up Counters:
“ A binary counter which count in increasing order is called
a binary up-counter. In this, the binary count is incremented by 1
with every input count pulse.”

11
Binary Up Counter (cont..)

We will use J-K Flip Flop to implement


4 Bit Up Counter.

12
Why we use J-K Flip Flop?

Because It is a property of J-K flip flop that whenever


1,1 input is given it toggles the output
1

0 ->1 ->0
J Q

1 ->0 ->1
K Q’

13
Binary Up Counter (cont..)

J-K Flip Flop Will Be Negatively Triggered


For UP Counter

Negative Triggering Positive Triggering 14


Up Counters

J Q J Q J Q J Q

K Q’ K Q’ K Q’ K Q’

Negative Triggering Positive Triggering 15


State Diagram & Truth Table Of Up Counters

Truth Table For 4 Bit Up Counter


D C B A
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1
16
Down Counters

Down Counters:
A binary counter with a reverse count is called a binary
down-counter. In this, the binary count is decremented by 1 with
every input count pulse.

17
Binary Down Counters

J Q J Q J Q J Q

K Q’ K Q’ K Q’ K Q’

Negative Triggering Positive Triggering 18


Truth Table Of 4 Bit Down Counters

Truth Table For 4 Bit Down Counter


D C B A
15 1 1 1 1
14 1 1 1 0
13 1 1 0 1
12 1 1 0 0
11 1 0 1 1
10 1 0 1 0
9 1 0 0 1
8 1 0 0 0
7 0 1 1 1
6 0 1 1 0
5 0 1 0 1
4 0 1 0 0
3 0 0 1 1
2 0 0 1 0
1 0 0 0 1
0 0 0 0 0

19
Binary Up/Down Counters

Binary Up/Down Counters:


“ A binary counter which count either in increasing
order or decreasing order depending upon the selection line
is called a binary up/down-counter.”

20
Up/Down Counters

J Q J Q J Q J Q

K Q’ K Q’ K Q’ K Q’

1 = up counter
0 = down counter

21
27
22
Any Questions?

23
24

You might also like