Module 3: Sequential Circuit Design · 3.5 Counters

Synchronous Counters

Asynchronous ripple counters suffer from cumulative propagation delays and transient output glitches.

A synchronous counter resolves these limitations. In a synchronous counter, all flip-flops connect to a common clock net and transition simultaneously on active clock edges.

Synchronous Architecture

Because all flip-flops share a single clock, all count bits update concurrently (Figure 1).

Synchronous counter timing
Figure 1: Timing diagram showing simultaneous bit transitions in a synchronous counter

Output transitions contain no intermediate transient states. Combinational decoders and comparators can sample counter outputs safely.

However, because stages do not clock their successors directly, combinational logic must evaluate toggle conditions before the active clock edge arrives.

Toggle Condition Derivation

Analyze the binary counting sequence:

  • Bit 0 inverts on every clock cycle.
  • Bit 1 inverts when bit 0 is 1.
  • Bit 2 inverts when both bit 0 and bit 1 are 1.
  • In general, bit $i$ inverts when all lower-order bits ($Q_0, Q_1, \dots, Q_{i-1}$) equal 1.

The toggle excitation equations for a 4-bit counter are:

$$T_0 = 1 \qquad T_1 = Q_0 \qquad T_2 = Q_0 \cdot Q_1 \qquad T_3 = Q_0 \cdot Q_1 \cdot Q_2$$

These equations implement a carry-propagation chain. Each toggle condition $T_i$ represents the carry-in bit when adding 1 to the current count value. A binary counter is an arithmetic adder with one operand fixed at constant 1.

Figure 2 shows the 4-bit synchronous counter schematic using T flip-flops and an AND gate chain.

Synchronous counter
Figure 2: Schematic of a 4-bit synchronous counter using T flip-flops and carry AND gates

When implemented using standard D flip-flops, the input logic is:

$$D_i = Q_i \oplus T_i$$

Synchronous Enable Control

To control counting operations, gate all toggle conditions with an active-high count enable signal ($EN$):

$$T_0 = EN \qquad T_i = EN \cdot \prod_{j=0}^{i-1} Q_j$$

When $EN = 0$, all $T_i = 0$. The flip-flops hold their current values.

Synchronous Clear and Parallel Load

A practical counter incorporates synchronous clear, parallel load, and count enable controls with strict priority:

  1. Clear: Highest priority; forces all bits to 0.
  2. Load: Overwrites register with parallel input vector $D[i]$.
  3. Count: Increments when enabled ($Q_i \oplus T_i$).
  4. Hold: Preserves current count.

$$D_{\text{actual}}[i] = \overline{\text{CLR}} \cdot (\text{LOAD} \cdot D_{\text{parallel}}[i] + \overline{\text{LOAD}} \cdot (Q_i \oplus T_i))$$

Terminal Count and Cascading

To cascade narrower counters into wider datapaths, each stage generates a Terminal Count ($TC$) flag:

$$TC = Q_3 \cdot Q_2 \cdot Q_1 \cdot Q_0 \cdot EN$$

The $TC$ signal asserts when all stage bits equal 1 and the stage is enabled, indicating rollover on the next clock edge.

Connect the $TC$ output of the lower stage to the enable input of the higher stage. Both stages share the same clock net, maintaining fully synchronous operation. The standard 74HC161 counter implements this cascading architecture.

Lookahead Carry Logic for Wide Counters

In wide counters, cascading two-input AND gates creates long propagation chains ($T_{31}$ requires a 31-input AND function).

To maintain high clock frequencies in 32-bit and 64-bit counters, synthesis tools use parallel carry-lookahead trees. These trees evaluate carry terms in two or three gate levels, preventing delay expansion.

Practice Exercises

Problem 1

Write toggle equations for a 3-bit synchronous counter ($Q_2 Q_1 Q_0$). Trace state transitions starting from count 5 (101) to count 1 (001).

Solution

Toggle equations: $T_0 = 1$, $T_1 = Q_0$, $T_2 = Q_0 \cdot Q_1$.

State ($Q_2 Q_1 Q_0$) $T_2$ $T_1$ $T_0$ Next State ($Q_{\text{next}}$)
101 (5) 0 1 1 110 (6)
110 (6) 0 0 1 111 (7)
111 (7) 1 1 1 000 (0)
000 (0) 0 0 1 001 (1)

All bits transition simultaneously on clock edges.

Problem 2

Two 4-bit synchronous counters with terminal count outputs are cascaded to form an 8-bit counter. Describe the signal connections and specify the 8-bit terminal count equation.

Solution

Signal connections:

  • Connect the master system clock and reset nets to both devices in parallel.
  • Connect the master system enable to input $EN$ of stage 0 (lower 4 bits).
  • Connect terminal count output $TC_0$ of stage 0 to input $EN$ of stage 1 (upper 4 bits).

The 8-bit terminal count asserts when all eight bits equal 1 and system enable is active:

$$TC_{\text{total}} = TC_1 = \left(\prod_{i=0}^{7} Q_i\right) \cdot EN$$

Problem 3

Compare a 4-bit ripple counter and a 4-bit synchronous counter using flip-flops with $t_{\text{cq}} = 2.0\text{ ns}$, setup time $t_{\text{su}} = 0.5\text{ ns}$, and gate delay $t_{\text{AND}} = 0.5\text{ ns}$. Calculate maximum operating frequencies.

Solution
  • Ripple Counter: Settling time equals four flip-flop delays:

$$T_{\text{clk,ripple}} \ge 4 \times t_{\text{cq}} = 4 \times 2.0\text{ ns} = 8.0\text{ ns} \implies f_{\text{max}} \approx 125\text{ MHz}$$

  • Synchronous Counter: Path delay equals one clock-to-Q delay, one AND gate delay, and one setup time:

$$T_{\text{clk,sync}} \ge t_{\text{cq}} + t_{\text{AND}} + t_{\text{su}} = 2.0\text{ ns} + 0.5\text{ ns} + 0.5\text{ ns} = 3.0\text{ ns} \implies f_{\text{max}} \approx 333\text{ MHz}$$

The synchronous counter increases maximum operating frequency by approximately $2.6\times$ and eliminates decoding glitches.

The next article examines Modulo-N counters that roll over at arbitrary integer counts.

← The Ripple Counter Modulo-N Counters →