* SPICE netlist
V2 Vs+ 0 12V
R_load BATT_POS 0 100R
V1 Vs- 0 -12V
V3 C4_P C3_P 4V
V4 C3_P C2_P 4V
V5 C2_P Cell1_v 4V
V6 Cell1_v 0 4V
R17 N003 N001 20K
R18 N005 Vshunt 20K
R19 N002 N003 20k
R20 N005 0 20k
R21 N020 Cell1_v 20K
R22 N019 C2_P 20K
R23 Mux2 N020 20k
R24 N019 0 20k
R25 N018 C2_P 20K
R26 N016 C3_P 20K
R27 Mux3 N018 20k
R28 N016 0 20k
R29 N011 C3_P 20K
R30 N010 C4_P 20K
R31 Mux4 N011 20k
R32 N010 0 20k
RShunt1 N001 Vshunt 0.1 pwr=10W
XU6 Vs+ TRUE 0 0 0 TRUE Cell1_v Mux2 Mux3 Mux4 N015 N014 N013 N012 N017 0 ADG5208 ;pnba Vdd)A0)A1)A2)Vss)EN)S1)S2)S3)S4)S5)S6)S7)S8)D)GND
XU7 N009 N007 Vs+ Vs- N007 LM324/NS ;pnba In+)In-)V+)V-)OUT
XU8 N006 N004 Vs+ Vs- ShuntOut LM324/NS ;pnba In+)In-)V+)V-)OUT
R33 N004 N002 48.48K
R34 N006 N007 48.48K
R35 N009 Vs+ 20k
R36 0 N009 10k
R37 0 N006 20k
R38 ShuntOut N004 20k
XU9 N005 N003 Vs+ Vs- N002 LM324/NS ;pnba In+)In-)V+)V-)OUT
XU10 N016 N018 Vs+ 0 Mux3 LM324/NS ;pnba In+)In-)V+)V-)OUT
XU11 N010 N011 Vs+ 0 Mux4 LM324/NS ;pnba In+)In-)V+)V-)OUT
XU12 N019 N020 Vs+ 0 Mux2 LM324/NS ;pnba In+)In-)V+)V-)OUT
R39 MUX_Out 0 94.25K
R40 N017 MUX_Out 20K
V7 TRUE 0 3.3V
V8 N001 N008 {VSIM}
R1 N008 Vshunt 50R
.include nat_semi.lib
.step param VSIM -2000 2000 200
.op

