74LS138 Decoder Working Principle, Application Scenarios and 7AHC138 vs 74LS138

11 April 2024


Ⅰ. Introduction to 74LS138

Ⅱ. What is the meaning of the 74LS138 naming?

Ⅲ. Working principle of 74LS138

Ⅳ. Example of application circuit diagram of 74LS138

Ⅴ. Application scenarios of 74LS138 decoder

Ⅵ. Function truth table of 74LS138

Ⅶ. How to connect the output of 74LS138 to the logic circuit?

Ⅷ. What is the difference between 74HC138 and 74LS138?



A decoder is an electronic device or circuit that is used to convert input digital signals, codes, or patterns into specific output signals, decoding, or information. Decoders are commonly used in a variety of applications, including communications equipment, computers, and digital electronic systems, to decode and convert digital signals. 74LS138 is an integrated 3-8 line decoder chip that plays an important role in digital circuit and logic design. In this article, we will take an in-depth look at the working principle and applications of the 74LS138.



Ⅰ. Introduction to 74LS138


a3d1bdf34fa483243a9e755a64630957.png


74LS138 is a member of the "74xx" family of TTL logic gates. It is a commonly used decoder chip, also known as a 3-8 decoder. There are two line structure types of this chip, namely 54LS138 and 74LS138. Among them, 54LS138 is mainly for military use, while 74LS138 is suitable for civilian use. This chip excels in high-performance memory decoding or data routing applications, especially where very short propagation delay times are required. These decoders effectively minimize the impact of system decoding when building high-performance storage systems.


The 74LS138's three enable pins (two active low and one active high) significantly reduce the need for an external gate or inverter when expanding. By using these enable pins, a 24-wire decoder can function without an external inverter, while a 32-wire decoder requires only an inverter. In addition, the 74LS138 provides the flexibility to use the enable pin as a data input pin in demultiplexing applications. It is worth mentioning that the input end of this chip uses high-performance Schottky diode clamping technology, which not only effectively suppresses line ringing, but also helps simplify system design.


Alternative models:

CD74ACT138E

SN74ALS138AN

SN74HCT138N



Ⅱ. What is the meaning of the 74LS138 naming?


• 74: It indicates the operating temperature range of the product. Texas Instruments launched the commercial-grade DIP (7400N) in 1966. This product occupied a dominant position in the market due to its excellent performance. Over time, "74" became the industry standard for this product line. In addition to the 74 series, Texas Instruments also launched the 54 military grade and 64 industrial grade series products. In terms of temperature range, the 74 series products are allowed to be used in the range of 0°C to 70°C, while the 54 series products are allowed to be used in the range of -55°C to 135°C. But what needs to be made clear is that there is no inherent connection between "74" and "0°C to 70°C". Using "74" to express this temperature range is completely artificial.


• LS: It represents the technical indicators of the product, including the following:

d873238f63e41d273d82c2a4e7827e7b.png


• 138: It represents the function number of the product. The number itself has no special meaning; each number corresponds to a specific function. This correspondence between numbers and functions is artificially set and is a one-to-one correspondence. Therefore, we cannot directly read the functional information related to this number alone.



Ⅲ. Working principle of 74LS138


The 74LS138 decoder adopts a 3-to-8 structure, with 3 input terminals (A0, A1, A2) and 8 output terminals (Y0-Y7). Depending on the combination of inputs, the decoder sets certain outputs low (0V) and keeps other outputs high (5V). Here's how it works:

• When one of the selector terminals (E1) is in a high state and the other two selector terminals (/E2) and (/E3) are in a low state, the binary code of the address terminals (A0, A1, A2) will be decoded in a low state at the outputs corresponding to Y0 to Y7. This means that the outputs will be the non-state of Y0 through Y7. For example, when the binary code of A2A1A0 is 110, the Y6 output will output a low-level signal.

• By utilizing the three selector terminals, E1, E2, and E3, the 74LS138 decoder can be expanded in cascade to become a 24-wire decoder. Further, if an external inverter is connected, it can be cascaded to a 32-wire decoder.

• If one of the selector terminals is used as a data input, the 74LS138 can also be used as a data distributor.

• The 74LS138 decoder can be used in the decoder circuit of the 8086 to realize the memory expansion function.



Ⅳ. Example of application circuit diagram of 74LS138


1. 74LS138 full subtractor circuit diagram


67b1d65a0286d31cdb19eebe15783864.png


2. 74LS138 full adder circuit diagram


The full adder has three inputs: a, b, and ci, and two outputs: s and co. In contrast, the 3-8 decoder has three data inputs: A, B, and C, three enables, and eight outputs OUT (0-7). In this case, we can think of the three data inputs of the 3-8 decoder as the three inputs of a full adder, i.e., the inputs A, B, and C of the decoder correspond to the inputs a, b, and ci, respectively, of the full adder. To ensure that the decoder operates correctly, we need to set all three of its enablers to active levels. However, the key lies in how to handle the relationship between the eight outputs of the 3-8 decoder and the two outputs of the full adder.


261f87fde5a18ee9b5057571cdad3d89.png


