Weighted Resistor DAC Equation
You have posted pictures of a DAC, and a link to one. They have identical function.

The line of resistors has a factor of 2 between them, they are binary weighted.

The resistors are switched either between 2 voltages (your picture) or between connected and unconnected (your link). In both this changes a current through them. As the resistors are scaled in binary, the currents are scaled in binary.

The currents are summed at a summing amplifier. The output voltage is proportional to the sum of resistor currents.

There are notation differences between the two, they are unimportant.