

Counters
Sequential circuits called counters are digital circuits capable of traversing an ordered sequence of states in response to clock pulses. Each state represents a binary value, and the circuit can count forward or backward depending on the design.
Unlike combinational circuits, the current state of a counter depends on both the inputs and the previous state. This memory is implemented with bistable elements, typically of type T, D or JK.
Counters are used in time measurement, sequence generation, frequency division, and in internal clock and processor blocks.
The most common counters follow a binary sequence: 0000, 0001, 0010, 0011, ..., and when they reach the maximum value they can either wrap to zero (cyclic counter) or count backwards (bidirectional).
MOD Binary Counter
A MOD
It is used for counting, generating sequences and dividing frequencies.
1-bit counter MOD
The following counter has a single bit, using a single bistable. It is therefore a MOD

This counter uses a D bistable, a full adder and a multiplexer. The adder always adds 1 to the value of
The multiplexer provides the ability to reset the counter. The select signal therefore acts as a reset signal (reset rst). When this signal is activated, the multiplexer connects a constant 0 to the bistable, resetting the counter.
Operation
To understand how this counter works, we start with the bistable in a state
Initial state:
The bistable is in a state
This signal, with value
The counter is at zero (
First pulse:
When a clock pulse is applied, the value at
The adder adds the constant value 1 and returns to the bistable the signal
The carry output is active,
Now the input of the bistable is
The counter has counted up to 1 (
Second pulse:
The next clock pulse copies the value
| Pulse | |||
|---|---|---|---|
| 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 2 | 1 | 0 | 0 |
| 3 | 0 | 1 | 1 |
We can visualise the operation of this counter with the following timeline:

Regardless of the counter’s state, when the reset signal (
3-bit MOD Counter
The following counter is 3 bits, using 3 bistables. It is therefore a MOD
This counter is composed of 3 D bistables, 3 full adders and, to enable a reset, 3 multiplexers.
From the bistables we obtain a 3-bit output
This set of 3 full adders, i.e. this 3-bit adder, will continually add the constant
The reset signal (reset, or

Operation
We analyse the operation of this counter, starting with all the bistables at zero. The table, later, records the result of this analysis.
Initial state:
The bistables are in the state
Adder 0 performs
Adder 1 performs
Adder 2 performs
There is no carry bit (
First pulse:
The clock pulse causes the
Therefore,
Second pulse:
The clock pulse updates the
Therefore,
Third pulse:
The clock pulse updates the
Therefore,
Two carry-out bits are active,
With the following clock pulses, the bistables go through all possible combinations, representing a growing binary number until all bistables reach state 1, i.e.
Seventh pulse:
We have reached the counter’s maximum value,
| Pulse | Count$ | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 000 |
| 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 001 |
| 2 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 010 |
| 3 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 011 |
| 4 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 100 |
| 5 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 101 |
| 6 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 110 |
| 7 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 111 |
| 8 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 000 |
The following figure shows the timeline for this counter.

Regardless of the counter’s state, when the reset signal is activated, the multiplexer will force the counter back to its initial state.
n-bit MOD Counter
To implement an n-bit counter you need to cascade n bistables, n adders and n multiplexers in the same way. With this counter you can count from 0 up to

Asynchronous Binary Counter (Asynchronous Binary Counter or Ripple Counter)
An asynchronous binary counter, or ripple counter, is implemented with a series of bistables, usually of type JK. The first bistable represents the least significant bit (LSB), which is clocked, and each subsequent one is driven by the output of the previous, so these bistables change state in a cascaded fashion.

The JK bistables are connected such that J=K=1; therefore, the Q output toggles between 0 and 1 as the clock signal arrives.
The bistables capture a clock signal only at the moment that this bit transitions from 0 to 1. It will not be considered to capture a clock signal while it remains at 1, at 0 or when it changes from 1 to 0.
The output Q0 corresponds to the least significant bit (LSB); the output Qn corresponds to the most significant bit (MSB).
The external clock signal is applied only to the input of the first bistable.
The complementary output Q̄ of each bistable is connected to the clock input of the next bistable.
This means that when a bistable toggles Q from 1 to 0, Q̄ will go from 0 to 1, driving the clock input of the next bistable. This will cause that bistable to toggle.
In short: a bistable will toggle its state only when the previous bistable transitions from 1 to 0.
To understand how this counter works, we start with all bistables at '0'.
First pulse:
The first bistable Q0 toggles from 0 to 1, Q̄0 goes from 1 to 0.
The second bistable does not detect a clock pulse, does not change state, and therefore Q1 remains at 0.
The third bistable and all following remain at 0.
Second pulse:
The first bistable Q0 goes from 1 to 0, Q̄0 goes from 0 to 1.
The second bistable detects a clock pulse, so Q1 goes from 0 to 1 and Q̄1 goes from 1 to 0.
The third bistable and all following remain at 0.
With the following clock pulses, the bistables propagate the toggles, going through all possible combinations, representing a growing binary number up to the point where all bistables are at state 1. At that point, the next clock pulse toggles the first bistable from 1 to 0, the second as well, and so on; all bistables go from 1 to 0 in a cascade, returning to the starting point.
This table shows the sequence of the individual bits of the counter.
| Pulse | |||||
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0000 |
| 1 | 0 | 0 | 0 | 1 | 1000 |
| 2 | 0 | 0 | 1 | 0 | 0100 |
| 3 | 0 | 0 | 1 | 1 | 1100 |
| 4 | 0 | 1 | 0 | 0 | 0010 |
| ··· | ··· | ··· | ··· | ··· | ··· |
| 14 | 1 | 1 | 1 | 0 | 0111 |
| 15 | 1 | 1 | 1 | 1 | 1111 |
| 16 | 0 | 0 | 0 | 0 | 0000 |
The following figure shows the timeline for this counter.

This type of counter accumulates propagation delays from all bistables when moving from one state to the next, and therefore is not suitable for high clock frequencies.
Counters are also frequency dividers. Each bit toggles at half the frequency of the previous bit, naturally making it a device that divides the clock frequency successively by 2.
Synchronous Binary Counter
A synchronous binary counter is very similar to asynchronous counters, but in this case all the bistables receive the same clock signal and change state simultaneously.
It uses JK-type bistables and has the following structure:

Bistable 0 has its J and K inputs connected so that J=K=1 and, therefore, its output
The output of bistable 0 (
The J and K inputs of bistable 2, and the subsequent bistables, are controlled with an AND gate that receives the outputs of the two previous bistables. If the outputs of the two previous bistables are both 1 simultaneously, the AND gate activates and the inputs of the bistable receive the signal 1. In that case, the bistable will toggle between 0 and 1.
From bistable 2 onward, this structure is repeated until the counter is complete.
To understand how this counter works, we start with all the bistables at zero.
Initial state:
All bistables are at zero,
First pulse:
The first bistable
Second pulse:
Since
Third pulse:
Since
Fourth pulse:
For the first time, the AND gate is activated upon receiving
With the following clock pulses, the bistables move through all possible combinations, representing a growing binary number until all the bistables are in state 1.
Both the table and the timeline of the counter sequence are identical to the previous counter.
| Pulse | |||||
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0000 |
| 1 | 0 | 0 | 0 | 1 | 1000 |
| 2 | 0 | 0 | 1 | 0 | 0100 |
| 3 | 0 | 0 | 1 | 1 | 1100 |
| 4 | 0 | 1 | 0 | 0 | 0010 |
| ··· | ··· | ··· | ··· | ··· | ··· |
| 14 | 1 | 1 | 1 | 0 | 0111 |
| 15 | 1 | 1 | 1 | 1 | 1111 |
| 16 | 0 | 0 | 0 | 0 | 0000 |

Example: 4-bit Counter
In this example we will see how to build a 4-bit counter.


The connections of the bistable that interest us are the D and Q, which mark the input and output of the memory element, and also CLK, which is the clock input. The clock input is often represented with a triangle inside the element.



The D bistable also has other inputs such as enables and resets that allow resetting or clearing information states. It also has a negated output
We want a counter that follows a 4-bit binary sequence, with successive values from 0000 to 1111. We also want to include a reset signal that returns the output to 0000. This behaviour can be achieved with an adder, a multiplexer and a 4-bit bistable as in the figure.

The clock pulse will cause the adder to add a constant 0001 to the counter output value of the bistable. In this example moving from 0100 to 0101.

The multiplexer will force the reset. When a rst signal enters, the state of the bistable will become 0000.

CircuitVerse includes an input Asyncronous reset at the bistables. To perform an asynchronous reset, remove the multiplexer and connect the signal

Exercises on Jutge.org: Introduction to Digital Circuit Design
- Toggle
- 2-bit counter
- Mod-3 counter
- 4-bit counter
- Unconventional cyclic counter
- Up-down counter
- Mod-7 up-down counter
Remember that to access the exercises and for Jutge to grade your solutions you must be enrolled in the course. You will find all instructions here.



Xavier Casas, Francesc Madrid
Lliçons.jutge.org
© Universitat Politècnica de Catalunya, 2026
