74LS138 3-to-8 line decoder, active-low
The 74LS138 is a 3-to-8 line decoder. The three select inputs C B A choose one of eight active-low outputs, Y0′ to Y7′, and that output goes low while the other seven stay high. It has three enable inputs — G1 must be high and both G2A′ and G2B′ low — otherwise every output stays high.
74LS138 pinout
Top view of the 16-pin DIP package. Pin 1 is at the bottom left, beside the notch, and the numbers run anticlockwise. Power is on pin 16 (VCC, +5 V) and pin 8 (GND).
| Pin | Name | Type | What it is |
|---|---|---|---|
| 1 | A | Input | Input |
| 2 | B | Input | Input |
| 3 | C | Input | Input |
| 4 | G2A′ | Input | Input, active-low |
| 5 | G2B′ | Input | Input, active-low |
| 6 | G1 | Input | Input |
| 7 | Y7′ | Output | Totem-pole output, active-low |
| 8 | GND | Ground | 0 V |
| 9 | Y6′ | Output | Totem-pole output, active-low |
| 10 | Y5′ | Output | Totem-pole output, active-low |
| 11 | Y4′ | Output | Totem-pole output, active-low |
| 12 | Y3′ | Output | Totem-pole output, active-low |
| 13 | Y2′ | Output | Totem-pole output, active-low |
| 14 | Y1′ | Output | Totem-pole output, active-low |
| 15 | Y0′ | Output | Totem-pole output, active-low |
| 16 | VCC | Power | +5 V supply |
74LS138 truth table
| C | B | A | Y0′ | Y1′ | Y2′ | Y3′ | Y4′ | Y5′ | Y6′ | Y7′ |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 |
What the 74LS138 is used for
- Address decoding: one chip-select line out of eight
- Implementing any three-variable function, by combining the minterm outputs it needs with a NAND gate
- A 1-to-8 demultiplexer, by feeding data into an enable input
- Building a 4-to-16 decoder from two 138s
Every output is one minterm of C B A, inverted — so any function of three variables is one 138 and a NAND of the minterms it needs.
Electrical summary
| Package | 16-pin DIP |
| Supply voltage | 5 V (4.75 V to 5.25 V) |
| Supply current, typical | 6.3 mA |
| Output type | Totem-pole — drives both high and low |
| Output current, low | sinks up to 8 mA |
| Output current, high | sources up to 0.4 mA |
| Input current, low | 0.4 mA out of each input held low |
| Fan-out | one output can drive about 20 LS inputs |
Typical figures for quick reference when planning a board. Check the manufacturer's datasheet for limits and timing before committing a design. The 74HC138 and 74HCT138 use the same pin numbers, with different electrical values.
Try the 74LS138 on a breadboard
The Breadboard Simulator has the 74LS138 in its parts library: seat it on a virtual breadboard, wire it, power the board and probe the pins before you build the real thing.