HDLbits
Browse Problems

Verilog Language/Procedures

Priority Encoder with Wildcards

medium
procedurespriorityencoder

Requests have descending priority from bit 3 to bit 0. Return the index of the highest asserted request; set valid low and code to zero when there are no requests.