8 resistors go in series. Their values are X, 2X, 4X, 8X, 16X, 32X, 64X, 128X, and so on if you want more steps. an FET goes across each resistor. Turn all off for a value of (close to) 256X. Turn all on for a value (close to) 0. Use combinations of off and on to get all values in between. Straight binary math.

But why do you need a higher value?