Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use 74LS138: Examples, Pinouts, and Specs

Image of 74LS138
Cirkit Designer LogoDesign with 74LS138 in Cirkit Designer

Introduction

The 74LS138 is a 3-to-8 line decoder/demultiplexer designed for use in digital circuits. It takes a 3-bit binary input and activates one of the eight outputs (Y0 to Y7) based on the input value. The remaining outputs remain inactive. This component is widely used in applications such as address decoding, memory selection, and data routing in microprocessor-based systems.

Explore Projects Built with 74LS138

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
74HC74 and 7408 Based LED Control Circuit with Push Switches
Image of Lab1: A project utilizing 74LS138 in a practical application
This circuit is a simple flip-flop based LED control system. It uses a 74HC74 D flip-flop to toggle the state of an LED, with push switches to control the clock and data inputs. The circuit also includes a 7408 AND gate and a BC547 transistor to drive the LED.
Cirkit Designer LogoOpen Project in Cirkit Designer
Logic Gate Circuit with 7408 AND and 7432 OR ICs
Image of gate: A project utilizing 74LS138 in a practical application
This circuit includes a 7408 AND gate IC and a 7432 OR gate IC, both powered by a common VCC and GND connection. The circuit is designed to perform basic logical operations, combining AND and OR gates for digital signal processing.
Cirkit Designer LogoOpen Project in Cirkit Designer
LED Control Circuit with 7408 AND Gate and 74HC75 Latch
Image of Lab1_Partb: A project utilizing 74LS138 in a practical application
This circuit is a simple logic-based LED control system. It uses a 7408 AND gate and a 74HC75 latch to control the state of a red LED based on the input from three push switches. The BC547 transistor acts as a switch to drive the LED, with resistors used for current limiting and biasing.
Cirkit Designer LogoOpen Project in Cirkit Designer
STM32-Controlled LED Display with 74HC595 Shift Register and 12-Bit DAC
Image of Harry Stim Breadboard: A project utilizing 74LS138 in a practical application
This circuit uses a 74HC595 shift register to control multiple LEDs via a common ground configuration, with a microcontroller providing serial data input. It includes decoupling capacitors for stability and a 12-Bit DAC, potentially for analog signal generation or reference voltage application.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with 74LS138

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Lab1: A project utilizing 74LS138 in a practical application
74HC74 and 7408 Based LED Control Circuit with Push Switches
This circuit is a simple flip-flop based LED control system. It uses a 74HC74 D flip-flop to toggle the state of an LED, with push switches to control the clock and data inputs. The circuit also includes a 7408 AND gate and a BC547 transistor to drive the LED.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of gate: A project utilizing 74LS138 in a practical application
Logic Gate Circuit with 7408 AND and 7432 OR ICs
This circuit includes a 7408 AND gate IC and a 7432 OR gate IC, both powered by a common VCC and GND connection. The circuit is designed to perform basic logical operations, combining AND and OR gates for digital signal processing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Lab1_Partb: A project utilizing 74LS138 in a practical application
LED Control Circuit with 7408 AND Gate and 74HC75 Latch
This circuit is a simple logic-based LED control system. It uses a 7408 AND gate and a 74HC75 latch to control the state of a red LED based on the input from three push switches. The BC547 transistor acts as a switch to drive the LED, with resistors used for current limiting and biasing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Harry Stim Breadboard: A project utilizing 74LS138 in a practical application
STM32-Controlled LED Display with 74HC595 Shift Register and 12-Bit DAC
This circuit uses a 74HC595 shift register to control multiple LEDs via a common ground configuration, with a microcontroller providing serial data input. It includes decoupling capacitors for stability and a 12-Bit DAC, potentially for analog signal generation or reference voltage application.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications:

  • Address decoding in memory systems
  • Data routing in digital circuits
  • Multiplexing and demultiplexing
  • Enabling specific devices in microcontroller systems

Technical Specifications

The 74LS138 is a TTL (Transistor-Transistor Logic) device with the following key specifications:

Parameter Value
Supply Voltage (Vcc) 4.75V to 5.25V
Input Voltage (VIH, VIL) VIH: Min 2V, VIL: Max 0.8V
Output Voltage (VOH, VOL) VOH: Min 2.7V, VOL: Max 0.4V
Output Current (IOH, IOL) IOH: -0.4mA, IOL: 8mA
Propagation Delay 15ns (typical)
Power Dissipation 32mW (typical)
Operating Temperature 0°C to 70°C

Pin Configuration and Descriptions

The 74LS138 comes in a 16-pin DIP (Dual Inline Package). Below is the pinout and description:

