SlideShare a Scribd company logo
16
Most read
18
Most read
19
Most read
Basics Counters
Mirza Danial Masood 
BS-IT(B), Roll No. 85, 
UOS M.B.Din
Overview 
• Counters are a specific type of sequential circuit. 
• Like registers, the state, or the flip-flop values 
themselves, serves as the “output.” 
• The output value increases by one on each clock 
cycle. 
• After the largest value, the output “wraps around” 
back to 0. 
• Counters can act as simple clocks to keep track of 
“time.” 
• You may need to record how many times 
something has happened. 
• All processors contain a program counter, or PC.
D flip-flop inputs 
• If we use D flip-flops, then the D inputs will just be 
the same as the desired next states. 
• Equations for the D flip-flop inputs are shown at the 
right. 
• Why does D0 = Q0’ make sense? 
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 
Q0 
1 1 0 0 
Q1 1 1 0 0 
X 
Q0 
0 1 0 1 
Q1 1 0 1 0 
X 
D1 = Q1  Q0  X 
D0 = Q0’
Asynchronous Counters 
• This counter is called asynchronous because not all flip 
flops are hooked to the same clock. 
• Look at the waveform of the output, Q, in the timing 
diagram. It resembles a clock as well. If the period of 
the clock is T, then what is the period of Q, the output 
of the flip flop? It's 2T! 
• We have a way to create a clock that runs twice as 
slow. We feed the clock into a T flip flop, where T is 
hardwired to 1. The output will be a clock who's period 
is twice as long.
Asynchronous counters 
• If the clock has period T. Q0 has period 2T. Q1 
period is 4T 
• With n flip flops the period is 2n.
Asynchronous counters
3 bit asynchronous “ripple” 
counter using T flip flops 
• This is called as a ripple 
counter due to the way 
the FFs respond one 
after another in a kind 
of rippling effect.
Synchronous Counters 
• To eliminate the "ripple" effects, use a common 
clock for each flip-flop and a combinational circuit 
to generate the next state. 
• For an up-counter, 
use an incrementer =>
Synchronous Counters 
• Internal details => 
• Internal Logic 
Incrementer 
– XOR complements each bit 
– AND chain causes 
complement 
of a bit if all bits toward LSB 
from it equal 1 
• Count Enable 
– Forces all outputs of AND 
chain to 0 to “hold” the state 
• Carry Out 
– Added as part of incrementer 
– Connect to Count Enable of 
additional 4-bit counters to 
form larger counters
Synchronous Counters
Design Example: Synchronous BCD 
• Use the sequential logic model to design a synchronous BCD 
counter with D flip-flops 
• State Table => 
• Input combinations 
1010 through 1111 
are don’t cares 
Current State 
Q8 Q4 Q2 Q1 
Next State 
Q8 Q4 Q2 Q1 
0 0 0 0 0 0 0 1 
0 0 0 1 0 0 1 0 
0 0 1 0 0 0 1 1 
0 0 1 1 0 1 0 0 
0 1 0 0 0 1 0 1 
0 1 0 1 0 1 1 0 
0 1 1 0 0 1 1 1 
0 1 1 1 1 0 0 0 
1 0 0 0 1 0 0 1 
1 0 0 1 0 0 0 0
Synchronous BCD (continued) 
• Use K-Maps to two-level optimize the next state equations and 
manipulate into forms containing XOR gates: 
D1 = Q1’ 
• D2 = Q2 + Q1Q8’ 
D4 = Q4 + Q1Q2 
D8 = Q8 + (Q1Q8 + Q1Q2Q4) 
• Y = Q1Q8 
• The logic diagram can be drawn from these equations 
• An asynchronous or synchronous reset should be added 
• What happens if the counter is perturbed by a power 
disturbance or other interference and it enters a state other 
than 0000 through 1001?
Synchronous BCD (continued) 
• Find the actual values of the six next states for the 
don’t care combinations from the equations 
• Find the overall state diagram to assess behavior for 
the don’t care states (states in decimal). 
Present State Next State 
Q8 Q4 Q2 Q1 Q8 Q4 Q2 Q1 
1 0 1 0 1 0 1 1 
1 0 1 1 0 1 1 0 
1 1 0 0 1 1 0 1 
1 1 0 1 0 1 0 0 
1 1 1 0 1 1 1 1 
1 1 1 1 0 0 1 0
Synchronous BCD (continued) 
• For the BCD counter design, if an invalid state is 
entered, return to a valid state occurs within two 
clock cycles 
• Is this adequate?!
Cascaded Counters 
• Counters can be connected to achieve higher 
modulus operation. 
• Cascading means that the last stage output of one 
counter drives the input of the next counter. 
• A mod-M and a mod-N counter in cascade give a 
mod-MN counter. 
• 2 types of cascading: Asynchronous cascading 
and synchronous cascading .
Cascaded Counters (continue) 
Asynchronous cascading : 
Two asynchronous counters connected 
in cascade for a 2 bit and a 3 bit ripple counter. The 
overall modulus of the two cascaded counters is 
4 x 8 = 32; that is they act as a divide-by-32 counter.
Cascaded Counters (continue) 
Synchronous cascading : 
In synchronous cascaded counter, it is 
necessary to use the count enable (CTEN) and the 
terminal count (TC) functions to achieve higher 
modulus operation. Terminal count (TC) is analogous 
to ripple clock or ripple carry out (RCO) on some IC 
counters.
Cascaded Counters: Example 
The figure below shows a mod-10 counter and mod-8 
counter connected in cascade. What is the overall 
modulus of these two cascaded counter? Determine 
the frequency at B if f in is 20kHz. 
Answer: 
Overall modulus = 10 x 8 =80 = mod-80 counter 
Frequency at B = fin /80 = 250Hz
Basics Counters
Basics Counters

