Encoder and decoder
Binary code of N digits can be used to store
2N distinct elements of coded information. This is
what encoders and decoders are used for.
Multiple inputs and multiple outputs
N-2N---Decoder( Binary to decimal,hexadecimal…
2N-N-→ Encoder (any num. system to binary)
Decoders
A decoder is a combinational circuit that
performs the reverse operation of an encoder,
converting n input lines into 2ⁿ output lines, with
only one output active for each input
combination.
Let’s take an example of 3-to-8 line decoder.
Truth Table -
Implementation -
D0 is high when X = 0, Y = 0 and Z = 0. Hence,
X Y Z D0 D1 D2 D3 D4 D5 D6 D7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
D0 = X’ Y’ Z’
Similarly,
D1 = X’ Y’ Z
D2 = X’ Y Z’
D3 = X’ Y Z
D4 = X Y’ Z’
D5 = X Y’ Z
D6 = X Y Z’
D7 = X Y Z
Encoders convert 2N lines of input into a code of N bits
and Decoders decode the N bits into 2N lines.
[Link] - An encoder is a combinational circuit that
converts binary information in the form of a 2N input lines
into N output lines, which represent N bit code for the
input. For simple encoders, it is assumed that only one
input line is active at a time. As an example, let’s
consider Octal to Binary encoder.
Truth Table -
D7 D6 D5 D4 D3 D2 D1 D0 X Y Z
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 1 0 0 0 1 0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0 1 0 1
0 1 0 0 0 0 0 0 1 1 0
1 0 0 0 0 0 0 0 1 1 1
As seen from the truth table, the output is 000 when D0 is active; 001 when D1 is active;
010 when D2 is active and so on.
As shown in the following figure, an octal-to-binary
encoder takes 8 input lines and generates 3 output lines.
A multiplexer is a combinational circuit that
has many data inputs and a single output,
depending on control or select inputs. For N
input lines, log2(N) selection lines are
required, or equivalently, for 2n input lines, n
selection lines are needed.
Multiplexers are also known as "N-to-1 selectors," parallel-
to-serial converters, many-to-one circuits, and universal
logic circuits.
They are mainly used to increase the amount of data
that can be sent over a network within a certain amount
of time and bandwidth.
Types of Mux
The Mux can be of different types based on input but in
this article, we will go through two major types of mux,
which are
2x1 Mux
4x1 Mux
2x1 Multiplexer
The 2x1 is a fundamental circuit which is also
known 2-to-1 multiplexer that are used to
choose one signal from two inputs and transmits
it to the output. The 2x1 mux has two input lines,
one output line, and a single selection line.
It has various applications in digital systems such
as in microprocessor it is used to select between
two different data sources or between two
different instructions.
The output of the 2x1 Mux will depend on the
selection line S0,
When S is 0(low), the I0 is selected
when S0 is 1(High), I1 is selected
Logical Expression of 2x1 Mux
Using the Truth Table ,the Logical Expression for
Mux can be determined as
Y= S’.I0+S.I1