A priority encoder is a circuit or algorithm that compresses multiple binary inputs into a smaller number of outputs.
en.m.wikipedia.org