* SPICE netlist
V1 N002 0 PULSE(0 1 0 5n 5n 1E12)
R1 Rev 0 1Meg
A1 fc N002 0 0 0 1y 1x 0 MODULATOR mark=0.25 space=0
S1 b1 B N001 Rev SWD
S2 b2 B Rev N001 SWD
S3 b2 A N001 Rev SWD
S4 b1 A Rev N001 SWD
V4 N001 0 0.5
B1 0 b1 I=Imax*2*(u(V(1x)+eps1)-0.5) tripdv=10m tripdt=10n
B2 0 b2 I=Imax*2*(u(V(1y)+eps1)-0.5) tripdv=10m tripdt=10n
A2 fc N002 0 0 0 0 N005 0 MODULATOR mark=1 space=0
A3 N005 0 0 0 0 0 clk 0 BUF Ref=0 Trise=10n Tfall=10n
D1 B N003 LDio
D2 A N003 LDio
D3 N004 B LDio
D4 N004 A LDio
V2 N003 0 {Vmax}
V3 0 N004 {Vmax}
.param Vmax=30 Imax=0.25
.param eps1=1E-20

* LTspice schematic (.asc)
Version 4
SHEET 1 1168 816
WIRE -568 232 -584 232
WIRE -536 -184 -584 -184
WIRE -536 104 -536 -184
WIRE -488 -56 -488 -120
WIRE -424 -120 -488 -120
WIRE -424 168 -424 -120
WIRE -360 -184 -536 -184
WIRE -360 -120 -424 -120
WIRE -360 104 -536 104
WIRE -360 168 -424 168
WIRE -168 -184 -216 -184
WIRE -168 -120 -216 -120
WIRE -168 136 -216 136
WIRE -168 264 -168 136
WIRE -88 -184 -88 -216
WIRE -88 8 -88 -24
WIRE -72 264 -168 264
WIRE -24 -216 -88 -216
WIRE 8 -24 -88 -24
WIRE 8 -24 8 -72
WIRE 8 24 8 -24
WIRE 8 40 8 24
WIRE 40 -216 -24 -216
WIRE 40 -184 40 -216
WIRE 40 152 40 -184
WIRE 72 88 72 -136
WIRE 72 232 -568 232
WIRE 72 232 72 88
WIRE 104 200 104 -24
WIRE 104 296 104 200
WIRE 136 -184 40 -184
WIRE 136 -72 8 -72
WIRE 136 40 8 40
WIRE 136 152 40 152
WIRE 152 -136 72 -136
WIRE 152 -24 104 -24
WIRE 152 88 72 88
WIRE 152 200 104 200
WIRE 248 40 216 40
WIRE 248 152 216 152
WIRE 248 152 248 40
WIRE 280 -136 200 -136
WIRE 280 88 200 88
WIRE 280 88 280 -136
WIRE 280 296 104 296
WIRE 280 296 280 88
WIRE 280 328 280 296
WIRE 312 -184 216 -184
WIRE 312 -72 216 -72
WIRE 312 -72 312 -184
WIRE 312 -24 200 -24
WIRE 312 200 200 200
WIRE 312 200 312 -24
WIRE 312 232 72 232
WIRE 312 232 312 200
WIRE 360 -184 312 -184
WIRE 360 -72 360 -120
WIRE 360 -24 360 -72
WIRE 360 40 248 40
WIRE 408 -72 360 -72
WIRE 408 104 408 -72
WIRE 488 -184 360 -184
WIRE 488 -72 488 -120
WIRE 488 -24 488 -72
WIRE 488 40 360 40
WIRE 536 -72 488 -72
WIRE 536 104 536 -72
WIRE 568 264 -8 264
WIRE 584 -184 488 -184
WIRE 584 40 488 40
FLAG -488 24 0
FLAG -584 -184 fc
IOPIN -720 224 In
FLAG -568 312 0
FLAG -584 232 Rev
IOPIN -720 640 In
FLAG -168 -120 1y
FLAG -168 -184 1x
FLAG 584 -184 B
IOPIN 448 224 Out
FLAG 584 40 A
IOPIN 448 448 Out
FLAG 280 408 0
FLAG -88 -104 0
FLAG -88 88 0
FLAG 568 264 clk
IOPIN 432 672 Out
FLAG 408 184 0
FLAG 536 184 0
FLAG -24 -216 b1
FLAG 8 24 b2
FLAG 136 -408 b2
SYMBOL voltage -488 -72 R0
SYMATTR Value PULSE(0 1 0 5n 5n 1E12)
SYMATTR InstName V1
SYMBOL res -584 216 R0
SYMATTR Value 1MEG
SYMATTR InstName R1
SYMBOL SpecialFunctions\\modulate2 -360 -184 R0
SYMATTR Value mark=0.25 space=0
SYMATTR InstName A1
SYMBOL sw 120 -184 R270
SYMATTR InstName S1
SYMATTR Value SWD
SYMBOL sw 120 -72 R270
SYMATTR InstName S2
SYMATTR Value SWD
SYMBOL sw 120 40 R270
SYMATTR InstName S3
SYMATTR Value SWD
SYMBOL sw 120 152 R270
SYMATTR InstName S4
SYMATTR Value SWD
SYMBOL voltage 280 312 R0
SYMATTR InstName V4
SYMATTR Value 0.5
SYMBOL bv -88 -88 R180
SYMATTR Value I=Imax*2*(u(V(1x)+eps1)-0.5)
SYMATTR Value2 tripdv=10m tripdt=10n
SYMATTR InstName B1
SYMBOL bv -88 104 R180
SYMATTR Value I=Imax*2*(u(V(1y)+eps1)-0.5)
SYMATTR Value2 tripdv=10m tripdt=10n
SYMATTR InstName B2
SYMBOL SpecialFunctions\\modulate -360 104 R0
SYMATTR Value mark=1 space=0
SYMATTR InstName A2
SYMBOL Digital\\buf1 -72 200 R0
SYMATTR Value Ref=0 Trise=10n Tfall=10n
SYMATTR InstName A3
SYMBOL diode 344 -184 R0
SYMATTR Value LDio
SYMATTR InstName D1
SYMBOL diode 376 40 R180
SYMATTR InstName D2
SYMATTR Value LDio
SYMBOL diode 504 -120 R180
SYMATTR InstName D3
SYMATTR Value LDio
SYMBOL diode 472 -24 R0
SYMATTR Value LDio
SYMATTR InstName D4
SYMBOL voltage 408 88 R0
SYMATTR InstName V2
SYMATTR Value {Vmax}
SYMBOL voltage 536 200 R180
SYMATTR Value {Vmax}
SYMATTR InstName V3