

The 74HC139 is a high-speed CMOS dual 2-to-4 line decoder/demultiplexer. It is designed to convert binary inputs into a single active low output, making it an essential component for digital logic circuits. The IC contains two independent decoders, each with two inputs and four outputs, enabling efficient data routing and signal selection. Its compact design and versatility make it ideal for applications in address decoding, memory selection, and data distribution.








The 74HC139 comes in a 16-pin package. Below is the pinout and description:
| Pin No. | Pin Name | Description |
|---|---|---|
| 1 | 1G | Enable input for decoder 1 (active low) |
| 2 | 1A | Input A for decoder 1 |
| 3 | 1B | Input B for decoder 1 |
| 4 | 1Y0 | Output Y0 for decoder 1 (active low) |
| 5 | 1Y1 | Output Y1 for decoder 1 (active low) |
| 6 | 1Y2 | Output Y2 for decoder 1 (active low) |
| 7 | 1Y3 | Output Y3 for decoder 1 (active low) |
| 8 | GND | Ground |
| 9 | 2Y3 | Output Y3 for decoder 2 (active low) |
| 10 | 2Y2 | Output Y2 for decoder 2 (active low) |
| 11 | 2Y1 | Output Y1 for decoder 2 (active low) |
| 12 | 2Y0 | Output Y0 for decoder 2 (active low) |
| 13 | 2B | Input B for decoder 2 |
| 14 | 2A | Input A for decoder 2 |
| 15 | 2G | Enable input for decoder 2 (active low) |
| 16 | Vcc | Positive supply voltage |
The following example demonstrates how to use the 74HC139 with an Arduino UNO to control LEDs connected to the outputs of decoder 1.
// Define pins for the 74HC139 decoder
const int enablePin = 7; // Enable pin for decoder 1
const int inputA = 8; // Input A for decoder 1
const int inputB = 9; // Input B for decoder 1
void setup() {
// Set pin modes
pinMode(enablePin, OUTPUT);
pinMode(inputA, OUTPUT);
pinMode(inputB, OUTPUT);
// Enable the decoder by setting enablePin LOW
digitalWrite(enablePin, LOW);
}
void loop() {
// Cycle through all output combinations
for (int i = 0; i < 4; i++) {
digitalWrite(inputA, i & 0x01); // Set A to LSB of i
digitalWrite(inputB, (i >> 1) & 0x01); // Set B to MSB of i
delay(1000); // Wait 1 second before changing output
}
}
All Outputs Remain HIGH:
Incorrect Output Selection:
Outputs Not Driving Loads:
Q: Can I use the 74HC139 with a 3.3V microcontroller?
A: Yes, the 74HC139 operates with supply voltages as low as 2V, making it compatible with 3.3V systems.
Q: What happens if both decoders are enabled simultaneously?
A: Each decoder operates independently, so enabling both will not cause interference. However, ensure that the outputs are not shorted together.
Q: Can the outputs drive LEDs directly?
A: Yes, but ensure the current through each LED does not exceed 8mA. Use appropriate current-limiting resistors.