One embodiment of the present invention provides a system for mapping memory
addresses to cache entries. The system operates by first receiving a memory request
at the cache memory, wherein the memory request includes a memory address. The
system then partitions the memory address into a set of word offset bits and a
set of higher-order bits. Next, the system maps the memory address to a cache entry
by computing a modulo operation on the higher-order bits with respect to an integer
and using the result as the cache index.