Questions tagged [cpu-cache]

A fast memory limited in space close to the CPU. A cache is designed to reduce the average time to access memory.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
8 views

Find hit ratio for this sequence of memory adresses: 0, 4, 16, 132, 232,160, 1024, 30, 140, 3100, 180, 2180

Assume we have a sequence of 32-bit memory accesses : 0, 4, 16, 132, 232,160, 1024, 30, 140, 3100, 180, 2180 . Assume also a direct-mapped cache with this configuration in bits: (Tag): 31–10, (Index): ...
tonythestark's user avatar
0 votes
1 answer
39 views

Associative memory addressing

I would like to understand better how associative memory works.In associative memory we have the tag and the actual data being stored.The tag describes where the data came from but what does this mean ...
Volpina's user avatar
  • 97
0 votes
0 answers
35 views

How do you determine the amount of bits for the tag, index, and offset in a MIPS byte-addressed direct-mapped cache when given only a list of address?

The question I'm working on is as follows: I'm still kind of working on how direct-mapped caches work in my computer organization class. I sort of understand that you need the least significant 2 ...
mrak-p's user avatar
  • 11
0 votes
1 answer
50 views

I'm completely stumped by these questions for a Computer Organization assignment

My Professor for my Computer Organization class gave us a few questions about caches on an assignment. I'm completely stumped by most of them. I've watched a few videos on caches on YouTube by ...
Kseniya Kolokolkina's user avatar
1 vote
1 answer
32 views

How is the memory address structured when the number of blocks per cache set is not a power of 2?

When it comes to defining the memory address structure given the RAM size, cache size, and other parameters such as the cache block size..., we can have the following generalization: $$Address = TAG|...
Ramzi Baaguigui's user avatar
1 vote
0 answers
36 views

Adding two 2D matrices together: row by row vs column by column

When adding two 2D matrices of the same size (in row major format), in sequential code with no vector operations, is it faster to add them column by column or row by row? At first I thought it would ...
Gabriel's user avatar
  • 11
1 vote
0 answers
34 views

Can compilers improve performance in real workloads by inserting prefetches in their output?

Prefetching is a task that the compiler feels like it should be suited for. Prefetching requires knowing in advance what data the program is about to load, and the compiler has a ton of information at ...
Narrateur du chaos's user avatar
0 votes
0 answers
37 views

Help with a question on write-through and no-write allocate in caches

I am struggling with this question as I am not sure whether the answer that has been provided is correct or not. The image should be sufficient to tell the question. The attached image is of the ...
hgmercury's user avatar
0 votes
0 answers
49 views

Memory Hierarchy Mappings to real world

This article from IBM (link) talks about Memory hierarchy in its actual hardware parts. NUMA While operating systems present memory to the running applications as a unified space, modern large ...
isomorphik's user avatar
1 vote
1 answer
348 views

Page/Frame VS Block

I am bit confused on these terminologies. While studying Paging of Operating System we study about Page and Frame. Size of one Frame of Main Memory = Size of one Page of a Process While studying ...
ANUPAM's user avatar
  • 27
0 votes
1 answer
284 views

compute cache miss rate by given code

I have been trying to solve questions like this before but I have stumbled in difficulty to track the the space of the cache. so there is an example of a question like this: Given the code: ...
user avatar
1 vote
1 answer
107 views

Are really only ~1% of the physical CPU space used for computing

In a Talk by Herb Sutter C++ and Beyond 2012: Herb Sutter - atomic Weapons 1 of 2 at 46:30 the point is made that only around 15% of the physical space (or the transistors) on a CPU do actual ...
alektron's user avatar
1 vote
0 answers
31 views

Direct-Mapped cache for Multicore Processor using MSI Protocol

I am reading a case study for Computer architecture, A Quantitative Approach 5th Edition. For reference, I am looking at the case study #1 in Chapter 5 and none of it is making any sense. It says: ...
Everyone's user avatar
  • 111
0 votes
0 answers
39 views

CPU cache sets and address bits

I have some questions about CPU caches I would like some clarification on. Assume that I have a 128 KB cache with a block size of 64. It is 4-way associative. How many sets does the cache have? How ...
Bradley Lund's user avatar
1 vote
0 answers
30 views

How to decide row / column strides for a loop over a matrix get these cache hit rates?

