ENCODERS


One might remember his/ her childhood days when we used to play detective-detective games and we used to write secret codes of some sort which others couldn’t understand.
It is often necessary to encode a particular signal from one form to another so that only the sender and the receiver understand it and no one else. This i most commonly used in defence applications. However in the language of electronics conversion from one code to another is also called as encoding (Generally conversion to binary form).

WHY DO WE NEED AN ENCODER??
One of the basic applications is to convert code from one form to another. Here let us consider conversion to binary.

WHAT IS AN ENCODER??
It is a digital circuit with 2n input lines and n output lines and which converts minterm inputs to binary coded outputs.

Let us see what each line does in a bit more detail:

2n Input lines: We apply the minterm data inputs here. Minterm data input means that only one of the input line is high at a time.

n Output lines: We get the binary coded output on these lines. The output is basically the binary equivalent of which minterm line (in decimal) was activated.

HOW DO I BUILD AN ENCODER??
Enough of theory, lets build some circuits now.
Let us consider an encoder with 2 output lines and 22 = 4 minterm input lines. This encoder is called an 4:2 Encoder.
Let us call the inputs as D0,D1,D2 and D3.
Let the outputs be denoted by Y0 and Y1.

Let us start off by writing the truth table for the 4:2 Encoder.
TRUTH TABLE:
D3       D2       D1       D0       Y1       Y0
0          0          0          1          0          0
0          0          1          0          0          1
0          1          0          0          1          0
1          0          0          0          1          1         
0          0          0          0          0          0         


Consolidating the above truth table we get,
{Y1,Y0} = Binary equivalent of [Decimal no. of input being active]
where { } represents the concatenation operator.

Circuit is left for the reader to implement as an assignment.


WHAT’S WRONG WITH THE ABOVE ENCODER??
Two main things which we see that are wrong with the above encoder are that:
First, we have assumed that only one input is active at a time, which may not be the case in practice.
Second, The output is same for the inputs 0001 and 0000 i.e., the output = 00.

In order to avoid the above errors we construct what is known as PRIORITY ENCODERS.

WHAT’S A PRORITY ENCODER??
One can have 2 kinds of priorities, more probity to higher minterm or more priority to lower minterm.
A simple analogy would be, in general for a basketball team taller members are chosen that is the priority is given to taller members.
Secondly we’ll use one more output called V or the valid output signal, which shows if any one of the input is active or not.
V is active if any one of the input is active else 0.
Hence for the input combination 0000 V = 0, else V = 1.
Let us assume that more priority is given to higher minterm.

Now let us write the truth table of a 4:2 Priority Encoder.
TRUTH TABLE:
D3       D2       D1       D0       Y1       Y0       V
0          0          0          0          X         X         0
0          0          0          1          0          0          1
0          0          1          X         0          1          1
0          1          X         X         1          0          1
1          X         X         X         1          1          1

X in the truth table indicates that we don’t care what that signal is i.e., the user doesn’t care about that signal, It is saying that, the particular signal is irrelevant to us. X in electronics implies a DON’T CARE.

To consolidate the above truth table:
{Y1, Y0} = Decimal equivalent [Input active with highest minterm] and V = 1 atleast 1 input is active else 0.

Circuit of the priority encoder will be uploaded after a few days. In the meantime keep trying to implement it.

HOW DO I REPRESENT AN ENCODER??
Let us consider an 8:3 encoder. The representation is as shown below:

 
As a bit of information, an 8:3 encoder is also called as octal to binary encoder as we can represent all octal numbers in the input and we get the corresponding equivalent binary output.

WHERE THE HELL CAN I USE AN ENCODER??
A typical encoder application in a CPU is demonstrated by the diagram below:
 WHAT ARE POSITIONAL ENCODERS??
They are the encoders in which the input is fed via a dial and each position corresponds to a particular input. Here each position corresponds to a value of input signal, much like a dial of a fan regulator.The application of a POSITIONAL ENCODER is as shown below:






HOPE YOU ENJOYED READING THIS ARTICLE AS MUCH AS I DID WRITING IT....ENJOY:):):):)

ARTICLE BY:
NITIN