* LTspice schematic (.asc)
Version 4
SHEET 1 2400 2080
WIRE -768 -1040 -1056 -1040
WIRE -336 -1024 -368 -1024
WIRE -768 -976 -768 -1040
WIRE -624 -976 -768 -976
WIRE -496 -976 -544 -976
WIRE -448 -976 -448 -1024
WIRE -448 -976 -496 -976
WIRE 400 -976 272 -976
WIRE 512 -976 480 -976
WIRE -1056 -960 -1056 -1040
WIRE -768 -960 -768 -976
WIRE -496 -928 -496 -976
WIRE -448 -928 -496 -928
WIRE -336 -912 -336 -1024
WIRE -336 -912 -384 -912
WIRE 144 -912 -336 -912
WIRE 272 -912 272 -976
WIRE 272 -912 224 -912
WIRE 304 -912 272 -912
WIRE -448 -896 -496 -896
WIRE 512 -896 512 -976
WIRE 512 -896 368 -896
WIRE 576 -896 512 -896
WIRE -624 -880 -656 -880
WIRE -496 -880 -496 -896
WIRE -496 -880 -544 -880
WIRE 304 -880 272 -880
WIRE -768 -864 -768 -880
WIRE -720 -864 -768 -864
WIRE -656 -864 -656 -880
WIRE -656 -864 -720 -864
WIRE -416 -848 -416 -880
WIRE -368 -848 -416 -848
WIRE 176 -848 144 -848
WIRE 272 -848 272 -880
WIRE 272 -848 256 -848
WIRE 304 -848 272 -848
WIRE -496 -800 -496 -880
WIRE -1056 -784 -1056 -880
WIRE -368 -768 -368 -848
WIRE 1104 -704 1008 -704
WIRE -496 -672 -496 -720
WIRE 144 -672 144 -848
WIRE 144 -672 64 -672
WIRE 304 -672 304 -848
WIRE 1008 -656 1008 -704
WIRE -1056 -624 -1056 -704
WIRE -768 -624 -768 -864
WIRE -768 -624 -1056 -624
WIRE 144 -624 144 -672
WIRE 1008 -560 1008 -576
WIRE 1120 -560 1008 -560
WIRE 1184 -560 1120 -560
WIRE 1008 -544 1008 -560
WIRE 64 -512 64 -672
WIRE 128 -512 128 -560
WIRE 128 -512 64 -512
WIRE 1120 -512 1120 -560
WIRE 160 -496 160 -560
WIRE 192 -496 160 -496
WIRE 304 -496 304 -592
WIRE 304 -496 272 -496
WIRE 160 -448 160 -496
WIRE 1008 -400 1008 -464
WIRE 1104 -400 1008 -400
WIRE 304 -384 304 -496
WIRE 160 -336 160 -368
WIRE 1072 -336 1008 -336
WIRE 1008 -288 1008 -336
WIRE 304 -224 176 -224
WIRE 416 -224 304 -224
WIRE -1152 -192 -1200 -192
WIRE -768 -192 -1152 -192
WIRE 64 -176 -96 -176
WIRE 416 -176 416 -224
WIRE 1008 -176 1008 -208
WIRE 1072 -176 1008 -176
WIRE -1200 -128 -1200 -192
WIRE -96 -128 -96 -176
WIRE 176 -128 176 -224
WIRE 304 -128 304 -224
WIRE 64 -80 64 -176
WIRE 64 -80 32 -80
WIRE 112 -80 64 -80
WIRE 1200 -48 1088 -48
WIRE -416 -32 -448 -32
WIRE -320 -32 -336 -32
WIRE -288 -32 -320 -32
WIRE 64 -16 64 -80
WIRE 64 -16 32 -16
WIRE 112 -16 64 -16
WIRE -320 16 -320 -32
WIRE -320 16 -368 16
WIRE 1200 16 1200 -48
WIRE -1200 32 -1200 -64
WIRE -1152 32 -1200 32
WIRE -960 32 -1152 32
WIRE -768 48 -768 -192
WIRE -576 48 -768 48
WIRE -448 48 -448 -32
WIRE -448 48 -496 48
WIRE -368 48 -368 16
WIRE 64 48 32 48
WIRE 112 48 64 48
WIRE 416 48 368 48
WIRE 544 48 416 48
WIRE -448 64 -448 48
WIRE -400 64 -448 64
WIRE -288 80 -336 80
WIRE -176 80 -288 80
WIRE -96 80 -96 48
WIRE 64 80 64 48
WIRE 64 80 -96 80
WIRE -400 96 -448 96
WIRE 112 112 32 112
WIRE -576 144 -624 144
WIRE -448 144 -448 96
WIRE -448 144 -496 144
WIRE -400 144 -448 144
WIRE -1200 176 -1200 32
WIRE 112 176 32 176
WIRE 1200 176 1200 96
WIRE -400 192 -400 144
WIRE -288 192 -288 80
WIRE -288 192 -320 192
WIRE 112 240 32 240
WIRE -960 272 -960 32
WIRE -768 272 -960 272
WIRE -624 272 -624 144
WIRE -624 272 -768 272
WIRE 112 304 32 304
WIRE -416 320 -448 320
WIRE -320 320 -336 320
WIRE -288 320 -320 320
WIRE 496 336 368 336
WIRE -320 368 -320 320
WIRE -320 368 -368 368
WIRE -176 368 -176 80
WIRE 112 368 -176 368
WIRE 496 384 496 336
WIRE -624 400 -624 272
WIRE -576 400 -624 400
WIRE -448 400 -448 320
WIRE -448 400 -496 400
WIRE -368 400 -368 368
WIRE -1200 416 -1200 240
WIRE -1152 416 -1200 416
WIRE -960 416 -1152 416
WIRE -448 416 -448 400
WIRE -400 416 -448 416
WIRE -288 432 -336 432
WIRE -224 432 -288 432
WIRE 112 432 -224 432
WIRE -400 448 -448 448
WIRE -576 496 -624 496
WIRE -448 496 -448 448
WIRE -448 496 -496 496
WIRE -400 496 -448 496
WIRE 112 496 -176 496
WIRE 496 496 496 464
WIRE 736 496 496 496
WIRE -1200 512 -1200 416
WIRE -400 544 -400 496
WIRE -288 544 -288 432
WIRE -288 544 -320 544
WIRE 496 544 496 496
WIRE 112 560 -160 560
WIRE -960 656 -960 416
WIRE -768 656 -960 656
WIRE -624 656 -624 496
WIRE -624 656 -768 656
WIRE -416 672 -448 672
WIRE -320 672 -336 672
WIRE -288 672 -320 672
WIRE 240 688 240 624
WIRE 496 688 496 624
WIRE -320 720 -320 672
WIRE -320 720 -368 720
WIRE -1200 752 -1200 576
WIRE -1152 752 -1200 752
WIRE -960 752 -1152 752
WIRE -624 752 -624 656
WIRE -576 752 -624 752
WIRE -448 752 -448 672
WIRE -448 752 -496 752
WIRE -368 752 -368 720
WIRE -448 768 -448 752
WIRE -400 768 -448 768
WIRE -288 784 -336 784
WIRE -224 784 -288 784
WIRE -176 784 -176 496
WIRE -176 784 -224 784
WIRE -400 800 -448 800
WIRE -1200 848 -1200 752
WIRE -576 848 -624 848
WIRE -448 848 -448 800
WIRE -448 848 -496 848
WIRE -400 848 -448 848
WIRE -400 896 -400 848
WIRE -288 896 -288 784
WIRE -288 896 -320 896
WIRE -1200 992 -1200 912
WIRE -1120 992 -1200 992
WIRE -960 992 -960 752
WIRE -768 992 -960 992
WIRE -624 992 -624 848
WIRE -624 992 -768 992
WIRE -224 992 -624 992
WIRE -160 992 -160 560
WIRE -160 992 -224 992
WIRE -1200 1040 -1200 992
FLAG 1120 -512 0
FLAG 1104 -704 Vs+
FLAG -1200 1040 0
FLAG -1152 752 Cell1_v
FLAG -1152 416 Cell2_v
FLAG -1152 32 Cell3_v
FLAG -1152 -192 Cell4_v
FLAG 1072 -176 BATT_NEG
FLAG 1072 -336 BATT_POS
FLAG -1120 992 Cell1_Neg
FLAG 1104 -400 Vs-
FLAG -416 -944 Vs+
IOPIN 1952 -352 In
FLAG -368 816 Vs+
IOPIN 2000 1408 In
FLAG -368 464 Vs+
IOPIN 2000 1056 In
FLAG -368 112 Vs+
IOPIN 2000 704 In
FLAG -768 992 C1_P
IOPIN 1600 1584 In
FLAG -768 656 C2_P
IOPIN 1600 1248 In
FLAG -768 272 C3_P
IOPIN 1600 864 In
FLAG -768 48 C4_P
IOPIN 1600 640 In
FLAG -224 784 Mux2
FLAG -224 432 Mux3
FLAG -176 80 Mux4
FLAG -224 992 Mux1
FLAG -720 -864 Vshunt
FLAG -368 -768 Vs-
IOPIN 2000 -176 In
FLAG -288 -32 GND
IOPIN 2080 560 BiDir
FLAG -288 320 GND
IOPIN 2080 912 BiDir
FLAG -288 672 GND
IOPIN 2080 1264 BiDir
FLAG 736 496 MUX_Out
IOPIN 3104 1088 Out
FLAG 240 688 Vs+
IOPIN 2608 1280 In
FLAG 576 -896 ShuntOut
IOPIN 2944 -304 Out
FLAG 304 -384 GND
IOPIN 2672 208 BiDir
FLAG 160 -336 Vs+
IOPIN 2528 256 In
FLAG 336 -864 Vs-
IOPIN 2704 -272 In
FLAG 176 -592 Vs-
IOPIN 2544 0 In
FLAG 336 -928 Vs+
IOPIN 2704 -336 In
FLAG 112 -592 Vs+
IOPIN 2480 0 In
FLAG 496 688 GND
IOPIN 2864 1280 BiDir
FLAG 32 48 SEL0
IOPIN 2400 640 In
FLAG 416 48 EN
IOPIN 2784 640 In
FLAG 1184 -560 GND
IOPIN 3552 32 BiDir
FLAG 1200 176 0
FLAG 1088 -48 TRUE
FLAG -96 48 TRUE
FLAG 544 48 TRUE
FLAG 416 -176 0
FLAG -496 -672 0
FLAG -1200 992 BATT_NEG
FLAG 32 -16 SEL1
IOPIN 2400 576 In
FLAG 32 -80 SEL2
IOPIN 2400 512 In
FLAG -96 -128 0
SYMBOL voltage 1008 -672 M0
SYMATTR InstName V2
SYMATTR Value 12V
SYMBOL res 1024 -304 M0
SYMATTR InstName R_load
SYMATTR Value 100R
SYMBOL voltage 1008 -448 M180
SYMATTR InstName V1
SYMATTR Value -12V
SYMBOL Misc\\cell -1200 -128 R0
SYMATTR InstName V3
SYMATTR Value 4V
SYMBOL Misc\\cell -1200 176 R0
SYMATTR InstName V4
SYMATTR Value 4V
SYMBOL Misc\\cell -1200 512 R0
SYMATTR InstName V5
SYMATTR Value 4V
SYMBOL Misc\\cell -1200 848 R0
SYMATTR InstName V6
SYMATTR Value 4V
SYMBOL res -528 -992 R90
SYMATTR InstName R17
SYMATTR Value 20K
SYMBOL res -528 -896 R90
SYMATTR InstName R18
SYMATTR Value 20K
SYMBOL res -352 -1040 R90
SYMATTR InstName R19
SYMATTR Value 20k
SYMBOL res -512 -816 R0
SYMATTR InstName R20
SYMATTR Value 20k
SYMBOL res -480 864 M270
SYMATTR InstName R21
SYMATTR Value 20K
SYMBOL res -480 768 M270
SYMATTR InstName R22
SYMATTR Value 20K
SYMBOL res -304 912 M270
SYMATTR InstName R23
SYMATTR Value 20k
SYMBOL res -432 656 M90
SYMATTR InstName R24
SYMATTR Value 20k
SYMBOL res -480 512 M270
SYMATTR InstName R25
SYMATTR Value 20K
SYMBOL res -480 416 M270
SYMATTR InstName R26
SYMATTR Value 20K
SYMBOL res -304 560 M270
SYMATTR InstName R27
SYMATTR Value 20k
SYMBOL res -432 304 M90
SYMATTR InstName R28
SYMATTR Value 20k
SYMBOL res -480 160 M270
SYMATTR InstName R29
SYMATTR Value 20K
SYMBOL res -480 64 M270
SYMATTR InstName R30
SYMATTR Value 20K
SYMBOL res -304 208 M270
SYMATTR InstName R31
SYMATTR Value 20k
SYMBOL res -432 -48 M90
SYMATTR InstName R32
SYMATTR Value 20k
SYMBOL res -784 -976 R0
SYMATTR InstName Shunt1
SYMATTR Value 0.1
SYMATTR SpiceLine pwr=10W
SYMBOL Switches\\ADG5208 240 304 M180
SYMATTR InstName U6
SYMBOL Opamps\\opamp2 80 -592 R270
SYMATTR InstName U7
SYMATTR Value LM324/NS
SYMBOL Opamps\\opamp2 336 -960 R0
SYMATTR InstName U8
SYMATTR Value LM324/NS
SYMBOL res 240 -928 R90
SYMATTR InstName R33
SYMATTR Value 48.48K
SYMBOL res 272 -864 R90
SYMATTR InstName R34
SYMATTR Value 48.48K
SYMBOL res 144 -464 R0
SYMATTR InstName R35
SYMATTR Value 20k
SYMBOL res 288 -512 R90
SYMATTR InstName R36
SYMATTR Value 10k
SYMBOL res 320 -576 R180
SYMATTR InstName R37
SYMATTR Value 20k
SYMBOL res 496 -992 R90
SYMATTR InstName R38
SYMATTR Value 20k
SYMBOL Opamps\\opamp2 -416 -976 R0
SYMATTR InstName U9
SYMATTR Value LM324/NS
SYMBOL Opamps\\opamp2 -368 496 M180
SYMATTR InstName U10
SYMATTR Value LM324/NS
SYMBOL Opamps\\opamp2 -368 144 M180
SYMATTR InstName U11
SYMATTR Value LM324/NS
SYMBOL Opamps\\opamp2 -368 848 M180
SYMATTR InstName U12
SYMATTR Value LM324/NS
SYMBOL res 512 528 M0
SYMATTR InstName R39
SYMATTR Value 94.25K
SYMBOL res 512 368 M0
SYMATTR InstName R40
SYMATTR Value 20K
SYMBOL voltage 1200 0 R0
SYMATTR InstName V7
SYMATTR Value 3.3V
SYMBOL voltage -1056 -976 R0
SYMATTR InstName V8
SYMATTR Value {VSIM}
SYMBOL res -1072 -800 R0
SYMATTR InstName R1
SYMATTR Value 50R