The Wayback Machine - https://web.archive.org/web/20241109031657/https://www.geeksforgeeks.org/design-counter-given-sequence/
Open In App

Design counter for given sequence

Last Updated : 13 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

A Counter is a device which stores (and sometimes displays) the number of times a particular event or process has occurred, often in relationship to a clock signal. Counters are used in digital electronics for counting purpose, they can count specific event happening in the circuit. For example, in UP counter a counter increases count for every rising edge of clock.

What is Counter?

Counter is a sequential circuit implemented via flip flops. They are used to count the number of clock signals or pulse. A mod n counter will count from 0 to n-1.

Counters can be synchronous or unsynchronous. In synchronous counter, a single common clock is used for all the flip flops. Whereas in asynchronous counter, only a clock is given as input for first flip flop. For an intermediate or final flip flops, its clock pulse will be the output of previous flip flop.

Problem – Design synchronous counter for sequence: 0 → 1 → 3 → 4 → 5 → 7 → 0, using T flip-flop. Explanation – For given sequence, state transition diagram as following below: State transition Table logic

Present State Next State
0 1
1 3
3 4
4 5
5 7
7 0

State transition table for given sequence

Present State Next State
Q3 Q2 Q1 Q3(t+1) Q2(t+1) Q1(t+1)
0 0 0 0 0 1
0 0 1 0 1 1
0 1 1 1 0 0
1 0 0 1 0 1
1 0 1 1 1 1
1 1 1 0 0 0

T flip-flop – If value of Q changes either from 0 to 1 or from 1 to 0 then input for T flip-flop is 1 else input value is 0.

Qt Qt+1 T
0 0 0
0 1 1
1 0 1
1 1 0

Draw input table of all T flip-flops by using the excitation table of T flip-flop. As nature of T flip-flop is toggle in nature. Here, Q3 as Most significant bit and Q1 as least significant bit.

Input table of Flip-Flops
T3 T2 T1  
0 0 1  
0 1 0  
1 1 1  
0 0 1  
0 1 0  
1 1 1  

Find value of T3, T2, T1 in terms of Q3, Q2, Q1 using K-Map (Karnaugh Map): Therefore,

T3 = Q2 

Therefore,

T2 = Q1 

Untitled-Diagram-(1)

K map

Therefore,

T1 = Q2+Q1'

Now, you can design required circuit using expressions of K-maps: 66666

Advantages of Counters

  • Counters can be use for measuring time. E.g. Elapsed time, Response time, etc.
  • They can be used in real time system
  • They are easy to implement and cost effective

Disadvantages of Counters

  1. The hazards and delay in flip-flop can create error
  2. Different digital circuit are to be realized for different value of n and type of flip flop used in n-mod counter

Conclusion

To design a counter for given sequence, we must first design the state transition diagram and table. And then we have to chose the type and number of flip flops. We have to find the excitation table for the same. And we have to simply the equation using K-map or Quine McCluskey (tabular) Method.

Frequently Asked Questions on Design counter for given sequence- FAQs

What is called a counter?

Counters are sequential circuit used to count the number of clock signals or pulse.

What is state transition diagram?

It is diagram representing the all possible states, the circuit can be in. It represented using graphs. Nodes represent the states where as edge represent the possible next state from current state.

How many flip flops are required in sequence counter?

Ans. If there are n states, i.e. n different symbols in the sequence, number of flip flop is ceiling function of logarithm of n base 2, i.e. ⌈log2n⌉. For example, in given sequence 6 symbols are present, hence ⌈log26⌉ = 3 flip flops are used.



Previous Article
Next Article

Similar Reads

