S-RAM(MB): expensive, big, fast, used in cache D-RAM(GB): cheap, small, slow, main memories, frame buffers
Synchronous D-RAM: switch to use clock signal
Double Data-rate ynchronous D-RAM (DDR SDRAM): double edge clocks send 2 bits per cycle per pin (DDR = 2 bits, DDR2 = 4 bits, DDR3 = 8 bits, DDR4 = 16 bits) - standard in servers and laptop (i7 support DDR3 and DDR4)
Reading
1-a: Row access strobe (RAS) select row 2
1-b: Row 2 copied from DRAM to row buffer
2-a: Column access strobe (CAS) select column 1
2-b: Supercell of size (2, 1) copied from buffer eventually to CPU
2-c: Row buffer copied to DRAM to provide refresh
3: Continue copy to buffer and do its refresh as normal (if you access the next thing that will refresh, code can run faster because it does not disrupt normal refresh schedule)
64MB memory module has 8x 8M DRAMs to provide 64 bits data in parallel
Principle of Locality: programs tend to use data and instructions with address near or equal to those they have used recently
Temporal locality: recently referenced items are likely to be referenced again in the near future
Spatial locality: items with nearby address tend to be referenced close together in time
Cache (L1, L2, L3): usually made of S-RAM, usually in CPU core, to provide fast cache from D-RAM.
...
Cold (compulsory) miss: when starts empty, first reference to the block (nothing in the cache right now)
Capacity miss: when working set is larger than the cache (no enough cache space to store all needed data for a program, cache is full and your data is not here)
Conflict miss: when multiple objects all map to the same level k block (hash collision: block i
at Lk+1
must be placed in block i mod 4
at Lk
, referencing blocks 0, 8, 0, 8,...
will miss every time)
Capacity: maximum number of bits that can be stored.
Recording density (bits/in): number of bits that can be squeezed into a 1 inch segment of a track.
Track density (tracks/in): number of tracks that can be squeezed into a 1 inch radial segment.
Areal density (bits/in2): product of recording and track density.
Seek Time (moving head): 3-9 ms
Rotational Latency (rotating disk): 4 ms
transfer time = 0.02 ms
average time = 13 ms (first bit is expensive, the rest are free)
Reading a Disk to Memory:
interrupt
notification to CPUWriting to a Disk from Memory:
Non-volatile: retain value even if powered off
ROM stores: BIOS, controllers for disks, network cards, graphic accelerators, security subsystems
SSD
Disk Cache (for accumulating read/write commands to make disk faster)
Types of Non-volatile
Read-only Memory (ROM): programmed during production, usually launching OS
Electrically erasable PROM (EEPROM): ...
Flash Memory: EEPROMs, with partial (block-level) erase capability (only 100,000 erasing)
3D XPoint (Intel Optane) & emerging NVMs (New materials)
Solid State Disk (SSD)
read / write in unit of pages (512 KB ~ 4 KB)
pages can be written when its block (32 ~ 128 pages) has been erased (a long time like 1ms)
advantage: faster, less power, no head crash
disadvantage: wear out faster (mitigated by "wear level logic" in flash translation layer)
Table of Content