Rearranging Bits and Bytes
Prev: Searching Words
Next: Multiplication
Sections
7-1Reversing Bits and Bytes7-2Shuffling Bits7-3Transposing a Bit Matrix7-4Compress, or Generalized Extract7-5Expand, or Generalized Insert7-6Hardware Algorithms for Compress and Expand7-7General Permutations, Sheep and Goats Operation7-8Rearrangements and Index Transformations7-9An LRU Algorithm
Problems
-
Explain the workings of the second Mobius formula, Equation (1), page 139.
-
The perfect outer shuffle operation and its inverse employ the following masks. What is a formula for the general case, ? A formula might be useful in situations in which an upper bound on the length of the integers being shuffled is not known in advance, such as in bignum applications.
-
Code a function similar to the compress function of Figure 7-9 that does the expand operation.
-
For an -way set-associative cache, what is the theoretical minimum number of bits required to implement the LRU policy? Compare that to the number of bits required for the reference matrix method, for a few small values of .