* SPICE netlist
S1 N003 Ce1 PSW 0 Std
S2 N003 Ce2 NSW 0 Std
S3 Ce1 Vdd NSW 0 Std
S4 Ce2 Vdd PSW 0 Std
Vref Th_ref 0 {Vdd*.5}
Eout Vcout 0 PSW 0 {Vdd}
bdem Demout 0 V=v(vcoin)*(1-u(v(inh)))
Rdem Demout 0 1g
Rinh Inh 0 1e6
Dz 0 Zener Zen
Rz Zener 0 1g
G1 R2 N003 0 Th_ref {.3*Vdd/r2}
B1 R1 N003 I=-8*V(Vcoin)/{R1}
Rvcoin VcoIn 0 1g
R1 R1 0 {r1}
R2 R2 0 {r2}
C1 Ce1 Ce2 100p
Vc VcoIn 0 2.5
AsrFf1 N001 N002 0 0 0 NSW PSW 0 SRFLOP Td=10ns Trise=10ns Tfall=10ns
A1 Th_ref Ce2 0 0 0 0 N001 0 SCHMITT Vt=0 Vh=.1
A2 Th_ref Ce1 0 0 0 0 N002 0 SCHMITT Vt=0 Vh=.1
Vcc Vdd 0 {Vdd}
.Params: Vdd=5 r1=1000k r2=1t
.tran 0 1m 0 uic

