Overview

The 74HC138 (SN74HC138) is a 3-to-8 line decoder/demultiplexer IC manufactured using high-speed silicon-gate CMOS technology. Designed for memory address decoding and routing applications in high-speed microcomputer systems, it converts a 3-bit binary address input (A0, A1, A2) into one of 8 mutually exclusive active-LOW outputs (Y0\overline{Y0} to Y7\overline{Y7}).

The device incorporates three enable inputs: one active-HIGH (G1) and two active-LOW (G2A\overline{G2A} and G2B\overline{G2B}). All 8 outputs remain HIGH (disabled) unless G1 is HIGH and both G2A\overline{G2A} and G2B\overline{G2B} are LOW. This versatile enable arrangement allows easy cascading to build 1-of-16, 1-of-32, or larger decoders without external logic gates.

Quick reference

Supply Voltage (VCC)2.0 V to 6.0 V DC
Logic FamilyHigh-Speed CMOS (74HC) / TTL Compatible (74HCT)
Address Inputs3 (A0 LSB, A1, A2 MSB)
Decoded Outputs8 Active-Low Outputs (Y0\overline{Y0} through Y7\overline{Y7})
Enable Lines3 (G1 Active-High; G2A,G2B\overline{G2A}, \overline{G2B} Active-Low)
Propagation Delay15 ns15\text{ ns} typical at VCC=4.5VVCC = 4.5\text{V}
Package16-pin DIP / SOIC-16 / TSSOP-16

Pinout (DIP-16 Package)

text
             ┌───┴───┐
          A0 1│ 1   16│ VCC
          A1 2│       │15 /Y0
          A2 3│       │14 /Y1
        /G2A 4│74HC138│13 /Y2
        /G2B 5│       │12 /Y3
          G1 6│       │11 /Y4
         /Y7 7│       │10 /Y5
         GND 8│       │9  /Y6
             └───────┘
PinNameTypeDescription
1A0InputAddress Input Bit 0 (LSB)
2A1InputAddress Input Bit 1
3A2InputAddress Input Bit 2 (MSB)
4/G2AInputActive-Low Enable Input A
5/G2BInputActive-Low Enable Input B
6G1InputActive-High Enable Input
7/Y7OutputActive-Low Decoded Output 7 (Selected when A2=1, A1=1, A0=1)
8GNDPowerGround reference (0 V)
9–15/Y6/Y0OutputActive-Low Decoded Outputs 6 through 0
16VCCPowerPositive supply power pin (+2.0V to +6.0V DC)

Function & Truth Table

Enable InputsAddress InputsActive Output (LOW)
G1/G2A/G2BA2A1A0
Low (LL)XXXXXNone (All outputs HIGH)
XHigh (HH)XXXXNone (All outputs HIGH)
XXHigh (HH)XXXNone (All outputs HIGH)
High (HH)Low (LL)Low (LL)Low (LL)Low (LL)Low (LL)Y0=0\overline{Y0} = 0
High (HH)Low (LL)Low (LL)Low (LL)Low (LL)High (HH)Y1=0\overline{Y1} = 0
High (HH)Low (LL)Low (LL)Low (LL)High (HH)Low (LL)Y2=0\overline{Y2} = 0
High (HH)Low (LL)Low (LL)Low (LL)High (HH)High (HH)Y3=0\overline{Y3} = 0
High (HH)Low (LL)Low (LL)High (HH)Low (LL)Low (LL)Y4=0\overline{Y4} = 0
High (HH)Low (LL)Low (LL)High (HH)Low (LL)High (HH)Y5=0\overline{Y5} = 0
High (HH)Low (LL)Low (LL)High (HH)High (HH)Low (LL)Y6=0\overline{Y6} = 0
High (HH)Low (LL)Low (LL)High (HH)High (HH)High (HH)Y7=0\overline{Y7} = 0

Specifications

ParameterSymbolMinTypMaxUnitConditions
Supply VoltageVCCV_{CC}2.05.06.0VDC
High-Level Input VoltageVIHV_{IH}3.15VVCC=4.5VV_{CC} = 4.5\text{V}
Low-Level Input VoltageVILV_{IL}1.35VVCC=4.5VV_{CC} = 4.5\text{V}
Propagation Delay (AnYnAn \rightarrow \overline{Yn})tPDt_{PD}1525nsVCC=4.5V,CL=50pFV_{CC} = 4.5\text{V}, C_L = 50\text{pF}
Output Sink/Source CurrentIOUTI_{OUT}±25\pm 25mAVCC=6.0VV_{CC} = 6.0\text{V}
Quiescent Supply CurrentICCI_{CC}4.0µAVIN=VCC or GNDV_{IN} = V_{CC}\text{ or GND}

Typical Applications

8-Device SPI Chip-Select Address Decoder

Using 3 GPIO pins from a microcontroller to generate 8 active-LOW Chip-Select (CS\overline{CS}) lines for peripheral devices (SD cards, sensors, displays).

text
   MCU GPIO Pins                                    SPI Peripherals
  [Pin D2] ──────────► [Pin 1: A0]             [ /Y0 ] ───► /CS SD Card
  [Pin D3] ──────────► [Pin 2: A1]  74HC138    [ /Y1 ] ───► /CS Display
  [Pin D4] ──────────► [Pin 3: A2]             [ /Y2 ] ───► /CS Flash Memory
                           │                   [ /Y3..7 ] ─► /CS Sensors
                 +5V ──[Pin 6: G1]
                 GND ──[Pin 4: /G2A]
                 GND ──[Pin 5: /G2B]

Common mistakes

  • Forgetting that outputs are active-LOW: The selected output pin pulls LOW (0V0\text{V}) while all non-selected outputs remain HIGH (5V5\text{V}). If driving active-HIGH chip selects, an inverter (such as 74HC04) or a 74HC238 (active-HIGH equivalent) is required.
  • Floating enable lines (G2A,G2B,G1\overline{G2A}, \overline{G2B}, G1): If G1G1 is not tied HIGH or G2A/G2B\overline{G2A}/\overline{G2B} are not tied LOW, all outputs will remain permanently disabled (HIGH).
  • Cascading incorrectly: When cascading two 74HC138s to make a 1-of-16 decoder, use the 4th address bit (A3A3) directly to drive G1G1 on the second IC and G2A\overline{G2A} on the first IC.

Notes

  • 74HC138 vs 74HC238: 74HC138 has active-LOW outputs (Y0\overline{Y0}Y7\overline{Y7}); 74HC238 is the exact same pinout but with active-HIGH outputs (Y0Y0Y7Y7).
  • 74HC138 vs 74HC154: 74HC138 is a 3-to-8 decoder (16-pin DIP); 74HC154 is a 4-to-16 decoder (24-pin DIP).

Assets & downloads