Priority-encoders can be efficiently constructed by recursion. The input vector is split into k equal fragments with n/k bits. A priority encoder \textrm{PE}_{n/k} with a narrower width of 𝑛/𝑘 is applied for each fragment. The valid bit of each of the k \textrm{PE}_{n/k}‘s goes to a k bit \textrm{PE}_{n/k} to detect the first valid fragment. The location of this fragment is the higher part of the overall index, and steers the exact location within the fragment itself to produce the lower part of the overall index.