More Related Content

PPT
DAC-digital to analog converter
PDF
Counters
PDF
Chapter 6 register
PPT
Fourier analysis of signals and systems
PPT
DOMINO LOGIC CIRCUIT (VLSI)
PPTX
Johnson counter
PDF
Design of IIR filters
PPT
8.flip flops and registers
DAC-digital to analog converter
Counters
Chapter 6 register
Fourier analysis of signals and systems
DOMINO LOGIC CIRCUIT (VLSI)
Johnson counter
Design of IIR filters
8.flip flops and registers

What's hot (20)

PPTX
Introduction to Counters
PPTX
555 Timer (detailed presentation)
PDF
Chapter 5 counter
PPTX
Successive approximation adc
PPTX
Analog to digital converter
PPTX
Radix-2 DIT FFT
PPTX
Two port network
PPT
Shift Registers
PDF
pid controller
PDF
PID controller in control systems
PPTX
Counters
PPT
Active Filter (Low Pass)
PPT
Sequential circuit
PDF
Registers and counters
PPT
Counters
PPT
14827 shift registers
PPTX
Latches & flip flop
PPTX
DIFFERENTIAL AMPLIFIER using MOSFET
PPSX
Sequential circuits
PPTX
M ary psk modulation
Introduction to Counters
555 Timer (detailed presentation)
Chapter 5 counter
Successive approximation adc
Analog to digital converter
Radix-2 DIT FFT
Two port network
Shift Registers
pid controller
PID controller in control systems
Counters
Active Filter (Low Pass)
Sequential circuit
Registers and counters
Counters
14827 shift registers
Latches & flip flop
DIFFERENTIAL AMPLIFIER using MOSFET
Sequential circuits
M ary psk modulation
Ad

Viewers also liked (11)

PDF
Lsb Based Digital Image Watermarking For Gray Scale Image
PPTX
Operating system introduction to operating system
PPTX
Digital watermarking
PPT
Chapter 1: Introduction to Operating System
PPTX
Tactile sensor working and its types
PPTX
Functions Of Operating Systems
PPTX
Divide by N clock
PPTX
Synchronous counters
DOCX
Counters In Digital Logic Design
PPT
Counters
PPTX
Digital watermarking
Lsb Based Digital Image Watermarking For Gray Scale Image
Operating system introduction to operating system
Digital watermarking
Chapter 1: Introduction to Operating System
Tactile sensor working and its types
Functions Of Operating Systems
Divide by N clock
Synchronous counters
Counters In Digital Logic Design
Counters
Digital watermarking
Ad

