TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
A Neat Bitwise Trick for Swapping Even and Odd Bits
1 points
by
lawrencewu
about 7 years ago
1 comment
joezydeco
about 7 years ago
Collapse
8 bit input? Use a pre-generated lookup table. Store it in ROM.<p>The table deference will take 1 or 2 operations instead of the AND/SHIFT/PUSH/AND/SHIFT/POP/OR described in the answer.
评论 #16639901 未加载