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₀int0—Initial count value (the count starts here at t=0).
triggerTriggerenum (Every time step / External clock / Internal clock)0—What causes the count to increment.
frequencyfdouble1—Internal-clock frequency. The count increments every 1/f seconds.

Used in samples ​