page_title: Counter (digital)
section_title: Synchronous counter
hierarchical_section_title: Counter (digital) / Electronic counters / Synchronous counter
context_page_description: In digital logic and computing, a counter is a device which stores the number of times a particular event or process has occurred, often in relationship to a clock. The most common type is a sequential digital logic circuit with an input line called the clock and multiple output lines. The values on the output lines represent a number in the binary or BCD number system. Each pulse applied to the clock input increments or decrements the number in the counter.
  A counter circuit is usually constructed of a number of flip-flops connected in cascade. Counters are a very widely used component in digital circuits, and are manufactured as separate integrated circuits and also incorporated as parts of larger integrated circuits.
context_section_description: In synchronous counters, the clock inputs of all the flip-flops are connected together and are triggered by the input pulses.  Thus, all the flip-flops change state simultaneously (in parallel).  The circuit below is a 4-bit synchronous counter.  The J and K inputs of FF0 are connected to HIGH.  FF1 has its J and K inputs connected to the output of FF0, and the J and K inputs of FF2 are connected to the output of an AND gate that is fed by the outputs of FF0 and FF1.
  A simple way of implementing the logic for each bit of an ascending counter (which is what is depicted in the adjacent image) is for each bit to toggle when all of the less significant bits are at a logic high state.  For example, bit 1 toggles when bit 0 is logic high; bit 2 toggles when both bit 1 and bit 0 are logic high; bit 3 toggles when bit 2, bit 1 and bit 0 are all high; and so on.
  Synchronous counters can also be implemented with hardware finite-state machines, which are more complex but allow for smoother, more stable transitions.
caption: A 4-bit synchronous counter using JK flip-flops