075582814553
What is a Decoder?

FREE-SKY (HK) ELECTRONICS CO.,LIMITED / 06-30 13:57

A decoder is a type of circuit that can translate the state of the input binary code into an output signal to express its original meaning. It can be said that the circuit that realizes the specific meaning of the code state is called a decoder.

Ⅰ What is a decoder?

The decoder is a type of multiple-input multiple-output combinational logic circuit device, which can be divided into two types: variable decoding and display decoding. The variable decoder is generally a device that converts less input into more output, and there are two common types: n-line-2^n-line decoding and 8421BCD code decoding. Display decoders are used to convert binary numbers into corresponding seven-segment codes. 

Decoding is the reverse process of encoding. During encoding, each binary code is given a specific meaning, that is, it represents a certain signal or object. The process of "translating" the specific meaning of the code state is called decoding, and the circuit that implements the decoding operation is called a decoder. In other words, a decoder is a circuit that can translate the state of the input binary code into an output signal to express its original meaning.

According to need, the output signal can be a pulse, high level, or low level.

Ⅱ Classification

There are many types of decoders, but their working principles and analysis, and design methods are similar. Among them, binary decoders, binary-decimal decoders and display decoders are the three most typical and widely used decoding circuits.

Binary code decoder, also called minimum item decoder, takes one decoder from N, the minimum item decoder generally translates binary code into decimal code;

Transcoding decoder is to convert from one encoding to another;

The display decoder generally translates a code into a decimal code or a specific code and displays the status of the decoder through a display device.

Ⅲ Working principle and circuits

The decoder is a logic circuit with a "translation" function. This circuit can translate the various states of the input binary code into corresponding output signals according to its original intent. Some decoders are equipped with one or more enable control input terminals, which become chip select terminals to control whether decoding is allowed or prohibited.

 74LS138 decoder circuit

Figure 1. 74LS138 decoder circuit

In Figure 1, 74138 is a 3-to-8 line decoder. The three input terminals CBA have a total of 8 state combinations (000-111), which can decode 8 output signals Y0-Y7. This kind of decoder has three enable input terminals. When G2A and G2B are both 0 and G1 is 1, the decoder is in a working state and outputs a low level. When the decoder is disabled, it outputs a high level.

Decoder circuit structure

Before discussing the function of the decoder, let's take a look at the internal structure of the decoder. 

The internal structure of the decoder

Figure 2. The internal structure of the decoder

Figure 3 below is a 2-input decoder mainly composed of an AND circuit, and its output is 22 (that is, 4). Each of its outputs corresponds to a minimum item, which can be seen from the figure. In this circuit, when the value of the input BA is 10, which corresponds to the decimal number 2, its F2 output is high, and the rest of the output is 0.

 2-input decoder composed of AND circuit

Figure 3. 2-input decoder composed of AND circuit

Figure 4 below is also a 2-input decoder, but because it is mainly composed of a NAND gate, each output corresponds to a minimum term NOR. In this circuit, when the input BA is 10, its output F2 is no longer 1, but the output is 0, and the remaining outputs are 1.

2-input decoder composed of NAND gate circuit

Figure 4. 2-input decoder composed of NAND gate circuit

We regard the following decoder circuit as the output low level effective (that is, when the input variable corresponds to decimal i, its corresponding i-th output terminal is low level, and the rest are high level). Of course, the previous decoder is active at a high level.

The two circuits listed above have 2 inputs. The same applies to the case of more than 2 inputs. There can also be output high-level effective and low-level output effective.

Realize logic function with decoder

Since any combinational logic circuit can be written in the form of a minimum term expression, and the output of the decoder circuit lists all the minimum term expressions (or non-expression of the minimum term) of the circuit, We may use decoder circuits to implement various combinational logic circuits.

Example:   Realizing F(X,Y,Z)=∑(0,1,4,6,7)=∏M(2,3,5) with decoding circuit

We can implement this logic function in several ways. Figure 5 lists four methods. From these four figures, you should be able to summarize the rules.

Figure a is the realization method of high-level effective output plus OR gate;

Figure b shows the implementation method of low-level effective output plus NAND gate;

Figure c shows the implementation method of high-level effective output plus NOR gate;

Figure d shows the implementation method of low-level effective output plus NAND gate;

 Realize logic function with decoder

Figure 5. Realize logic function with decoder

Enable Inputs

The enable pin is often encountered in medium-scale integrated circuits. The enable pin can be either input or output. It is used to expand the function of medium-scale integrated circuits. Figure 6 a is a 2-input decoder added with an input E. Due to the addition of the input terminal E, its function has changed. When E=0, its output is all 0. If the decoder does not add the E terminal, it is active at high level. At this time, none of its output terminals is in a valid working state. We can understand that when E=0, the decoder does not work; when E=1, we see that the decoder can work normally. We call the enable terminal that can work normally when E=1 as high level active. Figure b below is a simplified logical symbol.

