The above diagram is a hierachical priority encoder circuit. Described on wikipedia, priority encoder is a electronic circuit or algorithm…