An encoder is a device used to encode a signal (such as a bitstream) or data into a form that is acceptable for transmission or storage. This is usually done by means of a programmed algorithm, especially if any part is digital, while most analogue encoding is done with analog circuitry.

For example, a rotary encoder is a sensor or transducer for converting rotary motion or position to a code of electronic pulses.
See also
External links
asic-world's Digital Combinational Logic (part III) - a very good overview of encoders.