MOD-N counter calculator
A counter of N states needs the least n flip-flops with 2ⁿ ≥ N, shows 0 to N − 1 and divides its clock by N. A decade counter (N = 10) needs 4 flip-flops, leaves 6 of their 16 states unused and turns 1,000 Hz into 100 Hz.
Your values
Enter a whole number from 2 to 1,000,000,000.
Enter a number above 0, up to 10,000,000,000.
These values have no real result.
Result
- n flip-flops
- 2ⁿ states of n flip-flops
- states left unused
- highest count shown
- f_out output frequency
- Hz
Fix the value marked above to see the result.
Worked steps
- 2ⁿ ≥ N: 2⁴ = 16 ≥ 10, 2³ = 8 < 10 → n = 4
- 2ⁿ − N = 16 − 10 = 6
- f_out = f_in ÷ N = 1,000 Hz ÷ 10 = 100 Hz
Formulas used
The same formulas as the formula sheet and the practice questions; the worked steps print them with your numbers.
2ⁿ ≥ Nf_out = f_in ÷ N
Questions
How many flip-flops does a MOD-N counter need?
The least n with 2ⁿ at least N. For N = 10, 2³ = 8 is too few and 2⁴ = 16 is enough, so 4; a counter for the 60 seconds of a minute needs 6.
How is a MOD-N counter made?
Take a binary counter and a NAND gate fed by the outputs that are 1 in N. The moment the count reaches N the gate clears every flip-flop, so N never stays and the count starts again at 0.
What frequency comes out of a MOD-N counter?
Its last output goes through one cycle every N clock pulses, so f_out = f_in / N. It need not be a square wave: a MOD-10 output is high for only part of each cycle.