CS132 - Memory Systems

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/97

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:28 PM on 6/4/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

98 Terms

1
New cards

List the memory hierarchy from fastest/smallest to slowest/largest.

Registers, cache, main memory, secondary storage, archival storage.

2
New cards

Why is the memory hierarchy needed?

No single memory type is fast, large, cheap and low-power at once, so frequently used data is kept in faster smaller memory.

3
New cards

What is temporal locality?

If data is used now, it is likely to be used again soon.

4
New cards

What is spatial locality?

If data at one address is used, nearby addresses are likely to be used soon.

5
New cards

What are registers?

Very small, very fast storage locations inside the CPU, used for operands, addresses and temporary results.

6
New cards

What is cache?

Fast memory between CPU and main memory that stores recently or likely-to-be used data.

7
New cards

What are L1, L2 and L3 cache?

Cache levels; L1 is smallest/fastest, L2 larger/slower, L3 larger/slower again.

8
New cards

What is cache usually made from?

SRAM.

9
New cards

What does cache being transparent to the programmer mean?

The programmer normally does not manually decide what goes in cache.

10
New cards

What is a cache hit?

The required data is found in cache.

11
New cards

What is a cache miss?

The required data is not in cache and must be fetched from a lower memory level.

12
New cards

Hit rate formula?

Hit rate = cache hits / total memory references.

13
New cards

Miss rate formula?

Miss rate = 1 - hit rate.

14
New cards

AMAT formula?

AMAT = hit time + miss rate * miss penalty.

15
New cards

What is a compulsory cache miss?

A miss because the data has never been loaded into cache before.

16
New cards

What is a capacity cache miss?

A miss because cache is too small to hold all needed data.

17
New cards

What is a conflict cache miss?

A miss caused by the cache placement strategy forcing useful data to be replaced.

18
New cards

What is a coherency cache miss?

A miss because data was changed elsewhere, so the cache copy is invalid.

19
New cards

Write-through vs write-back cache?

Write-through updates cache and lower memory immediately; write-back updates cache first and lower memory later when the block is replaced.

20
New cards

Write-through advantage and disadvantage?

Advantage: main memory stays up to date. Disadvantage: slower and more memory traffic.

21
New cards

Write-back advantage and disadvantage?

Advantage: faster repeated writes and less traffic. Disadvantage: more complex and main memory may be temporarily out of date.

22
New cards

What is main memory?

Larger, slower memory that stores programs/data not currently in registers/cache, usually DRAM.

23
New cards

What does SRAM stand for?

Static Random Access Memory.

24
New cards

What does DRAM stand for?

Dynamic Random Access Memory.

25
New cards

SRAM vs DRAM?

SRAM is faster, expensive, lower density, no refresh, used for cache. DRAM is slower, cheaper, higher density, needs refresh, used for main memory.

26
New cards

How does SRAM store data?

Using latch-like circuits, often around 6 transistors per bit.

27
New cards

How does DRAM store data?

As charge in a capacitor, usually with 1 transistor and 1 capacitor per bit.

28
New cards

Why does DRAM need refreshing?

Capacitors leak charge over time.

29
New cards

What is a memory array?

A 2D arrangement of memory cells with rows selected by addresses and columns/data lines providing word width.

30
New cards

Memory array size from address bits and width?

With N address bits and M data bits per address: 2^N rows and total size 2^N * M bits.

31
New cards

What are memory depth and width?

Depth is number of addressable rows; width is number of bits per row/word.

32
New cards

How many rows do 10 address bits select?

2^10 = 1024 rows.

33
New cards

What does a memory decoder do?

It converts address bits into one selected wordline/row.

34
New cards

What happens when you add one address bit?

The number of addressable locations doubles.

35
New cards

Why split addresses into row and column parts?

It reduces decoder complexity and can reduce external address pins.

36
New cards

A 16-bit address, 1-bit-wide memory stores how much data?

2^16 bits = 65,536 bits = 8,192 bytes = 8 KiB.

37
New cards

How do 3 extra address lines expand memory using identical chips?

Feed the 3 extra lines into a 3-to-8 decoder. Each output is a chip-select for one chip. Original address lines go to all chips; only one chip is enabled.

38
New cards

If 3 extra address lines select identical 16-bit-address 1-bit chips, total capacity?

8 * 65,536 bits = 524,288 bits = 65,536 bytes = 64 KiB.

39
New cards

How do you make 1-bit memory chips support parallel byte read/write?

Place 8 chips side by side sharing address lines. Each chip outputs one bit, giving 8 bits in parallel.

40
New cards

What is an SSD?

Solid State Drive using non-volatile flash memory.

41
New cards

What is erase-before-write in flash?

Flash is read/written in pages but erased in larger blocks, so updated data is often written elsewhere and cleaned later.

42
New cards

Name three SSD problems.

Retention loss, limited lifetime/program-erase wear, and multi-level cells being more error-prone.

43
New cards

What is an HDD?

Hard Disk Drive storing data by magnetising regions on spinning disks, read by a moving read/write head.

44
New cards

What are HDD tracks and sectors?

Tracks are circular paths on the disk; sectors are subdivisions of tracks containing data blocks.

45
New cards

Do HDDs use error correction?

Yes. Sectors usually store ECC bits.

46
New cards

What four factors determine HDD access time?

