* SPICE netlist
R1 vcc Q1 {Rt}
V1 vcc 0 12
Q1 Q1n B1n 0 0 2N3904
Q2 Q1 B1 0 0 2N3904
R2 vcc Q1n {Rt}
R3 Q1n B1 {Rp}
R4 B1n Q1 {Rp}
D1 B1 clk1 1N4148
D2 B1n clk1 1N4148
V2 N001 0 PULSE(12 0 5m 1u 1u 50u 5m)
Q3 B1n P001 0 0 2N3904
V3 N008 0 PULSE(0 12 1m 10u 10u 1m)
R5 P001 N008 10k
C1 B1n Q1 {Cf}
C2 Q1n B1 {Cf}
C3 clk1 N001 1n
D4 0 B1 1N4148
D5 0 B1n 1N4148
R6 vcc clk1 100k
R7 clk1 0 100k
C6 clk2 N002 220p
R12 vcc clk2 100k
R13 clk2 0 100k
R14 Q1n N002 10k
R8 vcc Q2 {Rt}
Q4 Q2n B2n 0 0 2N3904
Q5 Q2 B2 0 0 2N3904
R9 vcc Q2n {Rt}
R10 Q2n B2 {Rp}
R11 B2n Q2 {Rp}
D3 B2 clk2 1N4148
D6 B2n clk2 1N4148
C4 B2n Q2 {Cf}
C5 Q2n B2 {Cf}
D7 0 B2 1N4148
D8 0 B2n 1N4148
C7 clk4 N003 220p
R16 vcc clk4 100k
R17 clk4 0 100k
R18 Q2n N003 10k
R19 vcc Q3 {Rt}
Q6 Q3n B3n 0 0 2N3904
Q7 Q3 B3 0 0 2N3904
R20 vcc Q3n {Rt}
R21 Q3n B3 {Rp}
R22 B3n Q3 {Rp}
D9 B3 clk4 1N4148
D10 B3n clk4 1N4148
C8 B3n Q3 {Cf}
C9 Q3n B3 {Cf}
D11 0 B3 1N4148
D12 0 B3n 1N4148
C10 clk8 N004 200p
R15 vcc clk8 100k
R23 clk8 0 100k
R24 Q3n N004 10k
R25 vcc Q4 {Rt}
Q8 Q4n B4n 0 0 2N3904
Q9 Q4 B4 0 0 2N3904
R26 vcc Q4n {Rt}
R27 Q4n B4 {Rp}
R28 B4n Q4 {Rp}
D13 B4 clk8 1N4148
D14 B4n clk8 1N4148
C11 B4n Q4 {Cf}
C12 Q4n B4 {Cf}
D15 0 B4 1N4148
D16 0 B4n 1N4148
C13 clk16 N005 200p
R29 vcc clk16 100k
R30 clk16 0 100k
R31 Q4n N005 10k
R32 vcc Q5 {Rt}
Q10 Q5n B5n 0 0 2N3904
Q11 Q5 B5 0 0 2N3904
R33 vcc Q5n {Rt}
R34 Q5n B5 {Rp}
R35 B5n Q5 {Rp}
D17 B5 clk16 1N4148
D18 B5n clk16 1N4148
C14 B5n Q5 {Cf}
C15 Q5n B5 {Cf}
D19 0 B5 1N4148
D20 0 B5n 1N4148
B1 N006 0 V=(V(Q1n)*1+V(Q2n)*2+V(Q3n)*4+V(Q4n)*8+V(Q5n)*16)/11
R36 N007 N006 10k
C16 N007 0 10n
.tran 250m
.param Rt=10k Cf=220p Rp=100k

