The 74138 is a popular 3-to-8 line decoder IC chip manufactured by Texas Instruments. As the name suggests, it takes a 3-bit binary input and decodes it into 8 output lines. Only one output line is active (low) at a time, depending on the input code. The 74138 finds wide application in address decoding and driving LEDs/LCDs. In this comprehensive guide, we will learn all about the internal architecture, pin configuration, truth table, driver circuits and applications of the 74138 decoder IC.
IC 74138 Pin Configuration
The 74138 comes in a 16-pin dual in-line package (DIP) with the following pin configuration:
|1||A0||Least Significant Input|
|3||A2||Most Significant Input|
The inputs A0, A1 and A2 are the 3-bit binary address inputs that are decoded to activate one of the 8 output lines Y0 to Y7.
G1, G2A and G2B are 3 output enable pins that must be driven low for the outputs to get active. Their combination determines which group of 4 outputs gets enabled based on the input code.
The internal circuit of the 74138 consists of 3-to-8 line decoder logic made up of basic gates like NAND and inverters. Here is a simplified diagram showing the internal architecture:
As you can see, the input lines A0 to A2 first pass through buffers and then into a 3-to-8 decoder logic circuitry built using NAND gates.
The output lines have buffers/drivers which are enabled in groups using the Output Enable pins G1, G2A and G2B.
Here is the logic diagram of the 74138:
The truth table summarizes the functionality of the 74138 3-to-8 line decoder:
- X = Don’t Care
- L = Low Level (0V)
- H = High Level (5V)
As you can see from the truth table:
- For input codes 000 to 011, output lines Y0 to Y3 get enabled by driving G1 pin low.
- For input codes 100 to 101, output lines Y4 to Y5 get enabled by driving G1 pin low.
- For input codes 110 to 111, output lines Y6 to Y7 get enabled by driving G2A pin low and G1 pin high.
Thus by changing the logic levels on the Output Enable pins G1, G2A and G2B – the 74138 can be used to decode larger input codes as well.
The 74138 itself cannot supply much current to drive external devices. Its outputs are only meant to drive TTL/CMOS logic inputs.
To use it to drive bigger loads like LEDs, relays, lamps or motors – external driver transistors/MOSFETs are needed.
Here are some examples of driving different types of loads from the 74138:
A simple transistor like the BC548 NPN can drive upto 10mA load per output line. Make sure to use series current limiting resistors for the LEDs.
For driving high current relay coils, you need beefier drivers like the ULN2003 Darlington array IC which contains 7 drivers with 500mA drive capacity each.
The diodes across the relay coils are for protection against back EMF generated when the coils are turned OFF.
Larger motors will need proportionally higher drive currents. MOSFETs like the IRF540 are suitable to drive motors rated upto 5A. Make sure to use additional protection diodes across the motors.
The 74138 3-to-8 Decoder finds lots of applications in digital logic circuits such as:
- Memory Address Decoding – To generate chip select signals for RAM/ROM chips
- 7-Segment Display Decoding – Driving common cathode LED/LCD displays
- Driving Multiple Loads – Decoding I/O ports to drive motors, relays, lamps etc.
- Keyboard Encoding – Converting input from 8-keys into 3-bit binary code.
Some typical application circuits are shown below:
By cascading two 74138 ICs, larger line decoders can be implemented like this 4-to-16 line decoder:
The first 74138 decodes A0 and A1 into 1-of-4 outputs which feed the input pins of the second 74138. The second IC further decodes those into 1 of 16 output lines.
7-Segment Display Decoder
A common cathode 7-segment LED display can be directly driven by 74138. The active low outputs connect to the cathode pins of the display.
Memory Address Decoder
The 74138 is commonly used as a memory address decoder to generate chip select signals for enabling RAM/ROM chips.
In this circuit, the input address bus A0 to A14 is decoded to generate chip select signals for upto 16 memory ICs with 64K address space (16X4K) each.
Frequently Asked Questions
1. What is a line decoder?
A line decoder takes an N-bit binary input and decodes it into 2^N unique output lines. Only one output line is active at a time based on the input code.
2. How many inputs and outputs does 74138 have?
The 74138 has 3 input pins (A0-A2) and 8 output pins (Y0-Y7).
3. What are the enable pins of 74138 used for?
The enable pins G1, G2A and G2B are used to enable different groups of 4 outputs based on the input code. This allows expansion to drive more outputs using cascaded 74138 ICs.
4. Can 74138 source/sink high current?
No, the maximum output current per pin is only a few mA. External driver transistors are needed to switch higher loads.
5. What are some common applications of 74138?
Some applications are:
- Memory address decoding to generate chip select signals.
- Driving seven segment LED displays.
- I/O port decoding to drive motors, relays, lamps etc.