Pin Number Pin Name Description
1 G1 Enable Input (Active HIGH)
2 G2A Enable Input (Active LOW)
3 G2B Enable Input (Active LOW)
4 A Input A (LSB of the 3-bit binary input)
5 B Input B (Middle bit of the 3-bit binary input)
6 C Input C (MSB of the 3-bit binary input)
7 Y7 Output 7 (Active LOW)
8 GND Ground
9 Y6 Output 6 (Active LOW)
10 Y5 Output 5 (Active LOW)
11 Y4 Output 4 (Active LOW)
12 Y3 Output 3 (Active LOW)
13 Y2 Output 2 (Active LOW)
14 Y1 Output 1 (Active LOW)
15 Y0 Output 0 (Active LOW)
16 Vcc Power Supply (5V)

Usage Instructions

How to Use the 74LS138 in a Circuit

  1. Power Supply: Connect the Vcc pin (Pin 16) to a 5V power supply and the GND pin (Pin 8) to ground.
  2. Enable Inputs: Ensure the enable inputs (G1, G2A, G2B) are correctly configured:
    • G1 must be HIGH (logic 1).
    • G2A and G2B must be LOW (logic 0).
  3. Binary Inputs: Provide a 3-bit binary input to pins A, B, and C. The combination of these inputs determines which output (Y0 to Y7) is activated.
  4. Outputs: The selected output will go LOW (active), while all other outputs remain HIGH.

Important Considerations:

  • Active LOW Outputs: The outputs (Y0 to Y7) are active LOW, meaning the selected output will be pulled to ground when active.
  • Unused Inputs: Tie unused inputs to a defined logic level (HIGH or LOW) to avoid floating inputs.
  • Decoupling Capacitor: Place a 0.1µF decoupling capacitor between Vcc and GND to reduce noise.

Example: Connecting the 74LS138 to an Arduino UNO

The 74LS138 can be used with an Arduino UNO to decode binary inputs. Below is an example code snippet:

// Define input pins for the 74LS138
const int pinA = 2; // Connect to pin 4 (A) of 74LS138
const int pinB = 3; // Connect to pin 5 (B) of 74LS138
const int pinC = 4; // Connect to pin 6 (C) of 74LS138

// Define enable pins for the 74LS138
const int enableG1 = 5;  // Connect to pin 1 (G1)
const int enableG2A = 6; // Connect to pin 2 (G2A)
const int enableG2B = 7; // Connect to pin 3 (G2B)

void setup() {
  // Set input pins as outputs
  pinMode(pinA, OUTPUT);
  pinMode(pinB, OUTPUT);
  pinMode(pinC, OUTPUT);

  // Set enable pins as outputs
  pinMode(enableG1, OUTPUT);
  pinMode(enableG2A, OUTPUT);
  pinMode(enableG2B, OUTPUT);

  // Enable the 74LS138
  digitalWrite(enableG1, HIGH);  // G1 is active HIGH
  digitalWrite(enableG2A, LOW); // G2A is active LOW
  digitalWrite(enableG2B, LOW); // G2B is active LOW
}

void loop() {
  // Example: Activate output Y3 (binary input 011)
  digitalWrite(pinA, HIGH); // A = 1
  digitalWrite(pinB, HIGH); // B = 1
  digitalWrite(pinC, LOW);  // C = 0

  delay(1000); // Wait for 1 second

  // Example: Activate output Y5 (binary input 101)
  digitalWrite(pinA, HIGH); // A = 1
  digitalWrite(pinB, LOW);  // B = 0
  digitalWrite(pinC, HIGH); // C = 1

  delay(1000); // Wait for 1 second
}

Troubleshooting and FAQs

Common Issues:

  1. No Output Activation:

    • Ensure the enable inputs (G1, G2A, G2B) are correctly configured.
    • Verify that the power supply is within the specified range (4.75V to 5.25V).
    • Check for loose or incorrect connections.
  2. Multiple Outputs Active:

    • Verify that the binary inputs (A, B, C) are not floating.
    • Ensure there is no short circuit between output pins.
  3. Incorrect Output Activation:

    • Double-check the binary input values and their corresponding outputs.
    • Ensure the Arduino or other microcontroller is correctly driving the inputs.

FAQs:

Q1: Can the 74LS138 be used with a 3.3V microcontroller?
A1: The 74LS138 is designed for 5V operation. However, it can accept 3.3V logic levels as HIGH inputs in most cases. Verify compatibility with your specific microcontroller.

Q2: What happens if multiple enable inputs are active simultaneously?
A2: The 74LS138 requires G1 to be HIGH and both G2A and G2B to be LOW for proper operation. If these conditions are not met, all outputs will remain HIGH (inactive).

Q3: Can I cascade multiple 74LS138 ICs?
A3: Yes, you can cascade multiple 74LS138 ICs to decode more than 3 bits. Use the enable inputs to control which IC is active at a given time.