We can use the outputs OUT (1, 2, 4, 7) of the 3-8 decoder as inputs to a 4-input or gate and use the output of this or gate as the sum (s) of the adder. At the same time, the outputs OUT (3, 5, 6, 7) of the 3-8 decoder are used as inputs to another 4-input or gate, and the output of this or gate is used as the sum output (co) of the adder. When the inputs to the adder are, respectively, a = 1, b = 0, and ci = 1, we correspondingly assign these values to the inputs of the 3-8 decoder, i.e., A = 1, B = 0, and C = 1. In this case, only OUT (5) of the outputs of the decoder is 1, and the rest of the decoder is 0. Based on the connection relations we designed earlier, the sum (s) of the adder is 0 at this point, and the rounding output (co) is 1. This result exactly matches the function of the full adder, so our design is valid.



Ⅴ. Application scenarios of 74LS138 decoder


The 74LS138 decoder has a wide range of application scenarios in digital circuit and logic design. The following are a few common application examples:


1. Control logic

The 74LS138 decoder can be used in control logic circuits. By using the input signal as a control signal and the output of the decoder as a different control state in the control logic circuit, complex control functions such as timing control and state selection can be realized.


2. Multiple selector

Due to the multiplexing function of the 74LS138 decoder, it can also be used as a multiplexer. By using the input signal as the selection signal and the output of the decoder as the selected signal source, the selection and switching of one or more signals among multiple input signals can be realized.


3. Display driver

The 74LS138 decoder can also be used for digital tube display driver circuit. By inputting the binary code to the input of the decoder, the displayed numbers or characters are controlled according to the output state of the decoder. This simplifies the design of the driver circuit and improves the flexibility and reliability of the display.


4. Memory expansion

74LS138 decoder can also be used for memory expansion circuit. By connecting the output of the decoder to the address line of the memory chip, access to a larger memory can be realized. The decoder helps to determine the memory unit to be accessed, which improves the addressing capability of the memory.



Ⅵ. Function truth table of 74LS138


6c58fffc6abc6e09d03cc1c06d9e03df.png



Ⅶ. How to connect the output of 74LS138 to the logic circuit?


First, we need to understand the output characteristics of 74LS138. When the enable terminal (G1) is high, the 74LS138 will select the corresponding output signals (Y0 to Y7) to be high according to the input signals (A, B, and C), and the other output signals to be low. This means that we can connect the output of the 74LS138 directly to the input of the logic circuit. Next, we choose the appropriate logic circuit to connect to the output of the 74LS138 according to our needs. For example, we can use basic logic gate circuits such as AND gates, OR gates, NOT gates, or more complex combinational logic circuits. Then, we connect the output signal of the 74LS138 directly to the input of the logic circuit. During the connection process, we need to pay attention to signal delay and noise issues. If possible, we can use buffers or drivers to minimize the delay and noise. After completing the connections, we need to test and verify that the logic circuit is working properly and that the output of the 74LS138 is driving the logic circuit correctly.



Ⅷ. What is the difference between 74HC138 and 74LS138?


74HC138 and 74LS138 logic function is exactly the same, there is no difference, but there are many differences in their parameters and level types. The following are the differences between them:


1. Different driving ability

74LS138 internal are bipolar transistor output mode, driving ability is stronger, power consumption is also larger; and 74HC138 is a MOS tube circuit, power consumption is smaller.


2. Different level types

74LS138 belongs to the TTL type of level, while the 74HC138 belongs to the CMOS type of level. In early digital circuit design, the ability to drive a circuit was often measured by the number of TTL circuits it could drive, for example, 4 or 8 TTL circuits. The high and low level specifications for TTL and CMOS are different. From the datasheet of 74LS138, we can learn that in TTL level, higher than 2.7V is regarded as high level VOH, while lower than 0.4V is regarded as low level VOL. On the contrary, according to the datasheet of 74HC138, in CMOS level, higher than 1.9V is defined as high level VOH, while lower than 0.1V is defined as low level VOL.


3. Different power supply ranges

The power supply range of the 74LS138 logic chip is usually between 4.75V and 5.25V, while the 74HC138 has a wider power supply range of 2V to 6V. It can be seen that the HC series has a wider power supply range, and is therefore more adaptable in various applications. The LS series is an early logic chip, when the circuit design was mostly based on 5V power supply system, so the power supply range of 4.75V to 5.25V just meets this demand. However, as technology evolved, more and more 3.3V power supply systems appeared. In this case, it was clear that the LS series chips were no longer suitable, and the HC series chips with a wider power supply range appeared. Nowadays, most of the microcontrollers use 3.3V power supply system, so 74HC138 chip is more suitable.




Frequently Asked Questions


1. What is 74LS138?


The IC 74LS138 is a 3 to 8 line decoder integrated circuit from the 74xx family. The main function of this IC is to decode otherwise demultiplex the applications. The decoder 74LS138 IC uses advanced technology like silicon (Si) gate TTL technology.


2. How does 74138 work?


This 74LS138 IC has 3-binary select inputs like A, B, & C. If the IC is activated, then these input pins will decide which of the 8 usually HIGH o/ps will go LOW. The enable pins are two active low & one active high.


3. What is the application of IC 74LS138?


The decoder 74LS138 IC uses advanced technology like silicon (Si) gate TTL technology. These are suitable for different applications like memory address decoding otherwise data routing. These applications will feature high-noise resistance & low power utilization typically allied with TTL circuitry.


4. How do you use IC 74LS138 as a demux?


The LS138 can be used as an 8-output demultiplexer by using one of the active LOW Enable inputs as the data input and the other Enable inputs as strobes. The Enable inputs which are not used must be permanently tied to their appropri- ate active HIGH or active LOW state.