* SPICE netlist
R1 Vtrip 0 100Meg
R2 VDD Vtrip 100Meg
S5 B3L Vone B3 Vtrip switmod
S6 0 B3L Vtrip B3 switmod
S7 B2L Vone B2 Vtrip switmod
S8 0 B2L Vtrip B2 switmod
S13 B1L Vone B1 Vtrip switmod
S14 0 B1L Vtrip B1 switmod
S15 B0L Vone B0 Vtrip switmod
S16 0 B0L Vtrip B0 switmod
B1 Vout 0 V=((v(vrefp)-v(vrefm))/16)*(v(B3L)*8+v(B2L)*4+v(B1L)*2+v(B0L))+v(vrefm)
R3 Vrefp Vrefm 100Meg
Vone Vone 0 1

* LTspice schematic (.asc)
Version 4
SHEET 1 1584 704
WIRE -664 -272 -776 -272
WIRE -664 -240 -664 -272
WIRE -664 -112 -776 -112
WIRE -664 -112 -664 -160
WIRE -616 80 -792 80
WIRE -616 128 -792 128
WIRE -616 176 -792 176
WIRE -616 224 -792 224
WIRE -504 176 -504 112
WIRE -504 320 -504 256
WIRE -456 -288 -456 -352
WIRE -456 -176 -456 -208
WIRE -456 -144 -456 -176
WIRE -456 0 -456 -64
WIRE -376 -176 -456 -176
WIRE -344 -176 -376 -176
WIRE -88 -288 -136 -288
WIRE -88 -240 -136 -240
WIRE -88 -160 -136 -160
WIRE -88 -112 -136 -112
WIRE -88 112 -136 112
WIRE -88 160 -136 160
WIRE -88 240 -136 240
WIRE -88 288 -136 288
WIRE -40 -304 -40 -352
WIRE -40 -192 -40 -224
WIRE -40 -176 -40 -192
WIRE -40 -48 -40 -96
WIRE -40 96 -40 48
WIRE -40 208 -40 176
WIRE -40 224 -40 208
WIRE -40 352 -40 304
WIRE 88 -192 -40 -192
WIRE 88 208 -40 208
WIRE 120 -192 88 -192
WIRE 120 208 88 208
WIRE 376 -288 328 -288
WIRE 376 -240 328 -240
WIRE 376 -160 328 -160
WIRE 376 -112 328 -112
WIRE 376 112 328 112
WIRE 376 160 328 160
WIRE 376 240 328 240
WIRE 376 288 328 288
WIRE 424 -304 424 -352
WIRE 424 -192 424 -224
WIRE 424 -176 424 -192
WIRE 424 -48 424 -96
WIRE 424 96 424 48
WIRE 424 208 424 176
WIRE 424 224 424 208
WIRE 424 352 424 304
WIRE 552 -192 424 -192
WIRE 552 208 424 208
WIRE 584 -192 552 -192
WIRE 584 208 552 208
WIRE 632 -64 632 -112
WIRE 632 80 632 16
WIRE 792 -112 632 -112
FLAG -376 -176 Vtrip
FLAG -456 -352 VDD
IOPIN 528 -256 In
FLAG -136 -288 B3
FLAG -136 -240 Vtrip
FLAG -136 -160 Vtrip
FLAG -136 -112 B3
FLAG 88 -192 B3L
FLAG -40 -48 0
FLAG -136 112 B2
FLAG -136 160 Vtrip
FLAG -136 240 Vtrip
FLAG -136 288 B2
FLAG 88 208 B2L
FLAG -40 352 0
FLAG 328 -288 B1
FLAG 328 -240 Vtrip
FLAG 328 -160 Vtrip
FLAG 328 -112 B1
FLAG 552 -192 B1L
FLAG 424 -48 0
FLAG 328 112 B0
FLAG 328 160 Vtrip
FLAG 328 240 Vtrip
FLAG 328 288 B0
FLAG 552 208 B0L
FLAG 424 352 0
FLAG 632 80 0
FLAG 792 -112 Vout
IOPIN 1776 -16 Out
FLAG -776 -272 Vrefp
IOPIN 208 -176 In
FLAG -776 -112 Vrefm
IOPIN 208 -16 In
FLAG -792 80 B3
IOPIN 192 176 In
FLAG -792 128 B2
IOPIN 192 224 In
FLAG -792 176 B1
IOPIN 192 272 In
FLAG -792 224 B0
IOPIN 192 320 In
FLAG -456 0 0
FLAG -504 320 0
FLAG -504 112 Vone
FLAG -40 -352 Vone
FLAG -40 48 Vone
FLAG 424 -352 Vone
FLAG 424 48 Vone
SYMBOL res -472 -160 R0
SYMATTR InstName R1
SYMATTR Value 100MEG
SYMBOL res -472 -304 R0
SYMATTR InstName R2
SYMATTR Value 100MEG
SYMBOL sw -40 -208 M180
SYMATTR Value ""
SYMATTR InstName switmod
SYMATTR InstName S5
SYMBOL sw -40 -80 M180
SYMATTR Value ""
SYMATTR InstName switmod
SYMATTR InstName S6
SYMBOL sw -40 192 M180
SYMATTR Value ""
SYMATTR InstName switmod
SYMATTR InstName S7
SYMBOL sw -40 320 M180
SYMATTR Value ""
SYMATTR InstName switmod
SYMATTR InstName S8
SYMBOL sw 424 -208 M180
SYMATTR Value ""
SYMATTR InstName switmod
SYMATTR InstName S13
SYMBOL sw 424 -80 M180
SYMATTR Value ""
SYMATTR InstName switmod
SYMATTR InstName S14
SYMBOL sw 424 192 M180
SYMATTR Value ""
SYMATTR InstName switmod
SYMATTR InstName S15
SYMBOL sw 424 320 M180
SYMATTR Value ""
SYMATTR InstName switmod
SYMATTR InstName S16
SYMBOL bv 632 -80 R0
SYMATTR InstName B1
SYMATTR Value V=((v(vrefp)-v(vrefm))/16)*(v(B3L)*8+v(B2L)*4+v(B1L)*2+v(B0L))+v(vrefm)
SYMBOL res -680 -256 R0
SYMATTR InstName R3
SYMATTR Value 100MEG
SYMBOL voltage -504 160 R0
SYMATTR InstName Vone
SYMATTR Value 1