BLK_SchmittTrigger : A Schmitt trigger circuit
A Schmitt trigger is a comparator with hysteresis. In other words, the decision threshold of the comparator may vary with the output state, for instance, taking a value of vth0 when the current output is 0 and vth1 when the current output is 1.
This Schmitt trigger model is described using a compare primitive that compares the input in against a variable threshold vth. The threshold vth takes one of the two possible values, defined by the parameters vth0 and vth1, depending on the current output value using a select primitive. Note that the buf_xbit primitive with its init_value set to 0 is necessary to force the initial state of the feedback loop which would otherwise stay at X.
Input/Output Terminals
| Name | I/O | Type | Description |
| out | output | xbit | output signal |
| in | input | xreal | input signal |
Parameters
| Name | Type | Default | Description |
| vth0 | real | 0.6 | threshold level when output=0 |
| vth1 | real | 0.4 | threshold level when output=1 |
List of Testbenches
| tb_meas_tfdc : A testbench for measuring the DC transfer function of a Schmitt trigger circuit |
tb_meas_tfdc : A testbench for measuring the DC transfer function of a Schmitt trigger circuit
This testbench measures the DC transfer function of a Schmitt trigger circuit by sweeping the input from a low value to a high value and then from the high value back to the low value. Sweeping the input in both direction is necessary to measure the full DC transfer characteristics which may exhibit hysteresis effects.
A Schmitt trigger circuit may have a different switching threshold depending on the current output value.
`include "xmodel.h" module tb_meas_tfdc (); xreal in; xbit out; pwl_gen #(.data('{0.0, 0.0, 50e-9, 1.0, 100e-9, 0.0})) I0 (in); // DUT BLK_SchmittTrigger #(.vth0(0.6), .vth1(0.4)) DUT (.in(in), .out(out)); // probing initial begin $xmodel_dumpfile(); $xmodel_dumpvars(); end endmodule
Simulation Results
Figure. the DC transfer function.