Given CPU with: L1 cache: 4-ways, block size = 32 bytes , cache size = 64KB , LRU (Cache replacement policy). L2 cache: 2-ways, block size = 32 bytes , cache size = 512KB , LRU (Cache replacement ...
JobProcessTask's user avatar
2 votes
0 answers
68 views

Von Neumann mixed with Havard in modern CPU?

Modern CPUs (for a very wider range of "modern") use separate data- and instruction-caches. So at the core they (probably) have separate busses for data and instructions. Does that make the &...
kruemi's user avatar
  • 121
0 votes
0 answers
35 views

Performance of CPU with two caches

I was very confused how to solve the problem when there are two levels of cache, My doubt is how does we quantify the performance when there are two caches. Consider a problem like this Cache L1 ...
user avatar
0 votes
1 answer
69 views

Are sample memory access traces/dumps available, and where?

I am looking for a realistic physical memory access trace/dump of significant, but not insane, length (on the order of 1M accesses) for the purpose of cache simulation. Preferably for a 16-bit or 32-...
DYZ's user avatar
  • 111
1 vote
1 answer
272 views

Where does tag directory is stored

I am studying direct mapping in cache. I understood the concepts like dividing into blocks and lines , tag directory etc. When solving numerical problems of finding main memory size or tag directory ...
Brijesh joshi's user avatar
-3 votes
1 answer
44 views

8085 microprocessor connection of CPU data bus with RAM data bus

What would happen if the CPU data-bus bit 2 is connected to the RAM data-bit 5 and CPU data-bus bit 5 is connected to RAM data bit 2? Assume the rest of the connections are all right – explain.
Yukti Kumari's user avatar
1 vote
1 answer
286 views

How can an instruction be fetched every cycle?

From what I understand, in a pipelined CPU, every stage takes 1 cycle. But instructions are fetched from memory which takes up to ~150 cycles. The CPU fetches most instructions from the L1-cache, but ...
seb's user avatar
  • 13
0 votes
1 answer
143 views

Confusion regarding calculation of estimated memory access time in a system containing only a cache and main memory for simplicity

Let us consider a system having cache and main memory. Now suppose we are asked to find the average memory access time. Let $h$ be the hit ratio for the cache, $t_c$ be the cache access time, $t_m$ be ...
Abhishek Ghosh's user avatar
2 votes
1 answer
105 views

How does software prefetching work with in order processors?

From prof. Onut Mutlu's slides on prefetching, this example has been shown as software prefetching: ...
Rufat Imanov's user avatar
1 vote
2 answers
201 views

How to determine offset bits when addressing CPU cache?

I know that the offset is based off of the line size for a cache. I have seen the example: "32-btye line size would use the last 5-bits (i.e. $2^5$) off the address as the offset into the line&...
Jake6724's user avatar
0 votes
1 answer
77 views

Cache memory temporal locality and spatial locality principles

How does cache memory take advantage of both temporal locality and spatial locality principles?
Melany's user avatar
  • 3
1 vote
0 answers
46 views

How could one construct a TLB so that not all the bits of the presented address need match to result in a hit?

I was wondering besides the typical matching of all bits in the presented address to the resulting page, is there another way of doing so? what are the benefits/ cons and how would one go about doing ...
I'veGotSomeQuestions's user avatar
2 votes
1 answer
225 views

Would increasing system memory speed reduce a Von Neumann Architecture bottleneck?

A Von Neumann Architecture bottleneck is a limit on the amount of data a computer can process due to limited bandwidth between the CPU and RAM. Possible mitigations to the problem according to ...
user avatar
1 vote
1 answer
1k views

Formula to see where a memory address can be depicted in cache?

I've been trying to find a formula that helps us identify where an address can be depicted in cache. I remember my professor talking about some kind of division but I can't find it in my textbook nor ...
tonythestark's user avatar
0 votes
1 answer
105 views

Query Regarding Direct cache mapping [closed]

Thank you for looking into this, I have a problem regarding direct cache mapping, My problem really though is with the question formation itself and the problem I am about to present seems to have ...
Pawan Nirpal's user avatar
0 votes
1 answer
48 views

Cache read controller

Does the cpu interface with a memory controller to read the cache? What happens when data is not in the cache, a cache miss, does it automatically fetch the data?
Road's user avatar
  • 41
1 vote
3 answers
842 views

Calculate the effective access time

This question seems to be causing a lot of debate and I'm wondering whether my working is correct. A computer with a single cache (access time 20ns) and main memory (access time 500ns) also uses the ...
h_55's user avatar
  • 11
4 votes
7 answers
9k views

What is a cache write miss?

I'm reading Computer Organization and Design MIPS Edition 5th Edition The Hardware/Software Interface on how memory cache works. I came across the following paragraph on page 393; The other key ...
Jamāl's user avatar
  • 179
2 votes
1 answer
2k views

What does "associative" exactly mean in "n-way set-associative cache"?

I'm trying to grasp what does associative actually mean in n-way set-associative cache. I understand n-way set-associative cache as a concept; n is the degree of ...
adder's user avatar
  • 151
0 votes
0 answers
111 views

I'm to calculate the tag, index and offset for a given setup

Total Memory size = 65,536 bytes Number of cache blocks = 32 cache blocks Cache size = total 512 bytes So using this info provided I cannot figure out how to calculate the cache block number. I know ...
Eehit Ray's user avatar
1 vote
1 answer
154 views

Cache Miss and Processor Speed

today in my class my professor mentioned that Cache misses becomes more expensive as the speed of the processor increases But he didn't explain the reason. I ...
Turing101's user avatar
  • 1,180
-2 votes
1 answer
437 views

Find main memory location in cache(direct mapping)

Consider main memory of the size 64 kB with each word being 8 bits(one byte) only and a direct mapping Cache memory of size 4 kB also having data word size 8 bits. Find the following : Find the size ...
anuj goyal's user avatar
1 vote
1 answer
164 views

How does the cache / memory know where to return results of read requests to?

The pipeline of a modern processor has many stages that may issue read requests to main memory, e.g. in fetching the next command or loading some memory location into a register. How is the result of ...
Martin Berger's user avatar
0 votes
1 answer
521 views

Computing average access time

A computer has a cache memory and a main memory with the following features: - Memory cache access time: 4 ns - Main memory access time: 80 ns - The time ...
jin kaido's user avatar
0 votes
1 answer
143 views

Virtual Memory vs Cache for block identification

Both are based on the principle of locality. Then why virtual memory uses table lookup while cache memory uses associative memory for block identification?
Www's user avatar
  • 73
1 vote
0 answers
280 views

Cache write misses

I've been using Intel Pin tool to perform analysis of cache miss rates of a parallel application in multi-level caches, using one of the examples allcache.cpp, the results differentiate load and write ...
vava's user avatar
  • 11
0 votes
2 answers
168 views

How does a cache handle overwriting between 2 addresses in the same block?

Consider a byte-addressable cache with block size 16 bytes, bytes 0-15 form one block. First I write an int(let's say 7) to address 0, so now bytes 0-3 contain the int 7. Now if I try to write another ...
hey dude's user avatar
0 votes
2 answers
4k views

Average access time in two level cache system

In a two-level cache system, the level one cache has a hit time of 1 ns (inside the CPU), hit rate of 90%, and a miss penalty of 20 ns. The level two cache has a hit rate of 95% and a miss penalty of ...
Www's user avatar
  • 73
0 votes
0 answers
84 views

Size of the data bus connecting CPU cache and RAM?

I'm reading about CPU caches and I read that typically, cache line sizes start from 32 bytes. Since memory is slower than CPU caches therefore data is frequently loaded from the RAM into the cache and ...
Vishal Sharma's user avatar
1 vote
2 answers
59 views

Dynamic selection of cache replacement policy

There are some different cache replacement policies could be implemented in CPU. As far as I know, ones have better hit ratio on specific type of code than others, but if that type changes (for ...
RedMurloc's user avatar
1 vote
3 answers
184 views

Does RAM get an indication of data size required

Pre-information: I'm sure someone has asked something along these lines, but no matter how I word it, I can't seem to find a definitive answer Question: Does RAM get some kind of indication as to ...
Dan's user avatar
  • 23
0 votes
0 answers
35 views

64 byte cache block and memory overhead for cachline with 7 states (3 bits)

I came across some lecture notes of a professor about memory consistency and models. There is an example about memory overhead: The cache line has 7 states (3 bits): unowned, shared, exclusive, ...
Joe Toe's user avatar
  • 101
0 votes
1 answer
25 views

Reactiveness, cpu and caches

I was messing around with a reactive-based frameworks and found it very expressive. Unfortunately, most of them are using techniques that are not very efficient on CPU cashing mechanism such as ...
oneWayTicket's user avatar
0 votes
1 answer
33 views

Operating System code suffers more cache misses than user code

I was going through the text of the book Computer Architecture: A Quantitative Approach. It has a section in Chapter 5 where it discusses the fact that OS code undergoes more cache misses as compared ...
Tapojyoti Mandal's user avatar
4 votes
1 answer
134 views

Is PREFETCH an asynchronous operation?

I often hear Prefetching as a technique for speeding up, for example, sequential memory access pattern. The prefetch should occur sufficiently far ahead in time to mitigate the latency of memory ...
richizy's user avatar
  • 141
0 votes
1 answer
1k views

Direct and Associate Cache - Offset, Index, and Tag

I have two questions: ...
Hawkeye's user avatar

1
2 3 4 5