Here's a schematic for educational purposes only.
For an 8-bit pot. 8 resistors, each with a CMOS analogue switch in parallel, are wired in series.
The switches need to have a low on resistance <10R, a CD4066 is not good enough, you need something like a MAX312.
This will give a resistance range of <80R to 102k in 400R steps.
If you wanted to build this yourself, you'd need two quad analogue switch ICs and 16 resistors because they're non-standard values, each will comprise of two in series to get the correct value i.e. for 12.8k you'll need 11k and 1k8 in series, for 25k6 you'll need 20k and 5k6 in series etc.
As I said above it's a silly idea because it's much cheaper and easier to buy a single IC that does the job for half the price.