Similar to Basics Counters (20)

PPTX
Counters-Counter is a sequential circuit.pptx
PPTX
Counters
PPTX
dsd-II-unit-III-registers-counters (1).pptx
PPTX
Up counters,down and registers ppt.pptx
PDF
Chapter 7_Counters (EEEg4302).pdf
PPTX
Synchronous Sequential Logic Unit 4
PPTX
Counters_pptx.pptx
PDF
Ade(unit 4) Counters
PDF
FYBSC IT Digital Electronics Unit V Chapter I Counters
PPT
counters_and_registers_5 lecture fifth.ppt
PPT
counters and registers
PDF
DigitalLogic_Counters.pdfDigitalLogic_Counters.pdfDigitalLogic_Counters.pdfDi...
PPTX
Counters.pptx,,,,,......................
PPTX
Presentation on Counters for (Digital Systems Design).pptx
PPT
Computer system architecture 16 counters
PDF
Chapter 5 counter1
PPT
EET107_Chapter 3_SLD(part2.1)-edit1.ppt
PPTX
Synschronous counter
PPTX
COUNTERS.pptx
PPTX
co-unit4.pptx mca computer organizaiton ist sem
Counters-Counter is a sequential circuit.pptx
Counters
dsd-II-unit-III-registers-counters (1).pptx
Up counters,down and registers ppt.pptx
Chapter 7_Counters (EEEg4302).pdf
Synchronous Sequential Logic Unit 4
Counters_pptx.pptx
Ade(unit 4) Counters
FYBSC IT Digital Electronics Unit V Chapter I Counters
counters_and_registers_5 lecture fifth.ppt
counters and registers
DigitalLogic_Counters.pdfDigitalLogic_Counters.pdfDigitalLogic_Counters.pdfDi...
Counters.pptx,,,,,......................
Presentation on Counters for (Digital Systems Design).pptx
Computer system architecture 16 counters
Chapter 5 counter1
EET107_Chapter 3_SLD(part2.1)-edit1.ppt
Synschronous counter
COUNTERS.pptx
co-unit4.pptx mca computer organizaiton ist sem

More from Danial Mirza (6)

PPT
Software Quality
PPTX
METHOD OF LEAST SQURE
PPTX
TCP/IP Protocols
PPTX
Java Applets
PPTX
Data Type Conversion in C++
PPTX
Hard Disk
Software Quality
METHOD OF LEAST SQURE
TCP/IP Protocols
Java Applets
Data Type Conversion in C++
Hard Disk

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
01-Introduction-to-Information-Management.pdf
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Classroom Observation Tools for Teachers
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
RMMM.pdf make it easy to upload and study
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Anesthesia in Laparoscopic Surgery in India
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Pharma ospi slides which help in ospi learning
01-Introduction-to-Information-Management.pdf
Computing-Curriculum for Schools in Ghana
Final Presentation General Medicine 03-08-2024.pptx
Cell Structure & Organelles in detailed.
Microbial disease of the cardiovascular and lymphatic systems
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPH.pptx obstetrics and gynecology in nursing
102 student loan defaulters named and shamed – Is someone you know on the list?
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Classroom Observation Tools for Teachers
Abdominal Access Techniques with Prof. Dr. R K Mishra
Supply Chain Operations Speaking Notes -ICLT Program
RMMM.pdf make it easy to upload and study

