Sorting array of 2^x words in real-time
It's hard for me to understand what you mean by sorting them in hardware. This looks like a typical computer science class problem, where you need to make up some algorithm, that won't have to go through each and all of value to sort them but kinda shortcut. There is an interesting way of sorting on the bit level (in software). What's cool, it's a linear algorithm, not even square (correct me if I'm wrong about that, last time I saw that thing in university many years ago, never had a need to implement it).

I assume you sort ascending, but it doesn't really matter, you can flip it around.

You sort by each bit. First the most significant bit. Values with 0 MSB come first. Then those with MSB=1. Then within each group you recursively place those with 2ndMSB=0 first and 2ndMSB=1. And then recursively for the next bits. So you pretty much look at every number only number-of-bits-times.