* LTspice schematic (.asc)
Version 4
SHEET 1 4432 928
WIRE -1496 -352 -1496 -368
WIRE -1400 -352 -1496 -352
WIRE -1320 -352 -1336 -352
WIRE -1288 -352 -1304 -352
WIRE -1128 -352 -1128 -368
WIRE -1128 -352 -1224 -352
WIRE -664 -352 -664 -368
WIRE -568 -352 -664 -352
WIRE -488 -352 -504 -352
WIRE -456 -352 -472 -352
WIRE -296 -352 -296 -368
WIRE -296 -352 -392 -352
WIRE 168 -336 168 -352
WIRE 264 -336 168 -336
WIRE 344 -336 328 -336
WIRE 376 -336 360 -336
WIRE 536 -336 536 -352
WIRE 536 -336 440 -336
WIRE 1000 -336 1000 -352
WIRE 1096 -336 1000 -336
WIRE 1176 -336 1160 -336
WIRE 1208 -336 1192 -336
WIRE 1368 -336 1368 -352
WIRE 1368 -336 1272 -336
WIRE 1848 -320 1848 -336
WIRE 1944 -320 1848 -320
WIRE 2024 -320 2008 -320
WIRE 2056 -320 2040 -320
WIRE 2216 -320 2216 -336
WIRE 2216 -320 2120 -320
WIRE -1128 -304 -1128 -352
WIRE -888 -304 -1128 -304
WIRE -296 -288 -296 -352
WIRE -56 -288 -296 -288
WIRE 536 -288 536 -336
WIRE 776 -288 536 -288
WIRE -1496 -272 -1496 -352
WIRE -1416 -272 -1496 -272
WIRE -1400 -272 -1416 -272
WIRE -1320 -272 -1320 -352
WIRE -1304 -272 -1304 -352
WIRE -1192 -272 -1224 -272
WIRE -1128 -272 -1128 -304
WIRE -1128 -272 -1192 -272
WIRE -664 -272 -664 -352
WIRE -584 -272 -664 -272
WIRE -568 -272 -584 -272
WIRE -488 -272 -488 -352
WIRE -472 -272 -472 -352
WIRE -360 -272 -392 -272
WIRE -296 -272 -296 -288
WIRE -296 -272 -360 -272
WIRE 1368 -272 1368 -336
WIRE 1624 -272 1368 -272
WIRE 168 -256 168 -336
WIRE 248 -256 168 -256
WIRE 264 -256 248 -256
WIRE 344 -256 344 -336
WIRE 360 -256 360 -336
WIRE 472 -256 440 -256
WIRE 536 -256 536 -288
WIRE 536 -256 472 -256
WIRE 1000 -256 1000 -336
WIRE 1080 -256 1000 -256
WIRE 1096 -256 1080 -256
WIRE 1176 -256 1176 -336
WIRE 1192 -256 1192 -336
WIRE 1304 -256 1272 -256
WIRE 1368 -256 1368 -272
WIRE 1368 -256 1304 -256
WIRE 1848 -240 1848 -320
WIRE 1928 -240 1848 -240
WIRE 1944 -240 1928 -240
WIRE 2024 -240 2024 -320
WIRE 2040 -240 2040 -320
WIRE 2152 -240 2120 -240
WIRE 2216 -240 2216 -320
WIRE 2216 -240 2152 -240
WIRE -1496 -224 -1496 -272
WIRE -1128 -224 -1128 -272
WIRE -664 -224 -664 -272
WIRE -296 -224 -296 -272
WIRE 168 -208 168 -256
WIRE 536 -208 536 -256
WIRE 1000 -208 1000 -256
WIRE 1368 -208 1368 -256
WIRE -1416 -192 -1432 -192
WIRE -1368 -192 -1416 -192
WIRE -1304 -192 -1304 -272
WIRE -1304 -192 -1368 -192
WIRE -888 -192 -888 -304
WIRE -584 -192 -600 -192
WIRE -536 -192 -584 -192
WIRE -472 -192 -472 -272
WIRE -472 -192 -536 -192
WIRE 1848 -192 1848 -240
WIRE 2216 -192 2216 -240
WIRE -1432 -176 -1432 -192
WIRE -1320 -176 -1320 -272
WIRE -1256 -176 -1320 -176
WIRE -1224 -176 -1256 -176
WIRE -1192 -176 -1224 -176
WIRE -600 -176 -600 -192
WIRE -488 -176 -488 -272
WIRE -424 -176 -488 -176
WIRE -392 -176 -424 -176
WIRE -360 -176 -392 -176
WIRE -56 -176 -56 -288
WIRE 248 -176 232 -176
WIRE 296 -176 248 -176
WIRE 360 -176 360 -256
WIRE 360 -176 296 -176
WIRE 776 -176 776 -288
WIRE 1080 -176 1064 -176
WIRE 1128 -176 1080 -176
WIRE 1192 -176 1192 -256
WIRE 1192 -176 1128 -176
WIRE 232 -160 232 -176
WIRE 344 -160 344 -256
WIRE 408 -160 344 -160
WIRE 440 -160 408 -160
WIRE 472 -160 440 -160
WIRE 1064 -160 1064 -176
WIRE 1176 -160 1176 -256
WIRE 1240 -160 1176 -160
WIRE 1272 -160 1240 -160
WIRE 1304 -160 1272 -160
WIRE 1624 -160 1624 -272
WIRE 1928 -160 1912 -160
WIRE 1976 -160 1928 -160
WIRE 2040 -160 2040 -240
WIRE 2040 -160 1976 -160
WIRE 1912 -144 1912 -160
WIRE 2024 -144 2024 -240
WIRE 2088 -144 2024 -144
WIRE 2120 -144 2088 -144
WIRE 2152 -144 2120 -144
WIRE -1432 -112 -1432 -176
WIRE -1256 -112 -1256 -176
WIRE -600 -112 -600 -176
WIRE -424 -112 -424 -176
WIRE 232 -96 232 -160
WIRE 408 -96 408 -160
WIRE 1064 -96 1064 -160
WIRE 1240 -96 1240 -160
WIRE 1912 -80 1912 -144
WIRE 2088 -80 2088 -144
WIRE -2088 -48 -2200 -48
WIRE -1992 -48 -2024 -48
WIRE -1432 -48 -1992 -48
WIRE -1288 -48 -1432 -48
WIRE -1256 -48 -1288 -48
WIRE -888 -48 -888 -112
WIRE -792 -48 -824 -48
WIRE -600 -48 -792 -48
WIRE -456 -48 -600 -48
WIRE -424 -48 -456 -48
WIRE -56 -32 -56 -96
WIRE 40 -32 8 -32
WIRE 232 -32 40 -32
WIRE 376 -32 232 -32
WIRE 408 -32 376 -32
WIRE 776 -32 776 -96
WIRE 872 -32 840 -32
WIRE 1064 -32 872 -32
WIRE 1208 -32 1064 -32
WIRE 1240 -32 1208 -32
WIRE 1624 -16 1624 -80
WIRE 1720 -16 1688 -16
WIRE 1912 -16 1720 -16
WIRE 2056 -16 1912 -16
WIRE 2088 -16 2056 -16
WIRE -1992 48 -1992 32
WIRE -792 48 -792 32
WIRE 40 64 40 48
WIRE 872 64 872 48
WIRE 1720 80 1720 64
WIRE -744 272 -776 272
WIRE -648 272 -664 272
WIRE -632 272 -648 272
WIRE -776 304 -776 272
WIRE -1208 336 -1208 320
WIRE -1352 384 -1416 384
FLAG -2216 -304 0
FLAG -2216 -384 vcc
FLAG -1496 -448 vcc
FLAG -1128 -448 vcc
FLAG -1496 -128 0
FLAG -1128 -128 0
FLAG -1416 -272 Q1
FLAG -1192 -272 Q1n
FLAG -1416 -192 B1
FLAG -1224 -176 B1n
FLAG -1288 -48 clk1
FLAG -1208 432 0
FLAG -1416 464 0
FLAG -2200 32 0
FLAG -1320 -112 0
FLAG -1368 -128 0
FLAG -1992 -128 vcc
FLAG -1992 48 0
FLAG -792 -128 vcc
FLAG -792 48 0
FLAG -664 -448 vcc
FLAG -296 -448 vcc
FLAG -664 -128 0
FLAG -296 -128 0
FLAG -584 -272 Q2
FLAG -360 -272 Q2n
FLAG -584 -192 B2
FLAG -392 -176 B2n
FLAG -456 -48 clk2
FLAG -488 -112 0
FLAG -536 -128 0
FLAG 40 -112 vcc
FLAG 40 64 0
FLAG 168 -432 vcc
FLAG 536 -432 vcc
FLAG 168 -112 0
FLAG 536 -112 0
FLAG 248 -256 Q3
FLAG 472 -256 Q3n
FLAG 248 -176 B3
FLAG 440 -160 B3n
FLAG 376 -32 clk4
FLAG 344 -96 0
FLAG 296 -112 0
FLAG 872 -112 vcc
FLAG 872 64 0
FLAG 1000 -432 vcc
FLAG 1368 -432 vcc
FLAG 1000 -112 0
FLAG 1368 -112 0
FLAG 1080 -256 Q4
FLAG 1304 -256 Q4n
FLAG 1080 -176 B4
FLAG 1272 -160 B4n
FLAG 1208 -32 clk8
FLAG 1176 -96 0
FLAG 1128 -112 0
FLAG 1720 -96 vcc
FLAG 1720 80 0
FLAG 1848 -416 vcc
FLAG 2216 -416 vcc
FLAG 1848 -96 0
FLAG 2216 -96 0
FLAG 1928 -240 Q5
FLAG 2152 -240 Q5n
FLAG 1928 -160 B5
FLAG 2120 -144 B5n
FLAG 2056 -16 clk16
FLAG 2024 -80 0
FLAG 1976 -96 0
FLAG -1208 320 B1n
FLAG -776 384 0
FLAG -648 336 0
SYMBOL res -1512 -464 R0
SYMATTR InstName R1
SYMATTR Value {Rt}
SYMBOL voltage -2216 -400 R0
SYMATTR InstName V1
SYMATTR Value 12
SYMBOL npn -1192 -224 R0
SYMATTR InstName Q1
SYMATTR Value 2N3904
SYMBOL npn -1432 -224 M0
SYMATTR InstName Q2
SYMATTR Value 2N3904
SYMBOL res -1144 -464 R0
SYMATTR InstName R2
SYMATTR Value {Rt}
SYMBOL res -1208 -288 R90
SYMATTR InstName R3
SYMATTR Value {Rp}
SYMBOL res -1304 -288 R90
SYMATTR InstName R4
SYMATTR Value {Rp}
SYMBOL diode -1448 -112 R0
SYMATTR InstName D1
SYMATTR Value 1N4148
SYMBOL diode -1272 -112 R0
SYMATTR InstName D2
SYMATTR Value 1N4148
SYMBOL voltage -2200 -64 R0
SYMATTR InstName V2
SYMATTR Value PULSE(12 0 5m 1u 1u 50u 5m)
SYMBOL npn -1272 336 R0
SYMATTR InstName Q3
SYMATTR Value 2N3904
SYMBOL voltage -1416 368 R0
SYMATTR InstName V3
SYMATTR Value PULSE(0 12 1m 10u 10u 1m)
SYMBOL res -1256 368 R90
SYMATTR InstName R5
SYMATTR Value 10k
SYMBOL cap -1336 -368 R90
SYMATTR InstName C1
SYMATTR Value {Cf}
SYMBOL cap -1224 -368 R90
SYMATTR InstName C2
SYMATTR Value {Cf}
SYMBOL cap -2024 -64 R90
SYMATTR InstName C3
SYMATTR Value 1n
SYMBOL diode -1352 -128 R180
SYMATTR InstName D4
SYMATTR Value 1N4148
SYMBOL diode -1304 -112 R180
SYMATTR InstName D5
SYMATTR Value 1N4148
SYMBOL res -2008 -144 R0
SYMATTR InstName R6
SYMATTR Value 100k
SYMBOL res -2008 -64 R0
SYMATTR InstName R7
SYMATTR Value 100k
SYMBOL cap -824 -64 R90
SYMATTR InstName C6
SYMATTR Value 220p
SYMBOL res -808 -144 R0
SYMATTR InstName R12
SYMATTR Value 100k
SYMBOL res -808 -64 R0
SYMATTR InstName R13
SYMATTR Value 100k
SYMBOL res -904 -208 R0
SYMATTR InstName R14
SYMATTR Value 10k
SYMBOL res -680 -464 R0
SYMATTR InstName R8
SYMATTR Value {Rt}
SYMBOL npn -360 -224 R0
SYMATTR InstName Q4
SYMATTR Value 2N3904
SYMBOL npn -600 -224 M0
SYMATTR InstName Q5
SYMATTR Value 2N3904
SYMBOL res -312 -464 R0
SYMATTR InstName R9
SYMATTR Value {Rt}
SYMBOL res -376 -288 R90
SYMATTR InstName R10
SYMATTR Value {Rp}
SYMBOL res -472 -288 R90
SYMATTR InstName R11
SYMATTR Value {Rp}
SYMBOL diode -616 -112 R0
SYMATTR InstName D3
SYMATTR Value 1N4148
SYMBOL diode -440 -112 R0
SYMATTR InstName D6
SYMATTR Value 1N4148
SYMBOL cap -504 -368 R90
SYMATTR InstName C4
SYMATTR Value {Cf}
SYMBOL cap -392 -368 R90
SYMATTR InstName C5
SYMATTR Value {Cf}
SYMBOL diode -520 -128 R180
SYMATTR InstName D7
SYMATTR Value 1N4148
SYMBOL diode -472 -112 R180
SYMATTR InstName D8
SYMATTR Value 1N4148
SYMBOL cap 8 -48 R90
SYMATTR InstName C7
SYMATTR Value 220p
SYMBOL res 24 -128 R0
SYMATTR InstName R16
SYMATTR Value 100k
SYMBOL res 24 -48 R0
SYMATTR InstName R17
SYMATTR Value 100k
SYMBOL res -72 -192 R0
SYMATTR InstName R18
SYMATTR Value 10k
SYMBOL res 152 -448 R0
SYMATTR InstName R19
SYMATTR Value {Rt}
SYMBOL npn 472 -208 R0
SYMATTR InstName Q6
SYMATTR Value 2N3904
SYMBOL npn 232 -208 M0
SYMATTR InstName Q7
SYMATTR Value 2N3904
SYMBOL res 520 -448 R0
SYMATTR InstName R20
SYMATTR Value {Rt}
SYMBOL res 456 -272 R90
SYMATTR InstName R21
SYMATTR Value {Rp}
SYMBOL res 360 -272 R90
SYMATTR InstName R22
SYMATTR Value {Rp}
SYMBOL diode 216 -96 R0
SYMATTR InstName D9
SYMATTR Value 1N4148
SYMBOL diode 392 -96 R0
SYMATTR InstName D10
SYMATTR Value 1N4148
SYMBOL cap 328 -352 R90
SYMATTR InstName C8
SYMATTR Value {Cf}
SYMBOL cap 440 -352 R90
SYMATTR InstName C9
SYMATTR Value {Cf}
SYMBOL diode 312 -112 R180
SYMATTR InstName D11
SYMATTR Value 1N4148
SYMBOL diode 360 -96 R180
SYMATTR InstName D12
SYMATTR Value 1N4148
SYMBOL cap 840 -48 R90
SYMATTR InstName C10
SYMATTR Value 200p
SYMBOL res 856 -128 R0
SYMATTR InstName R15
SYMATTR Value 100k
SYMBOL res 856 -48 R0
SYMATTR InstName R23
SYMATTR Value 100k
SYMBOL res 760 -192 R0
SYMATTR InstName R24
SYMATTR Value 10k
SYMBOL res 984 -448 R0
SYMATTR InstName R25
SYMATTR Value {Rt}
SYMBOL npn 1304 -208 R0
SYMATTR InstName Q8
SYMATTR Value 2N3904
SYMBOL npn 1064 -208 M0
SYMATTR InstName Q9
SYMATTR Value 2N3904
SYMBOL res 1352 -448 R0
SYMATTR InstName R26
SYMATTR Value {Rt}
SYMBOL res 1288 -272 R90
SYMATTR InstName R27
SYMATTR Value {Rp}
SYMBOL res 1192 -272 R90
SYMATTR InstName R28
SYMATTR Value {Rp}
SYMBOL diode 1048 -96 R0
SYMATTR InstName D13
SYMATTR Value 1N4148
SYMBOL diode 1224 -96 R0
SYMATTR InstName D14
SYMATTR Value 1N4148
SYMBOL cap 1160 -352 R90
SYMATTR InstName C11
SYMATTR Value {Cf}
SYMBOL cap 1272 -352 R90
SYMATTR InstName C12
SYMATTR Value {Cf}
SYMBOL diode 1144 -112 R180
SYMATTR InstName D15
SYMATTR Value 1N4148
SYMBOL diode 1192 -96 R180
SYMATTR InstName D16
SYMATTR Value 1N4148
SYMBOL cap 1688 -32 R90
SYMATTR InstName C13
SYMATTR Value 200p
SYMBOL res 1704 -112 R0
SYMATTR InstName R29
SYMATTR Value 100k
SYMBOL res 1704 -32 R0
SYMATTR InstName R30
SYMATTR Value 100k
SYMBOL res 1608 -176 R0
SYMATTR InstName R31
SYMATTR Value 10k
SYMBOL res 1832 -432 R0
SYMATTR InstName R32
SYMATTR Value {Rt}
SYMBOL npn 2152 -192 R0
SYMATTR InstName Q10
SYMATTR Value 2N3904
SYMBOL npn 1912 -192 M0
SYMATTR InstName Q11
SYMATTR Value 2N3904
SYMBOL res 2200 -432 R0
SYMATTR InstName R33
SYMATTR Value {Rt}
SYMBOL res 2136 -256 R90
SYMATTR InstName R34
SYMATTR Value {Rp}
SYMBOL res 2040 -256 R90
SYMATTR InstName R35
SYMATTR Value {Rp}
SYMBOL diode 1896 -80 R0
SYMATTR InstName D17
SYMATTR Value 1N4148
SYMBOL diode 2072 -80 R0
SYMATTR InstName D18
SYMATTR Value 1N4148
SYMBOL cap 2008 -336 R90
SYMATTR InstName C14
SYMATTR Value {Cf}
SYMBOL cap 2120 -336 R90
SYMATTR InstName C15
SYMATTR Value {Cf}
SYMBOL diode 1992 -96 R180
SYMATTR InstName D19
SYMATTR Value 1N4148
SYMBOL diode 2040 -80 R180
SYMATTR InstName D20
SYMATTR Value 1N4148
SYMBOL bv -776 288 R0
SYMATTR InstName B1
SYMATTR Value V=(V(Q1n)*1+V(Q2n)*2+V(Q3n)*4+V(Q4n)*8+V(Q5n)*16)/11
SYMBOL res -648 256 R90
SYMATTR InstName R36
SYMATTR Value 10k
SYMBOL cap -664 272 R0
SYMATTR InstName C16
SYMATTR Value 10n