Chris from pyroelectro sent me this link some time ago. This project shows how can someone use an FPGA or CPLD and an A/D converter to read a trimmer and then output the appropriate PWM signal to a motor controller IC, eventually controlling the speed and direction of a DC motor.
Chris uses the MAX150 analog-to-digital converter to read the trimpot. When digitization ends, the EPM7128 CPLD reads the signal and it creates the proper PWM pulses for the SN755410NE DC motor controller chip. You can find detailed documentation in this link. Thank you [Chris]