Codiode

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.

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.

Part of Combinational Building Blocks

Problem 27 of 42 in the Combinational Building Blocks track.

Related problems

Browse all problems · Digital logic design practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.