By opening and closing the switches, the output can be manipulated to be binary. The resistors double in value as the switches go down, therefore, there will be a greater current flowing through the top switch, half as much in the next, and so on.
The output is the binary sum of the input * 5V.
Switch 0 (160k) = 0.3125V
Switch 1 (80k) = 0.625V
Switch 2 (40k) = 1.25V
Switch 3 (20k) = 2.5V
0001 = 0.3125V
1111 = 4.6875V