Seek time, rotational latency, settle time, and read/write time.

47
New cards

What is seek time?

Time to move the head/arm to the correct track.

48
New cards

What is rotational latency?

Time waiting for the correct sector to rotate under the head.

49
New cards

What is settle time?

Time for the head/arm to stop vibrating after movement.

50
New cards

What is read/write time?

Time to actually transfer the data once the head is positioned.

51
New cards

What is an alternative to Return to Bias magnetisation?

Transition-based recording, where changes in magnetisation represent bits.

52
New cards

Why can transition-based magnetisation be better than Return to Bias?

Transitions are easier for the read head to detect reliably than absolute magnetic direction.

53
New cards

What is noise in memory/data transfer?

Unwanted interference that can flip bits from 0 to 1 or 1 to 0.

54
New cards

What is EDC?

Error Detection Code: detects that an error occurred but cannot fix it by itself.

55
New cards

What is ECC?

Error Correction Code: detects errors and uses redundant information to reconstruct correct data.

56
New cards

Give examples of EDC.

Parity bit, checksum, CRC.

57
New cards

Give examples of ECC.

Hamming codes and Reed-Solomon codes.

58
New cards

What is a parity bit?

An extra bit added so the total number of 1s is even or odd.

59
New cards

How do you calculate even parity?

Count the 1s. Add parity bit 1 if the count is odd, or 0 if the count is already even.

60
New cards

How do you calculate odd parity?

Count the 1s. Add parity bit 1 if the count is even, or 0 if the count is already odd.

61
New cards

What can simple parity detect?

Single-bit errors and any odd number of bit flips.

62
New cards

Why can parity fail?

An even number of bit flips can leave the overall parity looking correct.

63
New cards

How can parity be checked quickly in hardware?

Use XOR gates over all data bits and the parity bit.

64
New cards

How would you store parity per byte in memory?

Add one extra parity bit per 8 data bits, so each byte needs 9 stored bits. Use XOR gates to generate parity on write and check it on read.

65
New cards

What is 2D parity?

Data is arranged in rows and columns with parity bits for each row and column.

66
New cards

Why is 2D parity better than simple parity?

It gives stronger detection and can locate/correct a single-bit error using the failing row and column.

67
New cards

What is a Hamming code?

An ECC code that adds redundant check bits so a single-bit error produces a unique syndrome identifying the faulty bit.

68
New cards

What is Hamming(7,4)?

A Hamming code with 4 data bits and 3 check bits, giving 7 bits total.

69
New cards

Parity vs 2D parity vs Hamming code?

Parity is simple detection only; 2D parity can locate a single-bit error in a block; Hamming can correct single-bit errors within a word.

70
New cards
71
New cards
What is the memory designer's dilemma?
Memory should ideally be fast, large, cheap, and low power, but no single technology gives all of these at once.
72
New cards
Why does the designer's dilemma lead to a memory hierarchy?
Fast memory is usually small and expensive, while large memory is usually slower and cheaper per bit.
73
New cards
What does cost per bit or byte mean?
How expensive it is to store each unit of data.
74
New cards
Which has higher cost per bit: cache or secondary storage?
Cache has higher cost per bit but is much faster.
75
New cards
What is access time?
The time needed to get data from a memory level.
76
New cards
What does ROM stand for?
Read-Only Memory.
77
New cards
What is ROM used for?
Data or programs that should not normally change, such as firmware.
78
New cards
Is ROM volatile or non-volatile?
Non-volatile; it keeps data when power is removed.
79
New cards
What does PROM stand for?
Programmable Read-Only Memory.
80
New cards
What is special about PROM?
It can be programmed once after manufacture, then behaves like read-only memory.
81
New cards
What does EPROM stand for?
Erasable Programmable Read-Only Memory.
82
New cards
How can EPROM often be erased?
Using ultraviolet light, then it can be reprogrammed.
83
New cards
What does EEPROM stand for?
Electrically Erasable Programmable Read-Only Memory.
84
New cards
What is special about EEPROM?
It can be erased and rewritten electrically.
85
New cards
How is flash memory related to EEPROM?
Flash memory is a common EEPROM-like non-volatile technology.
86
New cards
What is volatile memory?
Memory that loses its contents when power is removed.
87
New cards
Give examples of volatile memory.
Registers, cache, SRAM, and DRAM main memory.
88
New cards
What is non-volatile memory?
Memory that keeps its contents when power is removed.
89
New cards
Give examples of non-volatile memory.
ROM, flash memory, SSD, HDD, optical disk, and tape.
90
New cards
What is a checksum?
An error detection value calculated from data and sent or stored with the data.
91
New cards
What does a checksum mismatch mean?
An error has been detected.
92
New cards
Do checksums usually correct errors?
No, they usually detect errors rather than correct them.
93
New cards
What is a burst error?
An error where several nearby bits are corrupted together.
94
New cards
Why is simple parity weak for burst errors?
Multiple bit flips can cancel out, leaving the parity looking correct.
95
New cards
What methods are better for burst errors than simple parity?
2D parity, checksums, CRC, or stronger ECC schemes.
96
New cards
What is memory coherency?
Making sure different copies of the same data agree with each other.
97
New cards
What is a coherency miss?
A cache miss caused because cached data became invalid after another component changed the data.
98
New cards