When a binary encoded output is desired from prioritized request lines, there are two reasonable methods. For smaller input counts, the best implementation is the case statement. A small C program is the best way to build these. The example file implements a 6-input priority encoder in exactly 3 LUTs using the case method.
For larger input sizes, the case statement method becomes infeasible. A reasonable alternative is to implement a bitscan function as described above followed by a one-hot to binary conversion array. An appropriate OR gate array is discussed in Chapter 4, Translation and Format Conversion, in “One-Hot to Binary” on page 4–25. An additional gate is required to deal with the all-lines-0 case.