* Z:\home\khalils\Downloads\files\data\raw_asc\024e06b2ea9f_Draft1.asc
* Generated by LTspice 26.0.1 for Windows.
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
S3 Ce1 Vdd NSW 0 Std
R2 R2 0 {r2}
S1 N003 Ce1 PSW 0 Std
Eout Vcout 0 PSW 0 {Vdd}
R1 R1 0 {r1}
G1 R2 N003 0 Th_ref {.3*Vdd/r2}
S2 N003 Ce2 NSW 0 Std
B1 R1 N003 I=-8*V(Vcoin)/{R1}
C1 Ce1 Ce2 100p
Rdem Demout 0 1g
Dz 0 Zener Zen
Rvcoin VcoIn 0 1g
Rinh Inh 0 1e6
Vref Th_ref 0 {Vdd*.5}
bdem Demout 0 V=v(vcoin)*(1-u(v(inh)))
Vcc Vdd 0 {Vdd}
Rz Zener 0 1g
S4 Ce2 Vdd PSW 0 Std
Vc VcoIn 0 2.5
.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
IOPIN 96 480 BiDir
IOPIN 400 480 BiDir
IOPIN 416 304 In
IOPIN 560 496 BiDir
IOPIN 672 496 BiDir
IOPIN 144 544 In
IOPIN 352 544 In
IOPIN 464 352 In
IOPIN 32 352 In
IOPIN 928 496 Out
IOPIN 608 528 In
IOPIN 496 528 In
IOPIN 800 528 Out
IOPIN 752 512 In
IOPIN 912 256 Out
IOPIN 768 288 In
IOPIN 592 256 Out
IOPIN -64 560 BiDir
IOPIN 0 560 BiDir
IOPIN -64 448 BiDir
IOPIN -224 496 Out
IOPIN -224 544 Out
IOPIN -528 448 In
IOPIN -528 592 In
IOPIN -464 368 In
SYMBOL sw 96 432 M180
WINDOW 0 12 106 Left 0
WINDOW 3 -28 56 Left 0
SYMATTR InstName S3
SYMATTR Value Std
SYMBOL res 800 272 R0
WINDOW 0 22 12 Left 0
SYMATTR InstName Rdem
SYMATTR Value 1g
SYMBOL res 624 272 R0
WINDOW 0 59 49 Right 0
WINDOW 3 30 84 Left 0
SYMATTR InstName Rz
SYMATTR Value 1g
SYMBOL cap 0 448 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName C1
SYMATTR Value 100p
SYMBOL zener 592 352 R180
WINDOW 0 -17 62 Left 0
WINDOW 3 -33 -15 Left 0
SYMATTR InstName Dz
SYMATTR Value Zen
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 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 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 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}
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 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 res 480 544 R0
WINDOW 0 -36 24 VRight 0
WINDOW 3 23 91 Left 0
SYMATTR InstName Rvcoin
SYMATTR Value 1g
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 sw 400 432 R180
WINDOW 0 -58 98 Left 0
WINDOW 3 -26 56 Left 0
SYMATTR InstName S4
SYMATTR Value Std
SYMBOL e 800 512 R0
WINDOW 0 -25 56 Left 0
WINDOW 3 28 21 Left 0
SYMATTR InstName Eout
SYMATTR Value {Vdd}
SYMBOL sw 192 640 M180
WINDOW 3 -27 55 Left 0
WINDOW 0 16 12 Left 0
SYMATTR Value Std
SYMATTR InstName S1
SYMBOL res -16 560 R0
WINDOW 0 28 46 Left 0
WINDOW 3 25 85 Left 0
SYMATTR InstName R2
SYMATTR Value {r2}
SYMBOL sw 304 640 R180
WINDOW 3 -26 55 Left 0
WINDOW 0 6 12 Left 0
SYMATTR Value Std
SYMATTR InstName S2
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 res 688 256 R0
WINDOW 0 27 16 Left 0
WINDOW 3 25 100 Left 0
SYMATTR InstName Rinh
SYMATTR Value 1e6
SYMBOL g 672 640 M180
WINDOW 3 3 -46 Left 0
SYMATTR InstName G1
SYMATTR Value {.3*Vdd/r2}
SYMBOL res -80 560 R0
WINDOW 0 30 47 Left 0
WINDOW 3 24 86 Left 0
SYMATTR InstName R1
SYMATTR Value {r1}
FLAG 96 480 Ce1
FLAG 400 480 Ce2
FLAG 416 304 Vdd
FLAG 560 496 R1
FLAG 672 496 R2
FLAG 144 544 PSW
FLAG 352 544 NSW
FLAG 464 352 PSW
FLAG 32 352 NSW
FLAG 928 496 Th_ref
FLAG 608 528 Th_ref
FLAG 496 528 VcoIn
FLAG 800 528 Vcout
FLAG 752 512 PSW
FLAG 912 256 Demout
FLAG 768 288 Inh
FLAG 592 256 Zener
FLAG 48 688 0
FLAG -64 560 R1
FLAG 0 560 R2
FLAG -64 448 Ce2
FLAG -224 496 PSW
FLAG -224 544 NSW
FLAG -528 448 Ce2
FLAG -528 592 Ce1
FLAG -464 368 Th_ref
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