Three wires become eight - the 138 decodes addresses and drives digit selects everywhere. This page covers the truth logic, the three enable pins and the active-low gotchas.
The 74LS138 is a 3-to-8 decoder: address inputs A, B, C select exactly one output that goes low while all others stay high - outputs are active low. Three enables gate the decode: G1 active high, G2A and G2B active low; all must be satisfied or every output parks high. The enables are the cascade key: two parts wired G1/G2 against each other form a 4-to-16 decoder. Allow about 22ns decode delay (LS) in your timing budget.
Three classic uses: address decoding on microcontroller buses (top three address bits to C-B-A, eight outputs strobing eight peripheral chips), digit-select driving for multiplexed LED displays (decode through transistors to the common terminals - three IO lines scan eight digits), and state decoding in small state machines. Cascade for 16 lines by feeding A3 into the first G1 and the second G2A. Traps: LEDs connect cathode to the output (anode to supply) or the logic inverts; LS outputs source only 0.4mA while sinking 8mA, so drive transistors by pulling low; and never leave enables floating - TTL floats high and seems to work until noise finds it.
| Enable state | G1 | G2A | G2B | Outputs |
|---|---|---|---|---|
| Decoding | 1 | 0 | 0 | One low per address |
| Disabled case 1 | 0 | 0 | 0 | All high |
| Disabled case 2 | 1 | 1 | 0 | All high |
| Disabled case 3 | 1 | 0 | 1 | All high |
| Cascade mode | A3 to G1 | Neighbour G2A | N/A | 4-to-16 expand |
| LED connection | N/A | N/A | N/A | Cathode to output, low = on |
Wiring rules: enables tied to real logic, LEDs with cathodes to outputs, drive by sinking. A silent chip gets its G pins checked before it gets replaced.
The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Digital IC specification per GB/T 17574 (IEC 60748 series); logic symbols per GB/T 4728. Always check the device datasheet and the product design file for ratings and derating.
Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.