Caching and Locality Flashcards

1
Q

What is RAM?

A
  • RAM (Random Access Memory): Type of computer memory used to store data that the CPU can quickly access. This is memory the computer is actively using (different from long-term storage like SSDs)
  • Modern RAM is known as DDR (double data rate), which improves speed and efficiency
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

It is much faster for a CPU to get data from ____ than from a hard drive or SSD.

A

RAM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

No matter how fast the clock speed is over a CPU, the RAM speed ________ changes

A

never

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is cache memory?

A
  • Faster memory in RAM stored either just outside the CPU or within the CPU cores itself
  • Typically 3 levels of Cache, L1, L2, L3
  • The lower the number, the faster the cache is
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe the 3 levels of cache:

A

*L3: Exists across multiple CPU cores. Slightly bigger than other caches but not as big as ram. Usually located on the CPU chip.
* L2: Slightly faster and smaller than L3 cache, located close to CPU cores.
* L1: Smallest but fastest cache and typically is integrated directly into CPU cores. L1 caches are extremely close to CPU cores and provide low-level latency access to frequently used data and instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When is it usefulf or data to be stored in the cache?

A
  • The most frequently used data is stored in cache memory
  • CPU doesn’t have to visit the RAM to get the data it needs
  • CPU gets access to cache memory extremely quickly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How long do the different caches and RAM take to access, approximately:

A
  • L1 and L2: 1 Nanosecond
  • L3: 10 Nanoseconds
  • Main Memory (RAM): Up to 100 Nanoseconds

Note: There are 1 million nanoseconds in a millisecond, and 1000 milliseconds in a second

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a register and how many are there on a computer?

A
  • 16 general purpose registers
  • Register is a small amount of high-speed memory contained within the CPU
  • CPU can only operate on values in registers but can request to load from RAM ->Register or store from Register->RAM
  • The contents of every register loaded from RAM are L1, L2, and L3 cache
  • Registers are always mutable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly