Binary Counter Simulator
Simulate a digital binary counter with adjustable bit width, up or down direction, modulo value and starting state. Apply individual clock pulses or run the counter automatically and inspect binary states, decimal values, overflow, wraparound and bit transitions.
—
—
—
What Is a Binary Counter?
A binary counter is a sequential digital circuit that moves through a series of binary states in response to clock pulses. Each pulse changes the stored counter value according to the counter direction and modulus.
For a normal n-bit binary up counter, the state increases by one until the largest representable value is reached. The next pulse causes the counter to wrap back to zero.
How to Use the Binary Counter Simulator
Choose a counter width, select whether the counter should count upward or downward, enter its starting decimal value and specify the desired modulus. Press Clock Pulse to advance the counter by one state.
You can also select Auto Run to generate repeated simulated clock pulses. Stop halts automatic counting, while Reset returns the simulator to the configured starting state.
4-Bit Binary Counter Example
A standard four-bit binary counter has 16 possible states because four bits can represent values from decimal 0 through 15.
Decimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
...
14 1110
15 1111
Next clock pulse:
0000Binary Counter State Formula
For an ordinary modulo-N up counter, the next state can be represented as the current state plus one modulo N.
Up counter:
Next = (Current + 1) mod N
Down counter:
Next = (Current - 1 + N) mod NAdding N before taking the modulo in the down-counter expression prevents a negative result when the current state is zero.
What Is a Modulo Counter?
The modulus specifies the number of distinct states in the counting cycle. A four-bit binary counter naturally supports 16 states and is therefore a modulo-16 counter when its entire range is used.
Counters can deliberately use a smaller modulus than their available binary width. For example, a four-bit modulo-10 counter cycles through decimal values 0 through 9 rather than using states 10 through 15.
Decade Counter Example
A decade counter has ten states and is therefore also called a modulo-10 counter. Four binary bits are required because three bits provide only eight possible combinations.
0 = 0000
1 = 0001
2 = 0010
3 = 0011
4 = 0100
5 = 0101
6 = 0110
7 = 0111
8 = 1000
9 = 1001
Next pulse:
0 = 0000Up Counter vs Down Counter
| Counter Type | Operation | Example |
|---|---|---|
| Up Counter | Increases by one per clock | 0010 → 0011 |
| Down Counter | Decreases by one per clock | 0011 → 0010 |
| Modulo Counter | Wraps at a selected number of states | 1001 → 0000 for mod-10 |
Binary Counter Overflow and Wraparound
When an up counter reaches its final state, the next clock pulse causes the value to return to zero. This behavior is commonly called overflow or wraparound.
4-bit modulo-16 counter:
1110 = 14
1111 = 15
0000 = 0
Wrap occurred.A down counter exhibits the reverse behavior. When it is at zero and receives another pulse, it wraps to the highest valid state.
How Many States Does an n-Bit Counter Have?
A full binary counter with n bits has 2 raised to the power n possible states.
| Bits | States | Decimal Range |
|---|---|---|
| 2 | 4 | 0–3 |
| 3 | 8 | 0–7 |
| 4 | 16 | 0–15 |
| 8 | 256 | 0–255 |
| 16 | 65,536 | 0–65,535 |
Binary Counter Bit Transitions
Binary counters exhibit a recognizable transition pattern. The least significant bit changes on every clock pulse, while higher-order bits change less frequently.
4-bit count:
0000
0001
0010
0011
0100
0101
0110
0111
1000In a simple binary counter, bit 0 toggles every pulse, bit 1 every two pulses, bit 2 every four pulses and bit 3 every eight pulses.
Uses of Binary Counters
Binary counters are fundamental building blocks in digital electronics. They are used in frequency division, timers, event counting, address generation, digital clocks, state machines, microcontrollers, memory systems and many other sequential circuits.
Counter simulation is useful for students learning digital logic as well as engineers verifying state sequences and modulo behavior before implementing a hardware design.