Although it is possible to implement one-bit DAC using a couple of FPGA pins, I've never got a useful result and the high-frequency toggling of the pins is not very subtle. So here's a cheap and cheerful way to interface a potentiometer to an FPGA.
http://hamsterworks.co.nz/mediawiki/index.php/Cheap_Analogue_InputIt is based on the technique I first came across when looking at the Apple ][ joystick interface, many, many moons ago. Is much better for playing Pong than two buttons, and uses half the pins.
Calibration of the result is not covered on the wiki page, but is pretty easy. Here it is half way between HDL and software.
if(min_value == 0xFFFF and max_value == 0) {
// Detect the inital values for these variables
min_value = this_value;
max_value = this_value;
}
if(min_value > this_value)
min_value = this_value;
if(max_value < this_value)
max_value = this_value;
calibrated = 0;
q = min_value*256;
for(i = 0; i < 256) {
if(q < this_value*256)
calibrated = i;
q = q + (max_value - min_value);
i++;
}
return calibrated;