Appearance
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
| Port | Kind | Signal | Notes |
|---|---|---|---|
in | Control input | Real | |
out | Control output | Integer |
Parameters
| Parameter | Type | Default | Units | Description | ID |
|---|---|---|---|---|---|
| Upper threshold | Number | 0.5 | — | The output switches to 1 when the input is at or above this value. | upper |
| Lower threshold | Number | -0.5 | — | The output switches to 0 when the input is at or below this value. Must not exceed the upper threshold. | lower |
| Initial state | Choice: 0 (low) / 1 (high) | 0 (low) | — | Output held at start-up while the input sits between the two thresholds. | initial_state |