Projects / Ideas / Priority encoder from gates

Priority encoder from gates

IntermediateDigital LogicIdeaReviewed
In short

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
An idea, not a guided build yet. Goal, parts and steps; no wiring, code or tests. Copy it to My Garage to plan it.
Goal

Make logic pick the highest-priority request.

Parts list

How to build it

  1. Write the truth table for four inputs
  2. Reduce it to simple gate expressions
  3. Build the gates on the breadboard
  4. Test all sixteen input patterns
  5. Check that the highest input always wins

Related projects

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.