Skip to content

Counters

A counter is a sequential circuit that advances through a prescribed state sequence on clock events. The number of distinct states before the sequence repeats is its modulus. A mod-NN counter requires at least

n=⌈log⁡2N⌉\boxed{n=\lceil\log_2N\rceil}

flip-flops.

TypeDefining feature
Asynchronous or rippleOnly the first stage receives the external clock
SynchronousEvery stage receives one common clock
UpState increases by one modulo NN
DownState decreases by one modulo NN
Up/downDirection input selects increasing or decreasing sequence
Mod-NNRepeats after exactly NN valid states
DecadeMod-10; normally represents decimal digits 0–9

Counter classifications.

In a ripple counter the external clock drives only the least-significant stage. Each later stage is clocked by an earlier output, so transitions do not occur simultaneously.

Two-bit asynchronous counter; clock bubbles specify falling-edge triggering.

Two-bit asynchronous counter; clock bubbles specify falling-edge triggering.

For falling-edge T flip-flops with T=1T=1 (or JK with J=K=1J=K=1), connecting QiQ_i to the next clock gives the up-count sequence

00→01→10→11→00.00\to01\to10\to11\to00.

Using Q‾i\overline Q_i instead gives the opposite direction for the same edge polarity. With positive-edge devices the required terminal reverses; verify the sequence rather than memorizing one connection.

Each stage divides frequency by two:

fQi=fclk2i+1.\boxed{f_{Q_i}=\frac{f_{clk}}{2^{i+1}}}.

The simple hardware is useful for low-speed counting and frequency division, but delay accumulates. A conservative estimate is

tsettle≈ntpd,fmax≲1ntpd.\boxed{t_{settle}\approx nt_{pd}},\qquad f_{max}\lesssim\frac{1}{nt_{pd}}.

During transitions such as 0111→10000111\to1000, temporary intermediate codes can make an attached decoder glitch.

Every flip-flop receives the same clock. Combinational logic decides which bits toggle before the active edge.

For T flip-flops,

T0=1,Ti=∏j=0i−1Qj(i≥1).T_0=1,\qquad \boxed{T_i=\prod_{j=0}^{i-1}Q_j}\quad(i\ge1).

Bit ii toggles when every lower bit is 1, the carry condition. For three bits,

T0=1,T1=Q0,T2=Q1Q0.T_0=1,\qquad T_1=Q_0,\qquad T_2=Q_1Q_0.

A down-count bit toggles when all lower bits are 0, the borrow condition:

T0=1,Ti=∏j=0i−1Q‾j.T_0=1,\qquad \boxed{T_i=\prod_{j=0}^{i-1}\overline Q_j}.

For three bits the sequence is

111→110→101→100→011→010→001→000→111.111\to110\to101\to100\to011\to010\to001\to000\to111.

Let U=1U=1 select up and U=0U=0 select down. Then

Ti=U∏j=0i−1Qj+U‾∏j=0i−1Q‾j,T0=1.\boxed{T_i=U\prod_{j=0}^{i-1}Q_j +\overline U\prod_{j=0}^{i-1}\overline Q_j}, \qquad T_0=1.

The direction input must meet setup and hold requirements like any other synchronous control.

PropertyRippleSynchronous
ClockExternal clock only at first stageCommon clock at every stage
State changePropagates stage by stageAll stages sample together
DelayApproximately cumulative ntpdnt_{pd}Input logic plus one clock-to-QQ path
Transient codesCommonReduced, though decode hazards remain
HardwareMinimalRequires excitation logic
Best useDivider or low-speed counterHigh-speed and arbitrary counters

Ripple and synchronous counters compared.

If N<2nN<2^n, the unused states must be removed or redirected. A simple ripple implementation detects state NN and drives asynchronous clear.

Asynchronously truncated mod-10 (decade) counter.

Asynchronously truncated mod-10 (decade) counter.

The decade circuit counts 0000 through 1001. Arrival at 10102=101010_2=10 makes Q3Q1=1Q_3Q_1=1, so the NAND output clears all stages. The decoded state is brief; reset pulse width and decoder hazards must satisfy the flip-flop data sheet.

A synchronous mod-NN counter instead makes the last legal state advance directly to zero. This avoids a ripple-clear state but requires next-state logic.

  1. Write the required sequence and choose n=⌈log⁡2N⌉n=\lceil\log_2N\rceil state bits.

  2. Form the present-state/next-state table and state a recovery policy for unused codes.

  3. Use the selected flip-flop excitation table to obtain every input.

  4. Simplify each input by Boolean algebra or Karnaugh map.

  5. Draw one common clock and verify every legal and unused state.

For

000→001→010→011→100→000,000\to001\to010\to011\to100\to000,

one JK realization is

J2=Q1Q0, K2=1,J1=K1=Q0,J0=Q‾2, K0=1.\boxed{J_2=Q_1Q_0,\ K_2=1},\qquad \boxed{J_1=K_1=Q_0},\qquad \boxed{J_0=\overline Q_2,\ K_0=1}.

Common-clock realization of the minimized synchronous mod-5 counter.

Common-clock realization of the minimized synchronous mod-5 counter.

Using Q+=JQ‾+K‾QQ^+=J\overline Q+\overline KQ gives

Q2+=Q1Q0Q‾2,Q1+=Q1⊕Q0,Q0+=Q‾2 Q‾0.Q_2^+=Q_1Q_0\overline Q_2,\qquad Q_1^+=Q_1\oplus Q_0,\qquad Q_0^+=\overline Q_2\,\overline Q_0.

It also recovers from unused states: 101→010101\to010, 110→010110\to010, and 111→000111\to000.