Components / Memory
Counter Component in Logisim
Synchronous N-bit binary up-counter that increments Q by 1 on each rising Clock edge and asserts overflow (ovf) at its maximum count (2^N - 1).
| Library | Memory |
|---|---|
| Type name | Counter |
| Pins and defaults | clk CLK (-20, 20), rst RST (-10, 20), q Q (0, 0), cout ovf (0, 10), width 4 (1..32) |
How the Counter Works in Logisim
The Counter component is a synchronous N-bit binary up-counter (default width = 4 bits, counting 0x0 through 0xF). On every rising edge (0 → 1 transition) of the bottom-left Clock input (CLK), its stored count Q increments by 1 and wraps around from 2^N - 1 back to 0.
When the count reaches its maximum value of all ones (2^N - 1, such as 15 / 0xF for a 4-bit counter), the 1-bit overflow output pin (ovf, at offset 0, 10) asserts High (1). Driving the bottom-right Reset pin (RST) High (1) asynchronously resets Q to 0.
Tip: Connect a Counter’s Q bus to the address input (A) of a ROM to step automatically through a sequence of microcode instructions or display patterns.
Counter Pins & Pinout
| Pin | Direction | Width | Location & Role |
|---|---|---|---|
| clk (CLK) | Input (Bottom-left) | 1 bit | Offset (-20, 20). Rising-edge (0 → 1) clock input that increments the count by 1. |
| rst (RST) | Input (Bottom-right) | 1 bit | Offset (-10, 20). Asynchronous active-high reset (clears count Q to 0 immediately). |
| q (Q) | Output (Upper-right) | 1–32 bits (default 4) | Offset (0, 0). Current N-bit binary count (0 to 2^N - 1). |
| cout (ovf) | Output (Lower-right) | 1 bit | Offset (0, 10). Terminal count / overflow flag: outputs 1 when Q equals 2^N - 1. |
Counter Truth Table & Behavior
| RST | CLK Edge | Current Q | Next Q | ovf (Terminal Count) |
|---|---|---|---|---|
| 1 | Any | Any | 0x0 (0) | 0 |
| 0 | ↑ (0 → 1) | 0x0 (0) | 0x1 (1) | 0 |
| 0 | ↑ (0 → 1) | 0xE (14) | 0xF (15) | 1 (max count reached) |
| 0 | ↑ (0 → 1) | 0xF (15) | 0x0 (0, wraps) | 0 |