The use of digital compensation algorithms eliminates the error introduced by switches and the nonlinear behavior of MOS transistors. This approach greatly reduces analog area and permits field-programmable mixed-signal systems built with entirely digital technologies.