Experiment 5 Decoder/Encoder/ Multiplexers Design and Implementation Introduction: Data communications between digital systems or computers are usually transmitted in some form of a code. A circuit that will convert a digital input into some form of a binary code is called an Encoder. A digital circuit that converts a binary code into a recognizable number or character is called a Decoder. A multiplexer (or data selector) is a device that is capable of taking two or more data lines and converting them into a single data line for transmission to another point. A multiplexer (MUX) performs the function of selecting the input on any one of 'n' input lines and feeding this input to one output line. Multiplexers are used as one method of reducing the number of integrated circuit packages required by a particular circuit design. This in turn reduces the cost of the system. Objectives: Design, build, and test a variety of Decoders, Encoders and Multiplexers. Demonstrate the operations and applications of Decoders, Encoders and Multiplexers. Implement logic functions using Decoders and Multiplexers. Use Tri-State Buffers to implement a Multiplexer. Procedure: Part 1: Basics of Decoders and Encoder 1. Implement the circuit for the Decoder shown below in Figure 1 on Multisim. Input I1 I0 0 0 0 1 1 0 1 1 Figure 1 Output O2 O1 0 0 0 1 1 0 0 0 O3 0 0 0 1 O0 1 0 0 0 Table 1 2. Use the circuit which you built in the previous step 1 to construct 2-to-4 Decoder with enable. The truth table for this device is given below in Table 2. Input E 1 0 0 0 0 A X 0 0 1 1 Output B X 0 1 0 1 Y0 1 0 1 1 1 Y1 1 1 0 1 1 Y2 1 1 1 0 1 Y3 1 1 1 1 0 Table 2 3. Design an Octal Decoder (3-to-8 decoder) that provides a 0 output for the proper binary pattern using 3-input NAND gates and inverters. It is not necessary to provide enable input(s). Draw the logic diagram and make a data table of the results. Implement the design on Multisim and run the simulation. CPE 0907234 Digital logic lab Prepared by: Eng. Ala`a Arabiyat Page 1 of 4 4. Checking a Decimal-to-BCD Encoder without priority: D9 0 0 0 0 0 0 0 0 1 D8 0 0 0 0 0 0 0 1 0 D7 0 0 0 0 0 0 1 0 0 D6 0 0 0 0 0 1 0 0 0 D5 0 0 0 0 1 0 0 0 0 D4 0 0 0 1 0 0 0 0 0 D3 D2 D1 Q3 Q2 Q1 Q0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 1 Table 3 Implement the circuit of Table 3 on Multisim. Connect the inputs from 1 to 9 to SPDT. Connect the outputs to four consecutive Probes. Set all switches to a low logic level. Set the switches one by one to the high logic value and check the binary number displayed by the Probes. Now, set more than one switch to high logic at a time, with different combinations; analyze and explain the behavior of the circuit. 5. Decimal-to-BCD Encoder (IC SN74LS147): Figure 2 6. Connect the inputs of the Encoder to the switches. Set all switches to high. Connect the outputs A B C D to four consecutive LEDs via inverters to take the signal back to positive logic. Lower the switches one by one and check the binary numbers which are displayed by the LEDs. Now, lower more than one switch at a time in different combinations and analyze the behavior of the IC. Detect the truth table of this Encoder, marking with an X the states of the inputs which do not affect the behavior of the outputs. Design an 8-line-to-3-line priority encoder (inputs and outputs are active high) with a valid bit indicator that is set to 1 when one or more inputs are equal to 1, and then implement your design on Verilog. CPE 0907234 Digital logic lab Prepared by: Eng. Ala`a Arabiyat Page 2 of 4 Part 2: Function Implementation Using Decoders 1. Using 74LS155 Decoder/Demultiplexer IC, see Figure 3, implement the Boolean function: F A B AB Note: Connect the input Data to Vcc. Figure 3 2. Implement the logic function F (A, B, C) = Σ (0, 3, 4, 5) using the Decoder in assignment 3 on Part 1(on Multisim). Part 3: Basics of Multiplexer 1. Implement the logic diagram for the MUX circuit shown in Figure 4 on the kit. I1 X 1 0 X X Figure 4 Input Io En X 1 X 0 X 0 1 0 0 0 S X 1 1 0 0 Output D X 1 0 1 0 Table 4 2. Use the Multiplexer block (IC 74LS153) on the Kit (Figure 5). Connect the data inputs, selection lines to switches, En to ground, and the output to a LED. Raise and lower one by one all switches and check which of them cause the LED to turn on. Change selection code by means of switches. What do you observe? Figure 5 CPE 0907234 Digital logic lab Prepared by: Eng. Ala`a Arabiyat Page 3 of 4 3. Tri-State Buffer: For the Tri-State buffer shown in Figure 6, connect the inputs to switches and the output to a LED, then fill Table 5. Inputs I 0 0 1 1 Figure 6 C 0 1 0 1 Output Y Table 5 Implement 2-to-1 Multiplexer; see Figure 7, using only two tri-state buffers and a single inverter on the Kit. Figure 7 Part 4: Functions Implementation Using Multiplexer 1. Implement the logic function F (A, B, C) = Σ (1, 2, 4, 5) using the Multiplexer in Figure 5 on Multisim. 2. Wire the circuit shown in Figure 8 on Multisim. What logic function does it produce? Figure 8 Part 5: Decoder and Multiplexer Expansion: Cascade 3-to-8 decoders to construct 6-to-24 decoder using IC 74138 (on Multisim). Implement an 8-to-1 MUX using only one 74LS153 IC and a single inverter and 2input OR gate (on Multisim). CPE 0907234 Digital logic lab Prepared by: Eng. Ala`a Arabiyat Page 4 of 4