hey Jack , so to get your own resistor ladder with a base voltage for the needed number of bits of yours , this is the mathematical method that i usually use . n being the number of bits

— R -------------/

— 2R------------/

— 4R------------/

.

.

—(2^(n-1))R—/

VCC-----R’-----------/----------------output

/

R’’

/

GND

first you must understand how a voltage divider works .

(Voltage input - Vin) ---------- R1 ------/------------R2-----------GND Vout = Vin* R2/(R1+R2)

/

(Voltage output - Vout) Vout = 5 * R2/(R1+R2)

the bit input pins resistances must be in power of two from they each other . so you have to figure out three values R , R’ and R’’ . if you set R’’ to 100R . (R’ is connected to VCC for the base voltage

then all you need is to do the rest of the calculation using the simple laws .

so if all the input bits are at a low state ,then for the voltage divider circuit you have R1 = R’ since it’s the only pin connected to VCC (input) . and for R2 you have all the R power resistors in parallel connected to ground

in parallel with the R’’ resistor

the resistance of that in this case would be 1/Req = 1/R + 1/2R + 1/4R + … + 1/(2^(n-1))R

can be calculated → x = R/Req = 1 + 1/2 + 1/4 + … + 1/(2^(n-1))

Req = R/x

so 1/R2 = x/R + 1/100 ← (R’’=100ohms)

1/R2 = (100x + R)/100R -------> R2 = 100R/(100x + R) ← only unknown here is R

so the voltage divider equation for the first part is

(Vout here is the base voltage . Vb) ( we need R and R’ in an equation)

Vb = 5 * R2/(R1+R2) = 5 * 100R/( (100x+R)*(R’+(100R/(100x + R))))

so the first equation is 500R/( (100x+R)*(R’+(100R/(100x + R)))) = Vb ← base voltage

the second part covers the output case , that is the top voltage

when both R’ and the power resistors are all set to 5v so Req and R’ are both connected to VCC and R" is connected to ground . so now R2 = R" = 100

and 1/R1 = 1/R’ + x/R

then 1/R1 = (R+ R’x)/RR’

so R1 = RR’/(R+R’x)

then we simply do the voltage divider equation again but with Vout = Vtop = top voltage

so Vtop = 5* R2/(R1+R2) = 500/(100 + (RR’/(R+R’x)))

then we must combine both the equations for Vtop and Vbase in the same equation then solve it .

so Vtop-Vbase = 500 * ( 1/(100 + (RR’/(R+R’x))) - R/( (100x+R)*(R’+(100R/(100x + R))))

so this is the needed equation . for R" = 100ohms

what you need now is to firstly calculate your X for your number of bits n

X= 1 + 1/2 + 1/4 + … 1/(2^(n-1))

then determine your needed Vtop and Vbase .

then input that equation that now only has two unknowns that are R and R’ in an online equation solver .

it will output the possible solutions .

for x rounded to 1.9

Vtop = 5 and Vbase = 4

and R"=100

R’ is named a

the equation is : 500*(1/(100+(R*a/(R+a*1.9)))-R/((190+R)*(a+(100*R/(190+R)))))=1

go to this site to solve it with your parameters “www.wolframalpha.com” ← best one i know

you would propably find many solutions , get one where R and R’ are positive and work with it

solutions for that case are :

tell me if i did get something wrong .

-amine2