.subckt comparator in+ in- out params: Vhigh=1 Vlow=0 * Behavioral voltage source E1 out 0 Value = {if(V(in+, in-) > 0, Vhigh, Vlow)} * Input resistance Rin+ in+ 0 10Meg Rin- in- 0 10Meg .ends comparator