Difference between Straight Ring Counter and Twisted Ring Counter
Ring counters, essential in digital circuits, come in two main types: Straight and Twisted Ring Counters. Therefore differ with respect to their functionality and usage in the sequential logic design. It is essential to understand what each of them entails in order to select the appropriate one when designing systems for instance state machines or
4 min read
Design Mod - N synchronous Counter
The value of N can be different from power of 2. Also, the counting sequence may be random for example some cyclic code (8421, 2423 etc). The following method is applied for designing for mod N and any counting sequence. Design for Mod-N counter :The steps for the design are - Step 1 : Decision for number of flip-flops -Example : If we are designin
3 min read
Design asynchronous Up/Down counter
Asynchronous counters are a kind of digital circuitry which may count either upwards or downwards while not adhering to the timing pulses from an oscillator. As a result, state transitions are determined by extra inputs rather than by time frames at fixed intervals. The flip-flops and logic gates are utilized for designing the asynchronous counter
9 min read
Counter Design using verilog HDL
Designing a counter in Verilog means creating a circuit that changes its value (either increasing or decreasing) with each clock pulse. What is Counter?A counter is a logic circuit that counts the incidences of particular events; it is identified traditionally by the frequencies of a clock pulse. Counters are employed in digital electronics in orde
6 min read
Amortized analysis for increment in counter
Amortized analysis refers to determining the time-averaged running time for a sequence (not an individual) operation. It is different from average case analysis because here, we don't assume that the data arranged in average (not very bad) fashion like we do for average case analysis for quick sort. That is, amortized analysis is worst case analysi
4 min read
Ring Counter in Digital Logic
A ring counter is a typical application of the Shift register. The ring counter is almost the same as the shift counter. The only change is that the output of the last flip-flop is connected to the input of the first flip-flop in the case of the ring counter but in the case of the shift register it is taken as output. Except for this, all the other
3 min read
Differences between Synchronous and Asynchronous Counter
There are two types of counters in digital logic circuit that are used to count the numbers of bits and these types depends upon the clock pulse applied to the flip flops. 1. Asynchronous Counter: These are the counters in which we do not use universal clock, main clock is only applied to the first flip flop and then for rest of flip flops the outp
2 min read
Mod 6 Johnson Counter (with D flip-flop)
Johnson counters are one of the most important applications of shift registers. They are created by connecting multiple flip-flops to one another (such that the output of one flip-flop is the input for another), and by connecting the complement of the output of the last flip-flop to the input of the first flip-flop. For a mod 6 Johnson counter, 3 f
1 min read
Mod 2 Ring Counter (with D flip-flop)
Ring counters are one of the most important applications of shift registers. They are created by connecting multiple flip-flops to one another (such that the output of one flip-flop is the input for another), and by connecting the output of the last flip-flop to the input of the first flip-flop. For a mod 2-ring counter, two flip-flops will be requ
1 min read
Non-binary Counter in Digital Logic
A counter is a circuit that counts the number of occurrences of an input. The circuit consists of flip-flops which along with combinational elements are used for generation of control signals. If M = Total number of states, and n = Total number of flip-flop Then, M <= 2n If M = 2n ; Binary counter and M < 2n ; Non-binary counter Block Diagram
2 min read
Synchronous Series Carry Counter
Synchronous Series Carry Counter is such a synchronous counter where inputs of flip-flops are connected in such a manner that only those flip-flops that are toggle on a given clock will have input value as the logic 1. The advantage of this counter is that it reduces the decoding error. Block Diagram of Synchronous Series Carry Counter: Here is the
2 min read
Self Starting Counter
A counter is a device which stores the number of times a particular event or process has occurred (according to Wikipedia). As the name suggests, a counter is a device which is used for "counting" - mostly in relation to a clock signal. A counter is said to be self-starting if it is possible to enter a counter loop irrespective of the initial state
2 min read
Free Running Counter
Counter is a device which stores the number of times a particular event or process has occurred. As the name suggests, a counter is a device which is used for "counting" - mostly in relation to a clock signal. A counter is said to be free-running if it contains all possible states in the counter loop. The longest loop in the sequence of numbers gen
2 min read
Synchronous Parallel-Carry Binary Counter
Synchronous Counter: It is a digital circuit that performs counting in binary numbers with the help of flip-flops and all flip-flops triggered simultaneously. Synchronous Counter design procedure for a given counting sequence: Identify the numbers of flip-flops(FFs), inputs, and outputs required for the count sequence.Select the type of FF going to
5 min read
3 bit Synchronous Down Counter
Prerequisite : Counter , Synchronous counter. 3 bit Synchronous Down Counter : In synchronous counter clock is provided to all the flip-flops simultaneously.Circuit becomes complex as the number of states increases.Speed is high. Design : The steps involves in design are 1. Decide the number of Flip flops - N number of Flip flop(FF) required for N
2 min read
Synchronous Controlled Counter
In this article, we will discuss the overview of the Synchronous controlled counter and will discuss its circuit diagram, circuit excitation table, timing diagram in detail. Let's discuss it one by one. Overview :Toggle or D-type flip-flops can be used to make synchronous counters, and It is easy to design than asynchronous counters. Due to the clo
5 min read
Control Signals Generation using Counter
In various digital applications(For example : hardwired control unit) control signals are needed to start, execute and step various operations in a particular time sequence.For this control signals are required and for the generation of control signals, a counter circuit is designed whose outputs are connected to a decoder. The decoder provides the
2 min read
Synchronous 3 bit Up/Down counter
Prerequisite : 3 bit down counter. Overview: These types of counters fall under the category of synchronous controller counter.Here the mode control input is used to decide whether which sequence will be generated by the counter.In this case, mode control input is used to decide whether the counter will perform up counting or down counting.Designin
3 min read
4-bit Ripple Carry Counter in Verilog HDL
To proceed with Verilog Code, we shall first understand the structure of the 4-bit Ripple Counter. The top design block consists of four T-Flip Flop. For time being ignore the input and output of T-Flip Flop. Let us consider the overall outside structure of Ripple Counter. We have two inputs i.e., clock and reset and q is output. The output q is in
3 min read
Ripple Counter in Digital Logic
Counters play a crucial role in digital logic circuits, enabling tasks such as clock frequency division and sequencing. This article explores the concept of ripple counters, a type of asynchronous counter, their operation, advantages, and disadvantages in digital logic design. What is a Counter?Counter is basically used to count the number of clock
5 min read
Asynchronous Down Counter
In asynchronous/ripple counter output of the first flip-flop is provided as the clock to the second flip-flop i.e flip-flop(FF) are not clocked simultaneously. Circuit is simpler, but speed is slow. What is Asynchronous Counter?An offbeat counter, otherwise called a wave counter, is a computerized counter where going back and forth is associated wi
7 min read
n-bit Johnson Counter in Digital Logic
Prerequisite - Counters  Johnson counter also known as creeping counter, is an example of synchronous counter. In Johnson counter, the complemented output of last flip flop is connected to input of first flip flop and to implement n-bit Johnson counter we require n flip-flop. It is one of the most important type of shift register counter. It is for
5 min read
Counter-Type Analog-to-Digital Converter (ADC)
Analog-to-Digital Converters (ADC) are typically used in all modern-day systems. The main job of the ADC is to convert the analog signal to a digital binary signal. Why digital signal? The reason is that digital data is easy to process, store and transmit. With advancements in CMOS technology, it has been possible to fabricate thousands of logic ci
7 min read
Design 101 sequence detector (Mealy machine)
A sequence detector is a sequential state machine that takes an input string of bits and generates an output 1 whenever the target sequence has been detected. In a Mealy machine, output depends on the present state and the external input (x). Hence, in the diagram, the output is written outside the states, along with inputs What is a Sequence Detec
5 min read
Why K-Map Has States in Sequence of 00, 01, 11, 10 Instead of 00, 01, 10, 11?
Boolean function minimization is an essential part of digital logic. K-Map is one of the important methods for Boolean function minimization. In this article, we will learn about why the K-Map uses sequence 00, 01, 11, 10 instead of 00, 01, 10,11. K-Map is the basic method for the Boolean function minimization which eliminates the redundant terms i
5 min read
Analysis and Design of Combinational and Sequential circuits
1. Analysis and Design of Combinational circuits: To design of combinational circuits, the procedure involves the following steps: Find the required number of inputs and outputs and assign a symbol to each. Derive the truth table according to given specifications and function. Using the truth table, obtain simplified Boolean functions for each outp
2 min read
Design of 512x8 RAM using 128x8 RAM
If we see RAM physically then we notice that RAM is made up of a few chips. We can design the required RAM size using basic RAM chips. We can observe a basic RAM chip as follows: CS1: For chip select 1, the value should be 1CS2: For chip select 2, the value should be 0. Read and Write: Used for upcoming signals. If we have n bit address and m bit w
3 min read
What is One Hot Design?
In the field of computer science and electronics, there are some methods, which are used to represent data in such a way, so that it can be used in machines and computers. These methods are called encoding schemes. One- hot encoding is one of those methods. In this article, we will be discussing one-hot encoding, it's working, the applications, etc
6 min read
List of “Difference Between” Digital Logic and Design Topics
Digital Logic and Design are the main part of ultramodern electronic systems which enable the structure of complex circuits that power our world of digital and technology. This is a system in computers that uses simple values to produce I/ O operations. These distinctions include sense gates, circuit designs, and design approaches, and They have a
4 min read
Digital Logic and Design - GATE CSE Previous Year Questions
Solving GATE Previous Year's Questions (PYQs) not only clears the concepts but also helps to gain flexibility, speed, accuracy, and understanding of the level of questions generally asked in the GATE exam, and that eventually helps you to gain good marks in the examination. Previous Year Questions help a candidate practice and revise for GATE, whic
4 min read
Article Tags :
three90RightbarBannerImg