Cache Cruncher

Cache Simulator · Memory · Virtual Memory

Cache Cruncher is a free online cache and memory simulator for computer architecture students, built by Steve Wheeler. Enter any combination of values you know and Cache Cruncher will derive the bit math automatically. Once the geometry is valid, the Cache Simulator can step through addresses and render visual cache and memory tables.

Try an example:

Shaded boxes were worked out for you. Type in any box to set it yourself; your most recent entries win.

Cache Parameters

What do these mean?
Cache size
How many bytes of data the cache holds. Tags and valid bits are extra.
Block size
The bytes moved in and out of the cache together. Also called a cache line.
Number of blocks
Cache size divided by block size.
Associativity
How many blocks share a set (the number of ways). 1 is direct-mapped. One set holding every block is fully associative.
Number of sets
Number of blocks divided by associativity.
Offset bits
The low bits of an address. They pick a byte inside the block: log₂(block size).
Index bits
The middle bits. They pick the set: log₂(number of sets).
Tag bits
The bits left over at the top. They are stored with the block, to tell which block it is.

Memory & Virtual Memory

What do these mean?
Physical address space
The number of bits in a real memory address. With n bits you can reach 2ⁿ bytes.
Physical memory
The bytes those addresses reach. Fill in either this or the bits.
Virtual address space
The number of bits in the addresses a program uses, before they are translated.
Page size
Memory is mapped one page at a time. The low log₂(page size) bits are the page offset and are not translated.
TLB rows
Entries in the translation lookaside buffer, a small cache of recent page translations. It is treated as direct-mapped here.
Protection bits
Extra bits kept in each page-table entry, such as valid, dirty and read or write permission.

Address layout

The offset picks a byte inside the block, the index picks the set, and the tag is compared with the tags stored there to find the block.

Enter a cache and an address size to see how an address splits into tag, index and offset.

Cache Configuration

Memory Configuration

Working

Each value, the formula behind it and the numbers that went in. Sizes are in bytes, and 1 KB is 1024 bytes.

Enter some values, or try an example above, to see the working.

Cache Simulator

Step through addresses and keep the main view focused on translation, cache state, and TLB activity. Extra memory views stay tucked into a compact reference area.

Configure a valid cache geometry to start the simulator.

Separate addresses with spaces, commas or new lines. Use hex (0x3F), binary (0b111111) or decimal. Put W before an address to make it a write.

Address Translation

No address translation yet.

Instruction Breakdown

No access yet.

Address Chain

No access yet.

Trace

No addresses accessed yet.

Cache Table

Cache table will appear here.

TLB Table

TLB activity will appear here.
Page Table and Memory Blocks

Page Table

Page table rows will appear here.

Memory Blocks

Memory blocks will appear here.

How was this tool?

Formulas used

About the Cache Cruncher Cache Simulator

Cache Cruncher is a free online Cache Simulator and Memory Simulator designed for students taking computer architecture or computer organization courses. Type any combination of values you already know — cache size, block size, associativity, address width, page size, TLB rows — and every derived field fills in automatically. Because the solver is bidirectional, you can drive it from either side of an equation: edit num_blocks and cache_size recomputes; edit cache_size and num_blocks recomputes.

What can you calculate and simulate?

Example: a 32 KB, 4-way set-associative cache with 64-byte blocks

Enter cache_size = 32 KB, block_size = 64, associativity = 4, and address_size = 32. Cache Cruncher derives 512 blocks, 128 sets, 7 index bits, 6 offset bits, and 19 tag bits — instantly, with no submit button.

Frequently asked questions

How do I calculate index bits in a cache?

Index bits = log₂(number of sets). Number of sets equals the cache size divided by (block size × associativity). For a direct-mapped cache, associativity is 1.

How do I calculate tag bits?

Tag bits = address size − (index bits + offset bits). Offset bits = log₂(block size in bytes).

How do I calculate TLB tag bits?

TLB tag bits = virtual page number bits − log₂(TLB rows), where VPN bits = virtual address size − page offset bits.

Is my data sent anywhere?

No. Cache Cruncher runs entirely in your browser. There is no backend, no analytics, and no tracking. The Cloudflare Worker only serves the static HTML, CSS, and JavaScript.

Support the tool

If you like Cache Cruncher, I appreciate the support. The site already includes sponsor links at the top, and you can also connect with me on LinkedIn.

LinkedIn

Built by Steve Wheeler — UTSA student from 2023–2025, built while taking Professor Ortiz’s computer infrastructure class to stay engaged and learn.