* Z:\home\khalils\Downloads\files\data\raw_asc\024e06b2ea9f_Draft1.asc
* Generated by LTspice 26.0.1 for Windows.
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}
.model D D
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.dio
.Params: Vdd=5 r1=1000k r2=1t
.model Zen D(Is=1e-12 Rs=40 BV=7 IBV=.5m)
.model Std Sw(Ron=10 Roff=1t Vt=.5
.tran 0 1m 0 uic
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 1000 728
WIRE 592 256 576 256
WIRE 768 256 704 256
WIRE 928 256 912 256
WIRE 576 272 576 256
WIRE 640 272 576 272
WIRE 704 272 704 256
WIRE 912 272 816 272
WIRE 928 272 928 256
WIRE 928 272 912 272
WIRE 576 288 576 272
WIRE 640 288 640 272
WIRE 768 288 768 256
WIRE 816 288 816 272
WIRE 912 288 912 272
WIRE 256 304 96 304
WIRE 400 304 256 304
WIRE 416 304 400 304
WIRE 96 336 96 304
WIRE 400 336 400 304
WIRE 48 352 32 352
WIRE 256 352 256 304
WIRE 464 352 448 352
WIRE -464 368 -496 368
WIRE 576 384 576 352
WIRE 640 384 640 368
WIRE 640 384 576 384
WIRE 704 384 704 352
WIRE 704 384 640 384
WIRE 816 384 816 368
WIRE 816 384 704 384
WIRE 912 384 912 368
WIRE 912 384 816 384
WIRE 464 400 448 400
WIRE 576 400 576 384
WIRE 576 400 464 400
WIRE -496 432 -496 368
WIRE -464 432 -496 432
WIRE -384 448 -400 448
WIRE 400 448 400 416
WIRE 400 448 304 448
WIRE -528 464 -528 448
WIRE -464 464 -528 464
WIRE -64 464 -64 448
WIRE 96 464 96 416
WIRE 96 464 0 464
WIRE 192 464 96 464
WIRE 96 480 96 464
WIRE 400 480 400 448
WIRE -384 496 -384 448
WIRE -352 496 -384 496
WIRE -224 496 -256 496
WIRE 928 528 928 496
WIRE -352 544 -384 544
WIRE -224 544 -240 544
WIRE 192 544 192 464
WIRE 304 544 304 448
WIRE 496 544 496 528
WIRE 496 544 432 544
WIRE 560 544 560 496
WIRE 672 544 672 496
WIRE 752 544 752 512
WIRE 144 560 144 544
WIRE 352 560 352 544
WIRE 496 560 496 544
WIRE 608 560 608 528
WIRE 624 560 608 560
WIRE -496 576 -496 432
WIRE -464 576 -496 576
WIRE -64 576 -64 560
WIRE 0 576 0 560
WIRE 432 576 432 544
WIRE 432 576 400 576
WIRE -384 592 -384 544
WIRE -384 592 -400 592
WIRE 400 592 400 576
WIRE -528 608 -528 592
WIRE -464 608 -528 608
WIRE 192 656 192 624
WIRE 304 656 304 624
WIRE 304 656 192 656
WIRE 560 656 560 624
WIRE 560 656 304 656
WIRE 672 656 672 624
WIRE 672 656 560 656
WIRE -64 672 -64 656
WIRE 0 672 0 656
WIRE 0 672 -64 672
WIRE 48 672 48 400
WIRE 48 672 0 672
WIRE 144 672 144 608
WIRE 144 672 48 672
WIRE 256 672 256 432
WIRE 256 672 144 672
WIRE 352 672 352 608
WIRE 352 672 256 672
WIRE 400 672 352 672
WIRE 464 672 464 400
WIRE 464 672 400 672
WIRE 496 672 496 640
WIRE 496 672 464 672
WIRE 624 672 624 608
WIRE 624 672 496 672
WIRE 752 672 752 592
WIRE 752 672 624 672
WIRE 800 672 800 608
WIRE 800 672 752 672
WIRE 928 672 928 608
WIRE 928 672 800 672
WIRE 48 688 48 672
FLAG 96 480 Ce1
IOPIN 96 480 BiDir
FLAG 400 480 Ce2
IOPIN 400 480 BiDir
FLAG 416 304 Vdd
IOPIN 416 304 In
FLAG 560 496 R1
IOPIN 560 496 BiDir
FLAG 672 496 R2
IOPIN 672 496 BiDir
FLAG 144 544 PSW
IOPIN 144 544 In
FLAG 352 544 NSW
IOPIN 352 544 In
FLAG 464 352 PSW
IOPIN 464 352 In
FLAG 32 352 NSW
IOPIN 32 352 In
FLAG 928 496 Th_ref
IOPIN 928 496 Out
FLAG 608 528 Th_ref
IOPIN 608 528 In
FLAG 496 528 VcoIn
IOPIN 496 528 In
FLAG 800 528 Vcout
IOPIN 800 528 Out
FLAG 752 512 PSW
IOPIN 752 512 In
FLAG 912 256 Demout
IOPIN 912 256 Out
FLAG 768 288 Inh
IOPIN 768 288 In
FLAG 592 256 Zener
IOPIN 592 256 Out
FLAG 48 688 0
FLAG -64 560 R1
IOPIN -64 560 BiDir
FLAG 0 560 R2
IOPIN 0 560 BiDir
FLAG -64 448 Ce2
IOPIN -64 448 BiDir
FLAG -224 496 PSW
IOPIN -224 496 Out
FLAG -224 544 NSW
IOPIN -224 544 Out
FLAG -528 448 Ce2
IOPIN -528 448 In
FLAG -528 592 Ce1
IOPIN -528 592 In
FLAG -464 368 Th_ref
IOPIN -464 368 In
SYMBOL sw 192 640 M180
WINDOW 3 -27 55 Left 0
WINDOW 0 16 12 Left 0
SYMATTR Value Std
SYMATTR InstName S1
SYMBOL sw 304 640 R180
WINDOW 3 -26 55 Left 0
WINDOW 0 6 12 Left 0
SYMATTR Value Std
SYMATTR InstName S2
SYMBOL sw 96 432 M180
WINDOW 0 12 106 Left 0
WINDOW 3 -28 56 Left 0
SYMATTR InstName S3
SYMATTR Value Std
SYMBOL sw 400 432 R180
WINDOW 0 -58 98 Left 0
WINDOW 3 -26 56 Left 0
SYMATTR InstName S4
SYMATTR Value Std
SYMBOL voltage 928 512 R0
WINDOW 0 -23 59 Left 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
WINDOW 3 -90 106 Left 0
SYMATTR InstName Vref
SYMATTR Value {Vdd*.5}
SYMBOL e 800 512 R0
WINDOW 0 -25 56 Left 0
WINDOW 3 28 21 Left 0
SYMATTR InstName Eout
SYMATTR Value {Vdd}
SYMBOL bv 912 272 R0
WINDOW 0 -32 57 Left 0
WINDOW 3 -2 128 Right 0
SYMATTR InstName bdem
SYMATTR Value V=v(vcoin)*(1-u(v(inh)))
SYMBOL res 800 272 R0
WINDOW 0 22 12 Left 0
SYMATTR InstName Rdem
SYMATTR Value 1g
SYMBOL res 688 256 R0
WINDOW 0 27 16 Left 0
WINDOW 3 25 100 Left 0
SYMATTR InstName Rinh
SYMATTR Value 1e6
SYMBOL zener 592 352 R180
WINDOW 0 -17 62 Left 0
WINDOW 3 -33 -15 Left 0
SYMATTR InstName Dz
SYMATTR Value Zen
SYMBOL res 624 272 R0
WINDOW 0 59 49 Right 0
WINDOW 3 30 84 Left 0
SYMATTR InstName Rz
SYMATTR Value 1g
SYMBOL g 672 640 M180
WINDOW 3 3 -46 Left 0
SYMATTR InstName G1
SYMATTR Value {.3*Vdd/r2}
SYMBOL bi 560 544 R0
WINDOW 0 -13 28 Left 0
WINDOW 3 -82 148 Left 0
SYMATTR InstName B1
SYMATTR Value I=-8*V(Vcoin)/{R1}
SYMBOL res 480 544 R0
WINDOW 0 -36 24 VRight 0
WINDOW 3 23 91 Left 0
SYMATTR InstName Rvcoin
SYMATTR Value 1g
SYMBOL res -80 560 R0
WINDOW 0 30 47 Left 0
WINDOW 3 24 86 Left 0
SYMATTR InstName R1
SYMATTR Value {r1}
SYMBOL res -16 560 R0
WINDOW 0 28 46 Left 0
WINDOW 3 25 85 Left 0
SYMATTR InstName R2
SYMATTR Value {r2}
SYMBOL cap 0 448 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName C1
SYMATTR Value 100p
SYMBOL voltage 400 576 R0
WINDOW 0 -23 59 Left 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
WINDOW 3 -90 119 Left 0
SYMATTR InstName Vc
SYMATTR Value 2.5
SYMBOL Digital\\srflop -304 448 R0
WINDOW 3 -133 183 Left 0
WINDOW 0 -28 29 Left 0
SYMATTR Value Td=10ns Trise=10ns Tfall=10ns
SYMATTR InstName AsrFf1
SYMBOL Digital\\diffschmtbuf -464 384 R0
WINDOW 3 7 22 Left 0
WINDOW 0 23 63 Left 0
SYMATTR Value Vt=0 Vh=.1
SYMATTR InstName A1
SYMBOL Digital\\diffschmtbuf -464 528 R0
WINDOW 3 -5 -3 Left 0
WINDOW 0 24 63 Left 0
SYMATTR Value Vt=0 Vh=.1
SYMATTR InstName A2
SYMBOL voltage 256 336 R0
WINDOW 0 -50 3 Left 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
WINDOW 3 -30 57 Left 0
SYMATTR InstName Vcc
SYMATTR Value {Vdd}
TEXT -56 192 Left 0 !.Params: Vdd=5 r1=1000k r2=1t\n.model Zen  D(Is=1e-12 Rs=40 BV=7 IBV=.5m)\n.model Std Sw(Ron=10 Roff=1t Vt=.5
TEXT 464 216 Left 0 !.tran 0 1m 0 uic