A decoder is a device which does the reverse of an encoder, undoing the encoding so that the original information can be retrieved. An encoder is a device used to change a signal (such as a Bitstream) or Data into a Code. The same method used to encode is usually just reversed in order to decode.
In digital electronics this would mean that a decoder is a multiple-input, multiple-output logic circuit that converts coded inputs into coded outputs, where the input and output codes are different. A logic gate performs a logical operation on one or more logic inputs and produces a single logic output e. g. n-to-2n, BCD decoders.
Enable inputs must be on for the decoder to function, otherwise its outputs assume a single "disabled" output code word. Decoding is necessary in applications such as data multiplexing, 7 segment display and memory address decoding. For multiplexing in electronics and signal processing see Multiplexer. In Psychology, memory is an organism's ability to store retain and subsequently retrieve information
The simplest decoder circuit would be an AND gate because the output of an AND gate is "High" (1) only when all its inputs are "High". A logic gate performs a logical operation on one or more logic inputs and produces a single logic output
A slightly more complex decoder would be the n-to-2n type binary decoders. The binary numeral system, or base-2 number system, is a Numeral system that represents numeric values using two symbols usually 0 and 1. These type of decoders are combinational circuits that convert binary information from 'n' coded inputs to a maximum of 2n unique outputs. We say a maximum of 2n outputs because in case the 'n' bit coded information has unused bit combinations, the decoder may have less than 2n outputs. A bit is a binary digit, taking a value of either 0 or 1 Binary digits are a basic unit of Information storage and communication We can have 2-to-4 decoder, 3-to-8 decoder or 4-to-16 decoder. We can form a 3-to-8 decoder from two 2-to-4 decoders (with enable signals).
Similarly, we can also form a 4-to-16 decoder by combining two 3-to-8 decoders. In this type of circuit design, the enable inputs of both 3-to-8 decoders originate from a 4th input, which acts as a selector between the two 3-to-8 decoders. This allows the 4th input to enable either the top or bottom decoder, which produces outputs of D(0) through D(7) for the first decoder, and D(8) through D(15) for the second decoder.
It is important to note that a decoder that contains enable inputs is also known as a decoder-demultiplexer. Thus, we have a 4-to-16 decoder produced by adding a 4th input shared among both decoders, producing 16 outputs.