Counters
What is a Counter?
Non Technical Definition
• A digital device which stores number of times
a particular event or process has occurred.
• This device counts the occurrence of events
with the help of multiple states
• Just like registers, we use basic storage
elements i.e. Flip-Flops to design counters.
• We can also display the stored count.
Technical Definition
• A register that goes through a prescribed
sequence of distinct states upon the
application of a sequence of input pulses
• Input pulses may be
– Clock pulses
– Originate from some other source
– May occur at regular or irregular interval of time
Binary Counter
• Counter that follows the binary number
sequence is called binary counter
• An n-bit binary counter consists of n flip-flops
and can count in binary from 0 through 2n
-1
• For example a counter which produces a
sequence of numbers like 00, 01, 10, 11 is a
binary counter.
Types of Counters
• Based upon type of clock, counters are of
following 2 types:
1. Asynchronous Counters.
2. Synchronous Counters.
Types of Counters
• Depending on the way in which the counting
progresses the Asynchronous and
Synchronous counters are classified as follows:
1. Up Counters
2. Down Counters
3. Up-Down Counters
4. Decade Counter.
Asynchronous Counters
A counter in which the flip-flops (FF) within the
counter do not change states at exactly the same
time because they do not have a common clock
pulse.
OR
A counter in which C input of some of the flip-flops are
triggered not by common pulse but rather by the
transitions that occur on other flip-flop outputs
e.g. Ripple counters
Synchronous Counters
A synchronous counter is one in which all the flip-
flops in the counter are clocked at the same time
by a common clock pulse
OR
In which the C inputs of all flip-flops receive common
pulse.
Designing Asynchronous Counters
2 bit Asynchronous Binary UP Counter
State table
Timing Diagram
3 bit Asynchronous Binary UP Counter
State Table
Timing Diagram
4-bit Ripple Up Counter
What will be the state of counter on positive edge after 1111?
4-bit Ripple Counter
• Design a 4-bit ripple
counter for downward
counting
Can you design an asynchronous Up-Down
Counter with Selection Input?
4-bit Ripple Down Counter
Uses of Ripple Counter
• Propagation delay makes them less efficient
and slow.
• Used to measure
– Time, frequency, distance, speed
• Also used in
– Frequency division, direct counting, digital
computers
Designing Synchronous Counters
Synchronous 3-bit Up-Down Counter
For S=0
Count Upward
For S=1
Count Downward
Serial Counter
• A counter which is constructed with sequential
arrangement of flip-flops with the help of half
adders which provides information to each
stage about the state of the prior stages.
• If all the flip-flops are connected with same
clock , this type of arrangement is Synchronous
arrangement otherwise it is Asynchronous.
4-Bit Synchronous Binary Counter
Serial Counter
EN
Q0(t)
Q1(t)
Q2(t)
Q3(t)
Q0(t+1)
Q1(t+1)
Q2(t+1)
Q3(t+1)
HA HA HA HA
Half Adder
Serial Counter
Serial Counter
Half Adders
Serial Counter
S0
S1
S2
S3
C1
C2
C3
C4
Serial Counter
If EN = 0, Hold Data
If EN = 1, Increment by 1
How Serial Counter Works?
0
1
0
0
Value at time t = 0010
What will be the value at time t+1
1
How Serial Counter Works?
0
1
0
0
1
Qi outputs coming to
XORs and ANDs
How Serial Counter Works?
0
1
0
0
1
1
0
How Serial Counter Works?
0
1
0
0
1
1
0
1
0
How Serial Counter Works?
0
1
0
0
1
1
0
1
0
0
0
How Serial Counter Works?
0
1
0
0
1
1
0
1
0
0
0
0
0
How Serial Counter Works?
0
1
0
0
1
1
0
1
0
0
0
0
0
Value of this AND depends
On three ANDs in previous
Levels of gating
How Serial Counter Works?
0
1
0
0
This data will be
available at next tick
1
1
0
1
0
0
0
0
0
How Serial Counter Works?
1
1
1
0
0
Parallel Counter
Clock
How Parallel Counter works?
Clock
Value at time t = 0010
What will be the value at time t+1
0
1
0
0
1
How Parallel Counter works?
Clock
0
1
0
0
1
How Parallel Counter works?
Clock
0
1
0
0
1
0
0
0
0
This signal 0 is coming from Q0
1
How Parallel Counter works?
Clock
0
1
0
0
1
0
0
0
0
All the ANDs which got 0
Gave output 0
1
How Parallel Counter works?
Clock
1
0
0
1
0
X XOR 1 = X’
X XOR 0 = X
1
How Parallel Counter works?
Clock
1
0
0
1
0
This data will be available
On counter output at time t+1
1
How Parallel Counter works?
Clock
1
0
0
1
0
Counter at time t+1
1
Serial VS Parallel Counter
Gate delay being accumulated in Serial Counter as last AND is at level 4 of gating.
For example, going from state 1111 to state 0000.
Clock
Serial VS Parallel Counter
Output of 4th
AND gate depends on the outputs of all previous AND gates.
i.e. Delay of four AND Gates being accumulated.
Clock
Practice Problems
1. Arbitrary Count Sequence: Design a
synchronous counter which follows sequence
given below:
0, 2, 4, 6, 8, 0, 2,…
2. BCD Counter: Design a BCD synchronous counter
which follows the sequence given below:
0,1,2,3,4,5,6,7,8,9,0,1,2,…
Practice Problems
3. Modulo-7 Counter: Which follows the
sequence 0,1,2,3,4,5,6,0,1,2,…
4. Digital Watch
For your convenience consider we have 64
seconds in one minute, 64 minutes in one
hour and total 32 hours in a day.
Practice Problems
5. Automatic Parking Control
Take CarIn and CarOut signals from sensors at Entry
and Exit Gates respectively. Parking area has total
capacity of 32 cars, when total count of cars in the
plaza reaches 32 lock the Entry Door otherwise the
door will remain unlocked.
6. Counter with Parallel Load
Register composed of D Flip-Flops which loads the
data if Load = 1 otherwise behaves like a binary
counter.
Practice Problems
7. Counter composed of D Flip-Flops which
takes X and Y selection inputs and performs
following operations:
X Y Operation
0 0 Count
0 1 Shift Right
1 0 Shift Left
1 1 Parallel Load

