Using R-2R ladder 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 2K and 1K.
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 2K and 1K resistor. Similarly add more resistors for more bits.