Enable Inputs circuit

Figure 6. Enable Inputs circuit

The following figure 7 is an example of using the enable terminal to convert two 2-input decoders into a 3-input decoder. When I2 is low, the enable terminal of the first decoder is high. When I2 is high, the decoder 2 works and the second decoder does not work at this time, so the output of decoder 1 corresponds to 0~3 of input I3I2I1; when I2 is high, decoder 2 works and decoder 1 is not working, so its output corresponds to 4-7 of the input I2I1I0. So the circuit in the figure below realizes the use of the enable terminal to expand the decoder with 2 inputs to the decoder with 3 inputs.

Use the enable terminal to convert two 2-input decoders into 3-input decoders

Figure 7. Use the enable terminal to convert two 2-input decoders into 3-input decoders

Standard medium-scale decoder circuit

There are several types of decoders in medium-scale integrated circuits. The most widely used is usually 74138, which is a 3-8 decoder. The following figure 8 shows its logic symbols and pin assignments. The following table lists the logic function of the device. It can be seen from the table that its output is active low, the enable terminal G1 is active high, and /G2, /G3 are active low. When one of them is low, The output terminals are all 1.

3 to 8 decoder logic symbol, pin arrangement and logic function

Figure 8. 3 to 8 decoder logic symbol, pin arrangement, and logic function

Example: Try 74138 to realize the function F(X,Y,Z)=∑m(0,2,4,7)

Using 74138 to realize the function is the same as the method of the decoder to realize the logic function mentioned above, but two points must be paid attention to:

The output of 1.74138 is low-level effective, so when implementing logic functions, the output terminal can not be connected to the OR gate and NOR gate (because each time only one is low level, the rest are high level);

2.74138 differs from the previous one in that it has an enable terminal, so the enable terminal must be processed, otherwise, the required logic function cannot be realized. The following figure shows the final circuit.

Display decoding

The working principle of commonly used display devices

Common digital displays in digital systems usually include light-emitting diode nixie tubes (LED nixie tubes) and liquid crystal display nixie tubes (LCD nixie tubes). The LED digital tube uses light-emitting diodes to form strokes for displaying numbers to display numbers. Because the LEDs emit light, the LED digital tube is suitable for various occasions. The liquid crystal display digital tube uses the liquid crystal material to absorb light under the action of alternating voltage, and there is no stroke without the action of the alternating electric field, so it can display the number. But because the liquid crystal material must have light It can only be used, it cannot be used in situations where there is no outside light (the LCD of portable computers can be used at night under the action of the backlight). One of the biggest advantages of liquid crystal displays is power saving, so they are widely used for digital displays of small devices such as small calculators.

The following figure 9 shows the internal structure of the LED digital tube and the display of numbers. It is a kind of LED digital tube with an anode connected in one. We usually call it a common anode digital tube. Since there is a common anode digital tube, there is a common cathode digital tube.

The internal structure of the LED digital tube and the display of the digital situation

Figure 10. The internal structure of the LED digital tube and the display of the digital situation

LED decoding drive circuit

Light-emitting diodes only need to be forward-conducted. According to whether the common electrode of the LED is the anode or the cathode, there are two types of decoders, namely, the low-level effective decoder for the common anode; the high-level effective decoder for the common cathode LED.

4511 is a CMOS display decoder with effective high-level output. Its input is 8421BCD code. The figure and table below are the pin arrangement, logic symbol, and logic function table of 4511 respectively.

4511's pin arrangement, logic symbols and logic functions

Figure 10. 4511's pin arrangement, logic symbols, and logic functions

In the figure:

/LT: low level is effective, when it is low level, all strokes are all on, if not, it means there is a problem with the stroke;

/BL: low level is active, when it is low level, regardless of the input data state, its output is all low level, that is, all strokes are off;

/ST/LE: Strobe/Latch pole, which is a multiplexed functional terminal. When the input is low, its output is related to the input variable; When the input is high, its output is only the same as the state before the end is high. No matter how the input DCBA terminal changes, its displayed value remains unchanged.

D, C, B, A: 8421BCD code input, the D bit is the most bit;

a~g: The output terminal is high-level effective, so its output should correspond to the digital tube of its cathode.

LCD decoder driver

The LCD decoder driver circuit is different from the LED decoder driver circuit. Its output is not a high level or a low level, but a pulse voltage. When the output is valid, its output is an alternating pulse voltage, otherwise, it is a high level or low level.


Processed in 0.058460 Second , 23 querys.