How do you build a priority encoder from gates?
Build a four-input priority encoder from a few AND, OR and NOT gates, so the highest button pressed lights its two-bit code on two LEDs and a valid light shows that any button is down. It teaches how a keyboard or an interrupt controller picks one winner. You need 74HC04 hex inverter, 74HC08 quad AND gate, 74HC32 quad OR gate, Tactile push button 6 mm × 4, LED 5 mm red × 3, Resistor 330 Ω × 3, 9 V battery, 9 V battery snap with DC jack, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
- Level
- Intermediate
- Time
- About 100 min
- Parts
- 10
Make logic pick the highest-priority request.
Parts list
- Integrated Circuits
- Integrated Circuits
- Integrated Circuits
- Switches
- SemiconductorsLED 5 mm red × 3
- PassivesResistor 330 Ω × 3
- Batteries
- Power
- Prototyping
- Prototyping
How to build it
- Write the truth table for four inputs
- Reduce it to simple gate expressions
- Build the gates on the breadboard
- Test all sixteen input patterns
- Check that the highest input always wins
Common questions
What parts do I need for the priority encoder from gates?
74HC04 hex inverter, 74HC08 quad AND gate, 74HC32 quad OR gate, Tactile push button 6 mm × 4, LED 5 mm red × 3, Resistor 330 Ω × 3, 9 V battery, 9 V battery snap with DC jack, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
How long does the priority encoder from gates take to build?
About 100 minutes for a intermediate maker.
