CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Combinational Logic

4:2 Priority Encoder with Valid Output

MediumLogic CircuitBuild

Interrupt controllers and bus arbiters must resolve simultaneous requests by granting access to the highest-priority agent. The priority encoder translates multiple request lines into a binary index representing the most critical active request.

Input I3 has the highest priority, followed by I2, I1, and I0. The 2-bit output vector A1 and A0 encodes the index of the highest active input. The valid signal V asserts high if at least one input is active. Without V, an output of 00 is ambiguous between I0 being active and no inputs being active.

| I3 | I2 | I1 | I0 | V | A1 | A0 | |------|------|------|------|-----|------|------| | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | 0 | 0 | 0 | 1 | 1 | 0 | 0 | | 0 | 0 | 1 | x | 1 | 0 | 1 | | 0 | 1 | x | x | 1 | 1 | 0 | | 1 | x | x | x | 1 | 1 | 1 |

Constraints

  • Combinational logic only.
  • Implement all three outputs: A1, A0, and V.
  • Default A1 and A0 to 0 when no inputs are active.

Topics

combinationalpriorityencoders

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Related problems

  • Binary to HexEasy
  • 1-to-4 Demultiplexer from AND and NOT GatesEasy
  • 2-to-4 Line Decoder with Active-High EnableEasy
  • Hex Nibble to BinaryEasy
  • Odd Parity Bit Generator for 3-bit DataEasy
  • Full Adder from Half AddersEasy
  • Modulo ArithmeticMedium
  • Two's Complement: Encode a Negative DecimalEasy

Browse all problems · Learning tracks