* LTspice schematic (.asc)
Version 4
SHEET 1 1456 432
WIRE 392 -216 376 -216
WIRE 568 -216 504 -216
WIRE 728 -216 712 -216
WIRE 376 -200 376 -216
WIRE 440 -200 376 -200
WIRE 504 -200 504 -216
WIRE 712 -200 616 -200
WIRE 728 -200 728 -216
WIRE 728 -200 712 -200
WIRE 376 -184 376 -200
WIRE 440 -184 440 -200
WIRE 568 -184 568 -216
WIRE 616 -184 616 -200
WIRE 712 -184 712 -200
WIRE 56 -168 -104 -168
WIRE 200 -168 56 -168
WIRE 216 -168 200 -168
WIRE -104 -136 -104 -168
WIRE 200 -136 200 -168
WIRE -152 -120 -168 -120
WIRE 56 -120 56 -168
WIRE 264 -120 248 -120
WIRE -664 -104 -696 -104
WIRE 376 -88 376 -120
WIRE 440 -88 440 -104
WIRE 440 -88 376 -88
WIRE 504 -88 504 -120
WIRE 504 -88 440 -88
WIRE 616 -88 616 -104
WIRE 616 -88 504 -88
WIRE 712 -88 712 -104
WIRE 712 -88 616 -88
WIRE 264 -72 248 -72
WIRE 376 -72 376 -88
WIRE 376 -72 264 -72
WIRE -696 -40 -696 -104
WIRE -664 -40 -696 -40
WIRE -584 -24 -600 -24
WIRE 200 -24 200 -56
WIRE 200 -24 104 -24
WIRE -728 -8 -728 -24
WIRE -664 -8 -728 -8
WIRE -264 -8 -264 -24
WIRE -104 -8 -104 -56
WIRE -104 -8 -200 -8
WIRE -8 -8 -104 -8
WIRE -104 8 -104 -8
WIRE 200 8 200 -24
WIRE -584 24 -584 -24
WIRE -552 24 -584 24
WIRE -424 24 -456 24
WIRE 728 56 728 24
WIRE -552 72 -584 72
WIRE -424 72 -440 72
WIRE -8 72 -8 -8
WIRE 104 72 104 -24
WIRE 296 72 296 56
WIRE 296 72 232 72
WIRE 360 72 360 24
WIRE 472 72 472 24
WIRE 552 72 552 40
WIRE -56 88 -56 72
WIRE 152 88 152 72
WIRE 296 88 296 72
WIRE 408 88 408 56
WIRE 424 88 408 88
WIRE -696 104 -696 -40
WIRE -664 104 -696 104
WIRE -264 104 -264 88
WIRE -200 104 -200 88
WIRE 232 104 232 72
WIRE 232 104 200 104
WIRE -584 120 -584 72
WIRE -584 120 -600 120
WIRE 200 120 200 104
WIRE -728 136 -728 120
WIRE -664 136 -728 136
WIRE -8 184 -8 152
WIRE 104 184 104 152
WIRE 104 184 -8 184
WIRE 360 184 360 152
WIRE 360 184 104 184
WIRE 472 184 472 152
WIRE 472 184 360 184
WIRE -264 200 -264 184
WIRE -200 200 -200 184
WIRE -200 200 -264 200
WIRE -152 200 -152 -72
WIRE -152 200 -200 200
WIRE -56 200 -56 136
WIRE -56 200 -152 200
WIRE 56 200 56 -40
WIRE 56 200 -56 200
WIRE 152 200 152 136
WIRE 152 200 56 200
WIRE 200 200 152 200
WIRE 264 200 264 -72
WIRE 264 200 200 200
WIRE 296 200 296 168
WIRE 296 200 264 200
WIRE 424 200 424 136
WIRE 424 200 296 200
WIRE 552 200 552 120
WIRE 552 200 424 200
WIRE 600 200 600 136
WIRE 600 200 552 200
WIRE 728 200 728 136
WIRE 728 200 600 200
WIRE -152 216 -152 200
FLAG -104 8 Ce1
IOPIN 96 480 BiDir
FLAG 200 8 Ce2
IOPIN 400 480 BiDir
FLAG 216 -168 Vdd
IOPIN 416 304 In
FLAG 360 24 R1
IOPIN 560 496 BiDir
FLAG 472 24 R2
IOPIN 672 496 BiDir
FLAG -56 72 PSW
IOPIN 144 544 In
FLAG 152 72 NSW
IOPIN 352 544 In
FLAG 264 -120 PSW
IOPIN 464 352 In
FLAG -168 -120 NSW
IOPIN 32 352 In
FLAG 728 24 Th_ref
IOPIN 928 496 Out
FLAG 408 56 Th_ref
IOPIN 608 528 In
FLAG 296 56 VcoIn
IOPIN 496 528 In
FLAG 600 56 Vcout
IOPIN 800 528 Out
FLAG 552 40 PSW
IOPIN 752 512 In
FLAG 712 -216 Demout
IOPIN 912 256 Out
FLAG 568 -184 Inh
IOPIN 768 288 In
FLAG 392 -216 Zener
IOPIN 592 256 Out
FLAG -152 216 0
FLAG -264 88 R1
IOPIN -64 560 BiDir
FLAG -200 88 R2
IOPIN 0 560 BiDir
FLAG -264 -24 Ce2
IOPIN -64 448 BiDir
FLAG -424 24 PSW
IOPIN -224 496 Out
FLAG -424 72 NSW
IOPIN -224 544 Out
FLAG -728 -24 Ce2
IOPIN -528 448 In
FLAG -728 120 Ce1
IOPIN -528 592 In
FLAG -664 -104 Th_ref
IOPIN -464 368 In
SYMBOL sw -8 168 M180
SYMATTR Value Std
SYMATTR InstName S1
SYMBOL sw 104 168 R180
SYMATTR Value Std
SYMATTR InstName S2
SYMBOL sw -104 -40 M180
SYMATTR InstName S3
SYMATTR Value Std
SYMBOL sw 200 -40 R180
SYMATTR InstName S4
SYMATTR Value Std
SYMBOL voltage 728 40 R0
SYMATTR InstName Vref
SYMATTR Value {Vdd*.5}
SYMBOL e 600 40 R0
SYMATTR InstName Eout
SYMATTR Value {Vdd}
SYMBOL bv 712 -200 R0
SYMATTR InstName bdem
SYMATTR Value V=v(vcoin)*(1-u(v(inh)))
SYMBOL res 600 -200 R0
SYMATTR InstName Rdem
SYMATTR Value 1g
SYMBOL res 488 -216 R0
SYMATTR InstName Rinh
SYMATTR Value 1e6
SYMBOL zener 392 -120 R180
SYMATTR InstName Dz
SYMATTR Value Zen
SYMBOL res 424 -200 R0
SYMATTR InstName Rz
SYMATTR Value 1g
SYMBOL g 472 168 M180
SYMATTR InstName G1
SYMATTR Value {.3*Vdd/r2}
SYMBOL bi 360 72 R0
SYMATTR InstName B1
SYMATTR Value I=-8*V(Vcoin)/{R1}
SYMBOL res 280 72 R0
SYMATTR InstName Rvcoin
SYMATTR Value 1g
SYMBOL res -280 88 R0
SYMATTR InstName R1
SYMATTR Value {r1}
SYMBOL res -216 88 R0
SYMATTR InstName R2
SYMATTR Value {r2}
SYMBOL cap -200 -24 R90
SYMATTR InstName C1
SYMATTR Value 100p
SYMBOL voltage 200 104 R0
SYMATTR InstName Vc
SYMATTR Value 2.5
SYMBOL Digital\\srflop -504 -24 R0
SYMATTR Value Td=10ns Trise=10ns Tfall=10ns
SYMATTR InstName AsrFf1
SYMBOL Digital\\diffschmtbuf -664 -88 R0
SYMATTR Value Vt=0 Vh=.1
SYMATTR InstName A1
SYMBOL Digital\\diffschmtbuf -664 56 R0
SYMATTR Value Vt=0 Vh=.1
SYMATTR InstName A2
SYMBOL voltage 56 -136 R0
SYMATTR InstName Vcc
SYMATTR Value {Vdd}