Skip to main content
Engineering LibreTexts

7.4: Implementing a Decoder Using a Single Chip

  • Page ID
    26991
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    A decoder circuit is a commonly used IC, and so it has been implemented in an IC chip. This chip is easier to use than having to produce this entire circuit, so it will be used in chapter 9 to implement a multiplexor. This next section will cover implementing the 74139 decoder chip in a circuit.

    \(\PageIndex{1}\) The 74139 chip

    The 74139 chip implements two complete decoders implemented in a single chip. The two decoders are basically on opposite sides of the chip. The difference is that on the left side of the chip the bottom pin, pin 8, is connected to ground rail, and on the right side of the chip the top pin, pin 16, is connected to the positive rail.

    The 74139 chip has an idiosyncrasy that its output is the inverse of the decoder implemented in section 8.2. This means that the selected output line is set to low, and the non-selected lines are set to high7. So to adjust for this in the implemented circuit the output will be sent to an inverter on a 7404 chip before being sent to the LEDs. This will allow the output to be as it was in section 8.2.

    Figure \(\PageIndex{1}\) is the pin configuration diagram for the 74139 chip. The two decoders on the chip are numbered 1 and 2. The inputs to the first decoder are 1E', 1A0, and 1A1, and the inputs to the second decoder 2E', 2A0, and 2A1. The values of A0 and A1 are the select lines for each decoder. The E' is an enable input low bit. If E' is not enabled (E is positive or not connected), the circuit is basically disconnected, it is neither positive or ground and the results should not be used. If E' is enabled (or connected to ground), the circuit is connected. The use of enable bits is to allow power to be reduced in the circuit, and is an engineering concern, and not really of concern to the circuit.

    The outputs from the decoder are labeled 1Y[0-3] and 2Y[0-3]. They are also active low, and the output line which is low is the one which is selected. In the circuit in this section, only the first decoder will be used, and the outputs will be sent to a 7404 inverted to convert the output to the more common positive output expected.

    Figure \(\PageIndex{1}\): 74139 pin configuration diagram

    Screen Shot 2020-06-26 at 8.27.39 PM.png

    \(\PageIndex{2}\) Implementing one 2-to-4 decoder using the 74139 chip

    This section will outline how to implement a 2-to-4 decoder using the 74139 decoder chip. To start, remember that the output from the 74139 is enable low, or true when the output is 0. So the output from the chip will have to be sent to a 7404 (NOT), and the circuit will consist of 2 chips. The following list of steps implements the decoder circuit using the 74139 chip.

    Figure \(\PageIndex{2}\): 74139 decoder circuit

    Screen Shot 2020-06-26 at 8.30.36 PM.png

    1. Insert switches A and B, and the output LEDs A'B', A'B, AB', and AB.
    2. Insert and power the 74139 decoder chip.
    3. Insert and power the 7404 inverter chip.
    4. Enable output from the first decoder on the 74139 chip by connecting the enable low pin (pin 1) to ground.
    5. Connect the input switch A to pin 3 on the 74139 chip. Connect the input switch B to pin 2 on the 74139 chip.
    6. Connect each output 1I0 to 1I3 to an inverter input as follows:
      1. I0 (pin 3) on the 74139 chip is connected to the fifth inverter (pin 11) on the 7404 inverter chip.
      2. I1 (pin 4) on the 74139 chip is connected to the fourth inverter (pin 13) on the 7404 inverter chip.
      3. I2 (pin 5) on the 74139 chip is connected to the first inverter (pin 1) on the 7404 inverter chip.
      4. I3 (pin 6) on the 74139 chip is connected to the second inverter (pin 3) on the 7404 inverter chip.
    7. Connect the inverter outputs to the correct LEDs:
      1. Connect pin 10 on the 7404 inverter chip to the A'B' LED.
      2. Connect pin 12 on the 7404 inverter chip to the A'B LED.
      3. Connect pin 2 on the 7404 inverter chip to the AB' LED.
      4. Connect pin 4 on the 7404 inverter chip to the AB LED.

    This circuit should now behave like the circuit in section 7.3.


    7 The reason the output is set low is that the output from a decoder is often ignored unless it is the selected output. This means that positive wires can be ignored and not used. Since the low state uses less electricity and produces less heat than the high state, using a low enable rather than a high enable is an engineering decision to save power and heat.


    This page titled 7.4: Implementing a Decoder Using a Single Chip is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Charles W. Kann III via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.