Computers are really fast at doing things.
The CPU in a computer operates at a clock speed approaching 6 billion ticks per second.
On each clock cycle, the processor can complete multiple instructions on each of its processing cores.
Keeping those cores fed with data is critical to performance.
Storage media contain all of the data the CPU could want.
The main problem is that theyre slow, really slow compared to the CPU.
To hide that slowness from the CPU system RAM is used to store the data of all running programs.
Contents
Caching for speed
To hide that latency from the CPU a tiered CPU cache is used.
Typically, the CPU cache has three tiers referred to as L1, L2, and L3.
L1 is the fastest tier, able to return results on the order of 5 clock cycles.
The L2 cache may take 20 cycles and L3 around 200 cycles.
The smaller the cache the less time it takes to find and return a result.
As such a large L1 cache would take longer to return any result.
The actual memory cells for the L1 cache are quite large, making them faster to access.
Shrinking their size to fit more in the same area, slows them down.
Silicon die area is expensive, allocating more of it to cache increases the cost.
All of these factors have led to the tiered caching system.
modern computers use virtual memory.
Each system is allocated its own memory space with its own addressing system.
This helps to provide security as well as prevent memory issues from affecting other programs.
It lets you hide the underlying architecture of the RAM from the software.
Unfortunately, it also means that you should probably translate every virtual address to the physical address.
This means that for read data from memory, you better make two requests to memory.
This downside even affects the cache.
to read the cache youd have to go all the way to the main memory.
Thankfully tag memory prevents that.
Tag memory is arranged differently from normal memory.
Tag memory basically stores memory address translations.
Conclusion
Tag memory is a form of memory that can be accessed differently from standard memory.
In modern computers, tag memory is referred to as the Translation Lookaside Buffer or TLB.