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.
4
00 01
1011
0
0
0
10 1
1
1
Present State Inputs Next State
Q1 Q0 X Q1 Q0
0 0 0 0 1
0 0 1 1 1
0 1 0 1 0
0 1 1 0 0
1 0 0 1 1
1 0 1 0 1
1 1 0 0 0
1 1 1 1 0
.
-
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
13
J
K
Q
Q’
1
0
1
->1
->0
->0
->1
Binary Up Counter (cont..)
J-K Flip Flop Will Be Negatively Triggered
For UP Counter
14Positive TriggeringNegative Triggering
Up Counters
15
J
K
Q
Q’
J
K
Q
Q’
J
K
Q
Q’
J
K
Q
Q’
1
Positive TriggeringNegative Triggering
State Diagram & Truth Table Of Up Counters
16
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
Truth Table For 4 Bit Up Counter
Down Counters
17
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.
Binary Down Counters
18
J
K
Q
Q’
J
K
Q
Q’
J
K
Q
Q’
J
K
Q
Q’
1
Positive TriggeringNegative Triggering
Truth Table Of 4 Bit Down Counters
19
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
Truth Table For 4 Bit Down Counter
Binary Up/Down Counters
20
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.”
Up/Down Counters
21
J
K
Q
Q’
1
J
K
Q
Q’
J
K
Q
Q’
J
K
Q
Q’
1
1 = up counter
0 = down counter
27
22
Any Questions?
23
24

Counters

  • 2.
  • 3.
    Counters – 4Bit Up/Down Counters BY : • UMAIR KHAN
  • 4.
    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
  • 5.
    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
  • 6.
    Why Do WeNeed 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
  • 7.
    A Slightly FancierCounter 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
  • 8.
    Complete State DiagramAnd Table Here’s the complete state diagram and state table for this circuit. 4 00 01 1011 0 0 0 10 1 1 1 Present State Inputs Next State Q1 Q0 X Q1 Q0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 0 0 1 1 0 0 1 0 0 1 1 1 0 1 0 1 1 1 0 0 0 1 1 1 1 0
  • 9.
  • 10.
    Microwave Oven • Inour 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
  • 11.
    Washing Machine • Wealso 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
  • 12.
    Auditorium • To calculatethe 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
  • 13.
    Parking Lot A countermay 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
  • 14.
    Other Applications • Frequencycounters • Digital clocks • System clocks • Counting events • Watches , clocks , alarms • Sequence control • Analog to digital converter 9
  • 15.
    Ripple Counters Ripple Counters: “Aripple 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
  • 16.
    What is BinaryUp 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
  • 17.
    Binary Up Counter(cont..) We will use J-K Flip Flop to implement 4 Bit Up Counter. 12
  • 18.
    Why we useJ-K Flip Flop? Because It is a property of J-K flip flop that whenever 1,1 input is given it toggles the output 13 J K Q Q’ 1 0 1 ->1 ->0 ->0 ->1
  • 19.
    Binary Up Counter(cont..) J-K Flip Flop Will Be Negatively Triggered For UP Counter 14Positive TriggeringNegative Triggering
  • 20.
  • 21.
    State Diagram &Truth Table Of Up Counters 16 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 Truth Table For 4 Bit Up Counter
  • 22.
    Down Counters 17 Down Counters: Abinary 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.
  • 23.
  • 24.
    Truth Table Of4 Bit Down Counters 19 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 Truth Table For 4 Bit Down Counter
  • 25.
    Binary Up/Down Counters 20 BinaryUp/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.”
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.

Editor's Notes

  • #20 Population of china is 1.3 billion 1Ghz = 1 billion clock cycles, population of world is 7.6 billion
  • #21 Negatively triggered