Digital Logic Design · Problem type

Counter modulus and output frequency

Use this for “A 4-bit counter (mod 16) runs on a 1 MHz clock: find its top bit’s frequency. How many flip-flops does a mod-10 counter need?”

Diagram

CLK0123456789101112131415Q₀Q₁Q₂Q₃16 clocks = 16 μs
A mod-16 counter steps 0 to 15, one count each rising clock edge, then wraps to 0: 4 flip-flops, Q₀ the lowest bit.
One
cycle
takes
16
clocks,
so
it
repeats
at
f
16
:
fₒᵤₜ
=
62.5
kHz.
Each
Q
runs
at
half
the
frequency
of
the
one
below
it;
Q₃
at
f
2
4
.
This is an example. Type your own values to start a new problem.
fₒᵤₜ (kHz)
=
f (MHz)
÷
M
n
=
⌈log₂
M
⌉
S
States of n bits
worked out (not typed)
u
Unused states
worked out (not typed)
cₗₐₛₜ
Last count
worked out (not typed)

Formulas

n
=
⌈log₂
M
⌉
4 = ⌈log₂ 16⌉
S
=
2
n
16
=
2
4
u
=
S
−
M
0 = 16 − 16
fₒᵤₜ
=
f
M
62,500
=
1,000,000
16
cₗₐₛₜ
=
M
−
1
1,111₂ = 16 − 1
Formulas are worked in Hz. The step-by-step shows the conversions.

Assumptions

•
A mod-M counter steps through 0 to M − 1, one count each clock edge, then wraps to 0.
•
n flip-flops write 2ⁿ counts, so a mod-M counter needs the smallest n with 2ⁿ ≥ M.
•
The counter completes one cycle every M clocks; with M = 2ⁿ its top bit runs at f ÷ 2ⁿ.

Step-by-step

WE KNOW
M = 16, f = 1 MHz
FIND
flip-flops (n), states of n bits (S), unused states (u), output frequency (fₒᵤₜ), last count (cₗₐₛₜ)
Step 1 · Convert to the formula’s units
The formulas don’t work directly in the units you chose, so convert first (to Hz).
f = 1 MHz = 1,000,000 Hz (1 MHz = 10⁶ Hz)
Step 2 · Find flip-flops (n)
Use n = ⌈log₂ M⌉
The
smallest
n
with
2ⁿ
≥
M
:
n
flip-flops
write
every
count
from
0
to
M
−
1.
⌈log₂
16⌉
=
4,
since
2
4
=
16
n
=
4
Step 3 · Find states of n bits (S)
Use S = 2ⁿ
Each
flip-flop
doubles
the
number
of
states
n
bits
can
hold.
S
=
2
4
S
=
16
Step 4 · Find unused states (u)
Use u = S − M
The states the counter never reaches; the design must send each back into the count.
u
=
16
−
16
u
=
0
Step 5 · Find output frequency (fₒᵤₜ)
Use fₒᵤₜ = f ÷ M
One
output
cycle
takes
M
clock
cycles,
so
the
counter
divides
the
clock
by
M
.
fₒᵤₜ
=
1,000,000
16
fₒᵤₜ = 62,500 Hz
Step 6 · Find last count (cₗₐₛₜ)
Use cₗₐₛₜ = M − 1
Counting
starts
at
0,
so
the
last
of
M
counts
is
M
−
1.
cₗₐₛₜ = 16 − 1
cₗₐₛₜ = 1111₂
Step 7 · Convert the answers
Change each answer back to the unit you chose.
fₒᵤₜ = 62,500 Hz = 62.5 kHz (1 kHz = 1000 Hz)
Check
Put the numbers back in. Both sides should match.
4 = ⌈log₂ 16⌉ ✓
16
=
2
4
✓
0 = 16 − 16 ✓
62,500
=
1,000,000
16
✓
1,111₂ = 16 − 1 ✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.

Related lessons

© 2026 SME. All rights reserved.