> >It appears to require 6 shifts, six ANDs, and 5 ORs... seems unlikely >it would be faster than the "straightforward" implementation? It looks >like a case of someone trying to be clever after they learned why a >quicksort is better than something like a bubble sort (what he does is >swap bits 0/1, 2/3, 4/5, 6/7... then 0-1/2-3, 4-5/6-7, and finally 0- >3/4-7). The problem is that with only 8 bits there's not any speedup >yet that I can see -- just as smart general purpose sorting routines >will revert to something like a bubble sort of lists of less than, say, >10 items! Unless someone pops up from left field here with a new solution, I'm going to say that we have a couple of nice solutions now, and call this one "done". The table lookup is, somewhat surprisingly efficient, other than on code space, especially when the table can be located on an even page. Interestingly enough, I think it executes in the equivalent of one instruction on the PIC. VBG! The external loopback is fun, if you have the pins available. That's the point of challenges like this, to encourage "out of the box" thinking and explore ideas. So, anyone want to propose a new little problem?
Message
Re: [AVR-Chat] Re: Challenge
2005-06-09 by Dave VanHorn
Attachments
- No local attachments were found for this message.