Basics Counters

  • 2. Mirza Danial Masood BS-IT(B), Roll No. 85, UOS M.B.Din
  • 3. Overview • Counters are a specific type of sequential circuit. • Like registers, the state, or the flip-flop values themselves, serves as the “output.” • The output value increases by one on each clock cycle. • After the largest value, the output “wraps around” back to 0. • Counters can act as simple clocks to keep track of “time.” • You may need to record how many times something has happened. • All processors contain a program counter, or PC.
  • 4. D flip-flop inputs • If we use D flip-flops, then the D inputs will just be the same as the desired next states. • Equations for the D flip-flop inputs are shown at the right. • Why does D0 = Q0’ make sense? 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 Q0 1 1 0 0 Q1 1 1 0 0 X Q0 0 1 0 1 Q1 1 0 1 0 X D1 = Q1  Q0  X D0 = Q0’
  • 5. Asynchronous Counters • This counter is called asynchronous because not all flip flops are hooked to the same clock. • Look at the waveform of the output, Q, in the timing diagram. It resembles a clock as well. If the period of the clock is T, then what is the period of Q, the output of the flip flop? It's 2T! • We have a way to create a clock that runs twice as slow. We feed the clock into a T flip flop, where T is hardwired to 1. The output will be a clock who's period is twice as long.
  • 6. Asynchronous counters • If the clock has period T. Q0 has period 2T. Q1 period is 4T • With n flip flops the period is 2n.
  • 8. 3 bit asynchronous “ripple” counter using T flip flops • This is called as a ripple counter due to the way the FFs respond one after another in a kind of rippling effect.
  • 9. Synchronous Counters • To eliminate the "ripple" effects, use a common clock for each flip-flop and a combinational circuit to generate the next state. • For an up-counter, use an incrementer =>
  • 10. Synchronous Counters • Internal details => • Internal Logic Incrementer – XOR complements each bit – AND chain causes complement of a bit if all bits toward LSB from it equal 1 • Count Enable – Forces all outputs of AND chain to 0 to “hold” the state • Carry Out – Added as part of incrementer – Connect to Count Enable of additional 4-bit counters to form larger counters
  • 12. Design Example: Synchronous BCD • Use the sequential logic model to design a synchronous BCD counter with D flip-flops • State Table => • Input combinations 1010 through 1111 are don’t cares Current State Q8 Q4 Q2 Q1 Next State Q8 Q4 Q2 Q1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 0 0 0
  • 13. Synchronous BCD (continued) • Use K-Maps to two-level optimize the next state equations and manipulate into forms containing XOR gates: D1 = Q1’ • D2 = Q2 + Q1Q8’ D4 = Q4 + Q1Q2 D8 = Q8 + (Q1Q8 + Q1Q2Q4) • Y = Q1Q8 • The logic diagram can be drawn from these equations • An asynchronous or synchronous reset should be added • What happens if the counter is perturbed by a power disturbance or other interference and it enters a state other than 0000 through 1001?
  • 14. Synchronous BCD (continued) • Find the actual values of the six next states for the don’t care combinations from the equations • Find the overall state diagram to assess behavior for the don’t care states (states in decimal). Present State Next State Q8 Q4 Q2 Q1 Q8 Q4 Q2 Q1 1 0 1 0 1 0 1 1 1 0 1 1 0 1 1 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 0 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0
  • 15. Synchronous BCD (continued) • For the BCD counter design, if an invalid state is entered, return to a valid state occurs within two clock cycles • Is this adequate?!
  • 16. Cascaded Counters • Counters can be connected to achieve higher modulus operation. • Cascading means that the last stage output of one counter drives the input of the next counter. • A mod-M and a mod-N counter in cascade give a mod-MN counter. • 2 types of cascading: Asynchronous cascading and synchronous cascading .
  • 17. Cascaded Counters (continue) Asynchronous cascading : Two asynchronous counters connected in cascade for a 2 bit and a 3 bit ripple counter. The overall modulus of the two cascaded counters is 4 x 8 = 32; that is they act as a divide-by-32 counter.
  • 18. Cascaded Counters (continue) Synchronous cascading : In synchronous cascaded counter, it is necessary to use the count enable (CTEN) and the terminal count (TC) functions to achieve higher modulus operation. Terminal count (TC) is analogous to ripple clock or ripple carry out (RCO) on some IC counters.
  • 19. Cascaded Counters: Example The figure below shows a mod-10 counter and mod-8 counter connected in cascade. What is the overall modulus of these two cascaded counter? Determine the frequency at B if f in is 20kHz. Answer: Overall modulus = 10 x 8 =80 = mod-80 counter Frequency at B = fin /80 = 250Hz