09-28-2012 08:53 AM - edited 09-28-2012 08:56 AM
It is basically an array that you index. See attached.
09-28-2012 09:11 AM
A lookup table is definetly a possible solution for any kind of swapping/rotation.
I am wondering from your given bytes:
Do they rotate by 1 (01111111 => 11111110 => 11111101 => ...) or
Doe they swap "symmetrically" (0110|1001 => 1001|0110, '|' marks the virtual line of symmetry and is of course not part of the byte)?
As already mentioned, a lookup table will always work, but depending on the situation (like questions above indicate) there might be better performing solutions (at least in regard to exeuction time, maybe even memory consumption).
Norbert
09-28-2012 10:44 AM
I agree, please show us a few example where there is less symmetry in the bytes.