* SPICE netlist
V5V 5V 0 5V
R1 5V P001 10k
R2 5V P002 10k
R3 5V P003 10k
Rn 5V P004 10k
D1 P001 0 D
D2 P002 0 D
D3 P003 0 D
Dn P004 0 D
XU2 0 N002 5V 0 V2 NC_01 NC_02 LT1008 ;pnba In+)In-)V+)V-)OUT)COMP1)COMP2
Rb V2 N002 1000k
Db 0 N002 D
XU3 0 N003 5V 0 V3 NC_03 NC_04 LT1008 ;pnba In+)In-)V+)V-)OUT)COMP1)COMP2
Rc V3 N003 1000k
Dc 0 N003 D
XU1 0 N001 5V 0 V1 NC_05 NC_06 LT1008 ;pnba In+)In-)V+)V-)OUT)COMP1)COMP2
Ra V1 N001 1000k
Da 0 N001 D
XUd 0 N004 5V 0 V4 NC_07 NC_08 LT1008 ;pnba In+)In-)V+)V-)OUT)COMP1)COMP2
Rd V4 N004 1000k
Dd 0 N004 D

* LTspice schematic (.asc)
Version 4
SHEET 1 1136 800
WIRE -472 -384 -488 -384
WIRE -248 -384 -392 -384
WIRE 88 -384 72 -384
WIRE 312 -384 168 -384
WIRE -488 -288 -488 -384
WIRE -488 -288 -552 -288
WIRE -408 -288 -488 -288
WIRE 72 -288 72 -384
WIRE 72 -288 8 -288
WIRE 152 -288 72 -288
WIRE -248 -272 -248 -384
WIRE -248 -272 -344 -272
WIRE -168 -272 -248 -272
WIRE 312 -272 312 -384
WIRE 312 -272 216 -272
WIRE 392 -272 312 -272
WIRE -552 -256 -552 -288
WIRE -408 -256 -440 -256
WIRE 8 -256 8 -288
WIRE 152 -256 120 -256
WIRE -440 -240 -440 -256
WIRE 120 -240 120 -256
WIRE -552 -176 -552 -192
WIRE 8 -176 8 -192
WIRE 264 -144 248 -144
WIRE 488 -144 344 -144
WIRE 248 -48 248 -144
WIRE 248 -48 184 -48
WIRE 328 -48 248 -48
WIRE 488 -32 488 -144
WIRE 488 -32 392 -32
WIRE 568 -32 488 -32
WIRE -424 -16 -552 -16
WIRE -360 -16 -360 -48
WIRE -360 -16 -424 -16
WIRE -296 -16 -360 -16
WIRE -168 -16 -296 -16
WIRE 184 -16 184 -48
WIRE 328 -16 296 -16
WIRE -552 0 -552 -16
WIRE -424 0 -424 -16
WIRE -296 0 -296 -16
WIRE -168 0 -168 -16
WIRE 296 0 296 -16
WIRE 184 64 184 48
WIRE -552 160 -552 144
WIRE -424 160 -424 144
WIRE -424 160 -552 160
WIRE -360 160 -424 160
WIRE -296 160 -296 144
WIRE -296 160 -360 160
WIRE -168 160 -168 144
WIRE -168 160 -296 160
WIRE -360 192 -360 160
WIRE 200 192 184 192
WIRE 424 192 280 192
WIRE 184 288 184 192
WIRE 184 288 120 288
WIRE 264 288 184 288
WIRE 424 304 424 192
WIRE 424 304 328 304
WIRE 504 304 424 304
WIRE 120 320 120 288
WIRE 264 320 232 320
WIRE 232 336 232 320
WIRE 120 400 120 384
FLAG -8 48 0
FLAG -8 -32 5V
IOPIN 432 144 Out
FLAG -360 192 0
FLAG -360 -48 5V
IOPIN 80 128 In
FLAG 120 -240 0
FLAG 184 -240 0
FLAG 200 -304 5V
IOPIN 640 -128 In
FLAG 392 -272 V2
IOPIN 832 -96 Out
FLAG 8 -176 0
FLAG 296 0 0
FLAG 360 0 0
FLAG 376 -64 5V
IOPIN 816 112 In
FLAG 568 -32 V3
IOPIN 1008 144 Out
FLAG 184 64 0
FLAG -440 -240 0
FLAG -376 -240 0
FLAG -360 -304 5V
IOPIN 80 -128 In
FLAG -168 -272 V1
IOPIN 272 -96 Out
FLAG -552 -176 0
FLAG 232 336 0
FLAG 296 336 0
FLAG 312 272 5V
IOPIN 752 448 In
FLAG 504 304 V4
IOPIN 944 480 Out
FLAG 120 400 0
SYMBOL voltage -8 -48 R0
SYMATTR InstName 5V
SYMATTR Value 5V
SYMBOL res -568 -16 R0
SYMATTR InstName R1
SYMATTR Value 10k
SYMBOL res -440 -16 R0
SYMATTR InstName R2
SYMATTR Value 10k
SYMBOL res -312 -16 R0
SYMATTR InstName R3
SYMATTR Value 10k
SYMBOL res -184 -16 R0
SYMATTR InstName Rn
SYMATTR Value 10k
SYMBOL LED -568 80 R0
SYMATTR InstName D1
SYMBOL LED -440 80 R0
SYMATTR InstName D2
SYMBOL LED -312 80 R0
SYMATTR InstName D3
SYMBOL LED -184 80 R0
SYMATTR InstName Dn
SYMBOL OpAmps\\LM308 184 -336 R0
SYMATTR InstName U2
SYMBOL res 184 -400 R90
SYMATTR InstName Rb
SYMATTR Value 1000k
SYMBOL diode 24 -192 R180
SYMATTR InstName Db
SYMBOL OpAmps\\LM308 360 -96 R0
SYMATTR InstName U3
SYMBOL res 360 -160 R90
SYMATTR InstName Rc
SYMATTR Value 1000k
SYMBOL diode 200 48 R180
SYMATTR InstName Dc
SYMBOL OpAmps\\LM308 -376 -336 R0
SYMATTR InstName U1
SYMBOL res -376 -400 R90
SYMATTR InstName Ra
SYMATTR Value 1000k
SYMBOL diode -536 -192 R180
SYMATTR InstName Da
SYMBOL OpAmps\\LM308 296 240 R0
SYMATTR InstName Ud
SYMBOL res 296 176 R90
SYMATTR InstName Rd
SYMATTR Value 1000k
SYMBOL diode 136 384 R180
SYMATTR InstName Dd