A decoder turns an n-bit code into up to 2n output lines, and each output is one minterm of the inputs. A function is a sum of minterms, so any function can be built from a decoder plus an OR gate. Larger decoders can be made from smaller ones using enable inputs.
Encoder
An encoder is the reverse of a decoder: 2n input lines, n output lines. A priority encoder also works when several inputs are active. Decoder + encoder pairs can be combined into small designs such as code converters, adders and voting systems.
Multiplexer (data selector)
A multiplexer steers one of its 2n data inputs to a single output using n select lines: Y = Σ (data line · select minterm).
Demultiplexer
A demultiplexer sends the data on its single input to the one output chosen by the select lines. It is the same circuit as a decoder with an enable input: Decoder + enable = demultiplexer.