Skip to content

Hysteresis Comparator ​

Comparator with hysteresis (Schmitt trigger). The integer output switches to 1 when the input rises to the upper threshold or above, switches to 0 when it falls to the lower threshold or below, and holds its previous value in between, so a noisy signal near one threshold does not chatter. If lower is set above upper, the simulator logs an error and swaps them.

Category: Digital Logic / Compare

Ports ​

PortKindSignalNotes
inControl inputReal
outControl outputInteger

Parameters ​

ParameterTypeDefaultUnitsDescriptionID
Upper thresholdNumber0.5—The output switches to 1 when the input is at or above this value.upper
Lower thresholdNumber-0.5—The output switches to 0 when the input is at or below this value. Must not exceed the upper threshold.lower
Initial stateChoice: 0 (low) / 1 (high)0 (low)—Output held at start-up while the input sits between the two thresholds.initial_state

In the course ​