Memory Hierarchy Flashcards

1
Q

What are the characteristics of Memory?

A
  • Location
  • Capacity
  • Unit of transfer
  • Access method
  • Performance
  • Organisation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Capacity normally expressed as?

A

Bytes

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

What are three ways of expressing memory performance?

A
  • Access Time
  • Memory Cycle time
  • Transfer Rate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Access Time?

A

Time between presenting the address and getting the valid data (Stated as N clock) typically nanoseconds

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

What is Memory Cycle time

A

Time may be required for the memory to recover before next access

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

What is Transfer Rate?

A

Rate at which data can be moved - typically gigabytes

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

What are the characteristics of physical memory?

A
  • Decay
  • Volatility
  • Erasable
  • Power consumption
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What type of physical memory use semiconductors?

A
  • SRAM
  • DRAM
  • Flash
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How did Core memory work?

A
  • Magnetic ring for each bit
  • Used high currents
  • 1-6 µs cycle time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How does storage hierarchy looklike?

A
  • Registers
  • L1 Cache
  • L2 Cache
  • Main Memory
  • Disk cache
  • Disk, Flash/SSD
  • Optical
  • Tape
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is DRAM and how does it work?

A

Dynamic RAM
- Bits stored as charge in capacitors
- Charges leak so need refreshing even when powered
- Simpler construction
- Smaller per bit
- Less expensive
- Slower (6-60ns)
- Used in main RAM
- “switch” connects it to the read or write circuit

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

How does DRAM refresh work?

A
  • Each bit discharges over time and is boosted back by the refresh
  • This is a disadvantage of DRAM - but density is very high
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the specs and characteristics of DDR5?

A
  • Approx. 2 x DDR4
  • Faster clocks (up to 4Ghz) -> more bandwidth
  • Two independent 32 bit channels
  • Some error correction built-in
  • Lower voltage (1.1V) -> 20% lower power use
  • Can burst read 64 bytes
  • Capacity up to 96GB DIMM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is SRAM and its characteristics?

A

Static RAM
- Bits sorted as on/off gates (using 4-6 transistors)
- No charges to leak, no refreshing needed when powered
- More complex construction - Larger per bit
- More expensive per MiB (100x)
- Faster (0.5 to 10ns)
- Good for Cache and embedded RAM
- Only used as main RAM on microcontrollers

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

What is ROM?

A

Read Only Memory
- Permanent storage (Non-volatile)
- Hardware support library subroutines
- Systems programs (BIOS)

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

What do CPUs use for DIMMs?

A

Two 64 bit channels

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

How can increasing DDR4 DIMMs help?

A

4 can increase bandwidth and decrease latency to/form cache as accesses can be interleaved

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

What type of errors can occur in memory?

A
  • DRAM can loose data (e.g. 25k failures per Mbit per billion hours)
  • Hard Failure (Permanent defect - most common)
  • Soft Error (Random, non-destructive as there is no permanent damage to memory)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are Caches?

A
  • Caches are small blocks of fast SRAM located on CPU chip
  • The CPU needs data faster than DRAM can provide so Memory requests go there, not DRAM
20
Q

How does a cache operation work?

A
  • CPU reads a memory location
  • address goes to cache
  • If present, cache provides data (cache hit)
  • If not present, block read required from main RAM to cache (cache miss)
  • Then deliver data request by CPU
21
Q

What are the Cache Design parameters?

A
  • Size
  • Mapping function needed
  • Replacement Algorithm
  • Write Policy
  • Block Size
  • Number of Caches
22
Q

Why is it preferable to use smaller L1 cache than a bigger L2 cache?

A

Big caches have longer latency

23
Q

What is latency?

A

The time it takes for data to travel from one place to another

24
Q

How does RAM get shielded from the cores with cache?

A

Multiple cores usually share a large level 3 cache to shield RAM from the cores

25
Q

Why is the Cache Mapping Function used?

A
  • Needed because cache is smaller than main RAM
  • Blocks of cache are allocated to certain addresses
  • Simplest method -direct mapped
  • Most caches now associative
26
Q

How are Cache misses avoided?

A
  • Try to access consecutive bytes in a cache line
  • Align data to the cache line boundaries
27
Q

How does Magnetic disks work?

A
  • One head per side
  • Heads are joined and aligned
  • Aligned tracks on each platter from cylinders
  • Data is striped by cylinder (reduces head movement and increases speed)
  • Best value online storage
28
Q

How is Data organised and formatted on a Magnetic disk?

A
  • Concentric rings or tracks
    Gaps between tracks
    Reduce gap to increase capacity
    Same bits per track
  • Minimum block size is one sector
  • Tracks divided into sectors of 512B or 4KiB
29
Q

What determines HDD speed?

A
  • Seek time (Moving head to correct track)
  • Rotational latency (Waiting for data to rotate under head)
  • Access time = Seek + Latency
  • Transfer rate
30
Q

What is on-disk cache?

A
  • Used to store whole tracks and cache r/w
  • Acts as a buffer between disk
31
Q

What is the Mean time between failures for hard disks?

A

114 years

32
Q

What are the characteristics of SSDs?

A
  • Non volatile NAND logic (Fast) or flash based
  • Fast access times
  • Near zero latency
  • Sequential read speed 500-7000 MiBs
  • Max about 18TiB at the moment
  • More shock resistant, silent
  • Lower power
  • Expensive per Gbyte compared to HD
33
Q

What are SSD characteristics?

A
  • Can only write approx millions of times
  • They need up to date firmware and drivers
  • A very full SSD can wear-out the remaining space faster
34
Q

What is wear levelling?

A

Spreads the writes around so no one area is worn out

35
Q

How fast is SATA?

A

600 MiB/s

36
Q

What is the best SSD interface?

A

PCIe as it supports very long command queues

37
Q

What is the specs of Blu-ray?

A
  • Use 406nvm laser
  • 15-30GiB
  • Useful for offline storage/transfer
  • Can read at 70MiB/s
38
Q

What are optical Jukeboxes?

A
  • 100s TB per box (typically Blu-ray)
  • 6s disk change
  • 500 slots, 10 drivers
39
Q

What is the specs of magnetic tape?

A
  • Large 12TB to 36TB
  • Serial access but good for backups
  • Speed often quoted in GB/hour
  • Cheap per TByte
40
Q

What is iSCSI?

A

Internet Small Computer System Interface
- Uses tcp/ip over normal ethernet
- typically uses isolated network
- can use an offload processor card to save cpu time
- allows remote and very flexible storage arrays

41
Q

What is RAID 0 and how does it work?

A

Redundant array of independent disks
- No redundancy
- Data striped across all disks
- Increase speed
- Size is N * DiskSize

42
Q

How does RAID 1 work?

A
  • Mirrored Disks
  • Data is striped across disks
  • 2 copies of each stripe on separate disks
  • Read from either
  • Write to both - Size is size of one disk
  • Recovery is simple (swap fault disk and re-mirror with no down time)
  • Expensive
43
Q

How does RAID 5 work?

A
  • Parity striped across all disks
  • Round robin allocation for parity stripe
  • Size is (N-1)*SizeofDisk
44
Q

How does RAID 6 work?

A

Can tolerate two disk failures therefore much more reliable
Size is (N-2)*SizeofDisk

45
Q
A