Decoder - eclubiitk/EClub-Handbook GitHub Wiki
A decoder is a circuit that changes a code into a set of signals. It is called a decoder because it does the reverse of encoding, but we will begin our study of encoders and decoders with decoders because they are simpler to design.
Decoder is a combinational circuit that has ānā input lines and maximum of 2^n output lines. One of these outputs will be active High based on the combination of inputs present, when the decoder is enabled. That means decoder detects a particular code. You'll get a sense of what that means as you read on.
Content
2 To 4 Decoder
Let 2 to 4 Decoder has two inputs A1 & A0 and four outputs Y3, Y2, Y1 & Y0. The block diagram of 2 to 4 decoder is shown in the following figure.
One of these four outputs will be ā1ā for each combination of inputs when enable, E is ā1ā. The Truth table of 2 to 4 decoder is shown below.
The Boolean Equation for each output is
So each input for A1 and A0 gives out a different output. This output is our code.
3 To 8 Decoder
A 3 to 8 Decoder can be made using two 2 To 4 Decoder. Its fairly simple. The block diagram is given below
The parallel inputs A1 & A0 are applied to each 2 to 4 decoder. The complement of input A2 is connected to Enable, E of lower 2 to 4 decoder in order to get the outputs, Y3 to Y0. Using this connection we can get all the outputs we would get from a traditional 3 To 8 decoder made using logic gates only.
74138 IC
74138 IC is a 3 To 8 Decoder and it uses two 2 To 4 Decoder in the manner described above. The two enable pins for the two 2 To 4 decoder are reffered to as G2A and G2B. These are active LOW input which means giving them LOW enable input activates them. The G1 pin (or enable pin) here is the Enable pin for the overall 3 To 8 pin only.
The Pin Diagram is given below
The truth table is given below
Here E1, E2, E3 are G2A, G2b, and G1 respectively. Remember E1 and E2 are active LOW inputs.
The datasheet is available here