MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › 74LS138 decoder: functions, enables and the active-low traps
HomeModels
Table of contents

On this page

Electrical & Electronic Basics (698 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

74LS138 decoder: functions, enables and the active-low traps

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.

1. How it works

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.

2. Practice and pitfalls

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.

3. 74LS138 enables quick table

Enable stateG1G2AG2BOutputs
Decoding100One low per address
Disabled case 1000All high
Disabled case 2110All high
Disabled case 3101All high
Cascade modeA3 to G1Neighbour G2AN/A4-to-16 expand
LED connectionN/AN/AN/ACathode to output, low = on

4. Notes

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.

5. References

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.

6. Cautions

⚠️ Three common pitfalls:
① Floating enables on TTL luck:noise flips outputs and faults come and go
② LEDs wired backwards:the whole logic inverts and software patches pile up
③ Sourcing current from an LS output:0.4mA cannot feed a base, the high level sags

Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL