Skip to content

Counter

Integer counter that increments on a configurable trigger (rising edge / falling edge / level). Optional reset port. Useful for event counting and frequency division.

Category: Discrete

Ports

NameDirectionValue typeNotes
clockinputintVisible when trigger == 1
outoutputint

Parameters

NameLabelTypeDefaultUnitsDescription
initial_valuen₀int0Initial count value (the count starts here at t=0).
triggerTriggerenum (Every time step / External clock / Internal clock)0What causes the count to increment.
frequencyfdouble1Internal-clock frequency. The count increments every 1/f seconds.

Used in samples