Niroshan Rajadurai

  • Increase font size
  • Default font size
  • Decrease font size
Embedded System Design


Cache Theory 101

E-mail Print PDF

Cache Lookup Strategies

Let's say we have a 32KB cache with 32-byte blocks (lines).  This gives us 1024 blocks which can be held in the cache.  When we want to look in the cache to see if a particular block is present, we can use one of 3 basic strategies:

  1. look in every one of the 1024 blocks to see if the block's tag matches our access address.  This is known as a "fully-associative" cache, because any block from memory can reside in any block in the cache.
  2. use 10 bits of the access address as a selection index to one of the 1024 blocks, then compare that block's tag with our access address. This is known as a "direct-mapped" cache, where a particular block in memory can only go into one particular block in the cache.  All the memory blocks that go to the same cache block are said to be in the same "congruence class".
  3. use a fewer number of bits of the access address as a selection index into a "set" of cache blocks, then search each element of that set for a tag match.  This method is somewhere between a) and b), above, and is known as "set-associative".  For example, if I divide the cache up into 128 sets of 8 blocks each, I have an 8-way set-associative cache which is indexed by 7 bits of the access address. A particular block in memory can then go into any of the 8 blocks in its associated set.

 

Comments (0)
Last Updated on Thursday, 06 January 2011 11:25 Read more...
 

One Little Endian - Cross platform data handling issues

E-mail Print PDF
User Rating: / 1
PoorBest 

TCP/IP networks are rarely homogenous; they usually consist of a wide variety of machines, architectures, and operating systems - each storing binary data in various forms. The actual storage format is transparent as long as you access data locally (i.e., on the same machine). However, you must consider the data storage format differences when transmitting or receiving data across machines and networks.

Any data larger than a single byte can be store its bytes at least two ways: big endian order and little endian order.

Comments (0)
Last Updated on Wednesday, 05 January 2011 16:38 Read more...
 


Related Articles