Hacker News new | ask | show | jobs
by theocean154 3809 days ago
There's a far better way to do this, which essentially decomposes into an insertion sort. Details here: https://github.com/theocean154/dau/tree/master/sort
1 comments

Yeah I was thinking the same thing, just compare all the registers to the value of the next item @posedge_clk and use that bit to tell the registers whether or not they need to shift their value into the next register. It replaces the `memmove()` (the abstract concept) with a single cycle shift
The benefit of my way is that you get pipelining (which lets you maintain O(1) throughput without having a fill/flush cycle), as well as better scaling (due to said pipelining) and better energy usage due to smaller fanout.