Using Resistive Divider circuit.
MSB should be given on right most resistor and LSB to left most resistor. Enter the remaining bits in the respective order.
Analog Output is taken from junction between right most 1K and 1M resistors.
Extra zeros added to MSB will affect the analog output. So disconnect extra resistors.
This circuit is for 4 bits. If you want to use it for lesser bits then disconnect extra resistors counting from LSB and take output from junction of last 1K and 1M resistor. Similarly add more resistors for more bits.