In: Computer Science
Show the gate level implementation of a decoder as well as an encoder, then explain the functionality of each one, and show what happens if you connect them together.
Answer : Given data
1. Decoder is a combinational circuit that has ‘n’ input lines and maximum of 2n output lines.
2. One of these outputs will be active High based on the combination of inputs present, when the decoder is enabled.
3. That means decoder detects a particular code. The outputs of the decoder are nothing but the min terms of ‘n’ input variables lineslines, when it is enabled.
4. Lets consider 2 to 4 decoder, which has 2 inputs and 4 outputs.
fig. 2:4 Decoder
5. As shown in above fig. A1 & A2 are two inputs and Y1, Y2, Y3 & Y4 are output lines.
Enable | Inputs | Outputs | ||||
E | A0 | A1 | Y0 | Y1 | Y2 | Y3 |
0 | x | x | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 0 | 0 | 1 | 0 |
1 | 1 | 0 | 0 | 1 | 0 | 0 |
1 | 1 | 1 | 1 | 0 | 0 | 0 |
6. From given Truth table of decoder, we can write the Boolean expression for each output as follows
Y3 = E.A1.A0Y3 = E.A1.A0
Y2 = E.A1.A0′Y2 = E.A1.A0′
Y1 = E.A1′.A0Y1 = E.A1′.A0
Y0=E.A1′.A0′
7. In each of above equation there is product of inputs or there complement, so we will use AND gate for product and NOT gate to obtain the complement.
fig. Implementation using logic gate
9. Figure shows the decoder circuit using AND and NOT gate. Output will be proper only if enable is high, else when enable is zero output will be zero for each input combination.
1. An Encoder is a combinational circuit that has maximum of 2n input lines and ‘n’ output lines.
2. It performs the reverse operation of Decoder.
3. It will produce a binary code equivalent to the input, which is active High. Therefore, the encoder encodes 2n input lines with ‘n’ bits. It is optional to represent the enable signal in encoders.
4. Lets consider 4 to 2 encoder, which has 4 inputs and 2 outputs.
fig. 4:2 Encoder
5. As shown in above fig. A1 & A2 are two outputs and Y1, Y2, Y3 & Y4 are input lines.
Inputs | Outputs | ||||
Y0 | Y1 | Y2 | Y3 | A0 | A1 |
0 | 0 | 0 | 1 | 0 | 0 |
0 | 0 | 1 | 0 | 0 | 1 |
0 | 1 | 0 | 0 | 1 | 0 |
1 | 0 | 0 | 0 | 1 | 1 |
6. From given Truth table of encoder, we can write the Boolean expression for each output as follows
A1 = Y3+Y2
A0 = Y3+Y1
7. We can implement the above two Boolean functions by using two input OR gates.
fig. Implementation using logic gate
8. Fig. shows the implementation of encoder using two OR gates.
9.
When we connect encoder output to the inputs of decoder , at decoder output we will get original output. This happens because encoding and decoding of same input is done. Similarly, when we connect encoder output to the input of decoder , at decoder output we get original input.
_______________THE END________________