EE 110 Lab Experiment #8 Fall 2009 NAME: _________________________________ EXPERIMENT 8: Priority Encoder (1 week) The purpose of this laboratory is to design, build, and test a priority encoder circuit using the combinational logic techniques we have learned so far. Students will work individually. Background: The following diagrams illustrate the pinouts of several TTL devices we have in stock. In all cases, pin 7 must connect to GND and pin 14 to the +5V power supply. Without proper power and ground connections, the device will not function. DO NOT wire these backwards – you will destroy the part! A priority encoder is a device that generates a binary code that corresponds to the index of the input having the highest priority. For instance, let’s consider a four-input priority encoder. It has four inputs, which we’ll call A3, A2, A1, and A0. The outputs are Y1 and Y0. We want to design and build a logic circuit that generates and displays the code of the input having the highest priority. The higher the index number, the higher the priority or numerical significance. Desired behavior: When all A inputs are zero, we want the 7-segment display to be dark. If any A inputs are 1, the 7segment display must be on. Let’s define an output ~G (the tilde means complement) to control whether the 7-segment display is on or off. This output must be 0 in order to turn on the display. When the 7-segment display is on, we want it to display the numerical code of the index of the highest priority A input. A1 is higher priority than A0; A2 is higher priority than A1; and A3 has the highest priority of all inputs. 7-1 EE 110 Lab Experiment #8 Fall 2009 Pre-Lab: 1) Complete the truth table below to fully describe the behavior of the four-input priority encoder. To help get you started, a few entries have been given in advance. A3 A2 A1 A0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 LED Display dark Code 0 Code 1 Code 1 Code 2 ~G Y1 Y0 1 0 0 0 0 0 0 0 1 2) Transfer the truth table entries above into Karnaugh maps, with each output going into its own map. Now use the K-maps to produce minimized SOP expressions for each output. Be sure to check your work before proceeding! You don’t want to build an incorrect design. ~G ~G = Y1 Y1 = 7-2 EE 110 Lab Y0 Experiment #8 Fall 2009 Y0 = 3) Next, draw a logic diagram in the space below to produce each of the above outputs. Be sure your design can be built using the gates we have on hand. Label each gate with the 7400 family part number you plan to use. Label the inputs and output of each gate with the pin numbers you wish to use for the chosen device. Figure 1: Neatly drawn logic diagram that directly realizes your priority encoder design Lab: 1) Now augment your design above by including the inputs and outputs as required. Your inputs A3, A2, A1, A0 will come from switches SW3, SW2, SW1, and SW0, respectively. Wire your 7-3 EE 110 Lab Experiment #8 Fall 2009 outputs Y1 and Y0 to bits 1 and 0, respectively, of the single LEDs. Wire your ~G output to bit 2 of the single LEDs. This way, you should be able to see your output signals individually. Finally, you’ll need to connect your outputs to drive the 7-segment display. The ~G output must go to the input labeled D1, just below the right-hand 7-segment LED display. Connect Y0 to the A input and Y1 to the B input of the 7-segment decoder. You’ll find these in the upper left corner of your trainer. Make sure all DIP switches are in the ON position. 2) Now carefully build this logic circuit on your proto board. Use 22-gauge wire to make the connections. Check your work thoroughly before applying power to your circuitry. Use RED only for +5V power and BLACK only for GND. 3) Check your wiring. a. Make sure you have not connected a gate output directly to a switch. b. Make sure your power connections (RED) and ground connections (BLACK) are correct to each chip. Power should go to pin 14; GND should go to pin 7. c. Make sure you have not connected two gate outputs together. d. Apply power and briefly test your circuit by exercising the switches and watching the responses in the LEDs and 7-segment displays. If the circuit doesn’t work correctly, use the logic probe to help track down the problem by checking each gate input and output as you manipulate the switches. 4) Compare your circuit’s operation to the truth table you produced earlier. Put a check mark to the right of each truth table row you verify as working correctly as intended. 5) Demonstrate the operation of your logic circuit to the teaching assistant or professor. Get their signature and comments regarding the functionality of your circuits. TA Signature: _______________________________________________________________ 6) e. What results did you obtain in this experiment? f. What difficulties did you have? g. What are your conclusions? What did you learn about priority encoders? 7-4 EE 110 Lab Experiment #8 Fall 2009 7) Once your work is complete, please dismantle your wiring and remove the chips you installed. (Leave the power bus wiring in place.) Return your chips to the correct places in the parts bin. 7-5