Your Circuit:

Calculated Values:

Vout requires a 10K pull-down resistor so that ALL at position 0 reads 0V, code 0
or use a 10K pull-up resistor so that ALL at position 0 reads 5V, code 1023.
The resistor will influence all voltage readings by a small amount.