digital electronics counters topics.pptx

  • 1.
  • 2.
    What is aCounter?
  • 3.
    Non Technical Definition •A digital device which stores number of times a particular event or process has occurred. • This device counts the occurrence of events with the help of multiple states • Just like registers, we use basic storage elements i.e. Flip-Flops to design counters. • We can also display the stored count.
  • 4.
    Technical Definition • Aregister that goes through a prescribed sequence of distinct states upon the application of a sequence of input pulses • Input pulses may be – Clock pulses – Originate from some other source – May occur at regular or irregular interval of time
  • 5.
    Binary Counter • Counterthat follows the binary number sequence is called binary counter • An n-bit binary counter consists of n flip-flops and can count in binary from 0 through 2n -1 • For example a counter which produces a sequence of numbers like 00, 01, 10, 11 is a binary counter.
  • 6.
    Types of Counters •Based upon type of clock, counters are of following 2 types: 1. Asynchronous Counters. 2. Synchronous Counters.
  • 7.
    Types of Counters •Depending on the way in which the counting progresses the Asynchronous and Synchronous counters are classified as follows: 1. Up Counters 2. Down Counters 3. Up-Down Counters 4. Decade Counter.
  • 8.
    Asynchronous Counters A counterin which the flip-flops (FF) within the counter do not change states at exactly the same time because they do not have a common clock pulse. OR A counter in which C input of some of the flip-flops are triggered not by common pulse but rather by the transitions that occur on other flip-flop outputs e.g. Ripple counters
  • 9.
    Synchronous Counters A synchronouscounter is one in which all the flip- flops in the counter are clocked at the same time by a common clock pulse OR In which the C inputs of all flip-flops receive common pulse.
  • 10.
  • 11.
    2 bit AsynchronousBinary UP Counter
  • 12.
  • 13.
  • 14.
    3 bit AsynchronousBinary UP Counter
  • 15.
  • 16.
  • 17.
    4-bit Ripple UpCounter What will be the state of counter on positive edge after 1111?
  • 18.
    4-bit Ripple Counter •Design a 4-bit ripple counter for downward counting Can you design an asynchronous Up-Down Counter with Selection Input?
  • 19.
  • 20.
    Uses of RippleCounter • Propagation delay makes them less efficient and slow. • Used to measure – Time, frequency, distance, speed • Also used in – Frequency division, direct counting, digital computers
  • 21.
  • 22.
    Synchronous 3-bit Up-DownCounter For S=0 Count Upward For S=1 Count Downward
  • 23.
    Serial Counter • Acounter which is constructed with sequential arrangement of flip-flops with the help of half adders which provides information to each stage about the state of the prior stages. • If all the flip-flops are connected with same clock , this type of arrangement is Synchronous arrangement otherwise it is Asynchronous.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
    Serial Counter If EN= 0, Hold Data If EN = 1, Increment by 1
  • 31.
    How Serial CounterWorks? 0 1 0 0 Value at time t = 0010 What will be the value at time t+1 1
  • 32.
    How Serial CounterWorks? 0 1 0 0 1 Qi outputs coming to XORs and ANDs
  • 33.
    How Serial CounterWorks? 0 1 0 0 1 1 0
  • 34.
    How Serial CounterWorks? 0 1 0 0 1 1 0 1 0
  • 35.
    How Serial CounterWorks? 0 1 0 0 1 1 0 1 0 0 0
  • 36.
    How Serial CounterWorks? 0 1 0 0 1 1 0 1 0 0 0 0 0
  • 37.
    How Serial CounterWorks? 0 1 0 0 1 1 0 1 0 0 0 0 0 Value of this AND depends On three ANDs in previous Levels of gating
  • 38.
    How Serial CounterWorks? 0 1 0 0 This data will be available at next tick 1 1 0 1 0 0 0 0 0
  • 39.
    How Serial CounterWorks? 1 1 1 0 0
  • 40.
  • 41.
    How Parallel Counterworks? Clock Value at time t = 0010 What will be the value at time t+1 0 1 0 0 1
  • 42.
    How Parallel Counterworks? Clock 0 1 0 0 1
  • 43.
    How Parallel Counterworks? Clock 0 1 0 0 1 0 0 0 0 This signal 0 is coming from Q0 1
  • 44.
    How Parallel Counterworks? Clock 0 1 0 0 1 0 0 0 0 All the ANDs which got 0 Gave output 0 1
  • 45.
    How Parallel Counterworks? Clock 1 0 0 1 0 X XOR 1 = X’ X XOR 0 = X 1
  • 46.
    How Parallel Counterworks? Clock 1 0 0 1 0 This data will be available On counter output at time t+1 1
  • 47.
    How Parallel Counterworks? Clock 1 0 0 1 0 Counter at time t+1 1
  • 48.
    Serial VS ParallelCounter Gate delay being accumulated in Serial Counter as last AND is at level 4 of gating. For example, going from state 1111 to state 0000. Clock
  • 49.
    Serial VS ParallelCounter Output of 4th AND gate depends on the outputs of all previous AND gates. i.e. Delay of four AND Gates being accumulated. Clock
  • 50.
    Practice Problems 1. ArbitraryCount Sequence: Design a synchronous counter which follows sequence given below: 0, 2, 4, 6, 8, 0, 2,… 2. BCD Counter: Design a BCD synchronous counter which follows the sequence given below: 0,1,2,3,4,5,6,7,8,9,0,1,2,…
  • 51.
    Practice Problems 3. Modulo-7Counter: Which follows the sequence 0,1,2,3,4,5,6,0,1,2,… 4. Digital Watch For your convenience consider we have 64 seconds in one minute, 64 minutes in one hour and total 32 hours in a day.
  • 52.
    Practice Problems 5. AutomaticParking Control Take CarIn and CarOut signals from sensors at Entry and Exit Gates respectively. Parking area has total capacity of 32 cars, when total count of cars in the plaza reaches 32 lock the Entry Door otherwise the door will remain unlocked. 6. Counter with Parallel Load Register composed of D Flip-Flops which loads the data if Load = 1 otherwise behaves like a binary counter.
  • 53.
    Practice Problems 7. Countercomposed of D Flip-Flops which takes X and Y selection inputs and performs following operations: X Y Operation 0 0 Count 0 1 Shift Right 1 0 Shift Left 1 1 Parallel Load

Editor's Notes

  • #27 4-Bit Synchronous Binary Counter with Serial Gating.
  • #40 4-Bit Synchronous Binary Counter with Parallel Gating.
  • #41 4-Bit Synchronous Binary Counter with Parallel Gating
  • #42 4-Bit Synchronous Binary Counter with Parallel Gating.
  • #43 4-Bit Synchronous Binary Counter with Parallel Gating.
  • #44 4-Bit Synchronous Binary Counter with Parallel Gating.
  • #45 4-Bit Synchronous Binary Counter with Parallel Gating.
  • #46 4-Bit Synchronous Binary Counter with Parallel Gating.
  • #47 4-Bit Synchronous Binary Counter with Parallel Gating.