Semiconductor Memory
In questa pagina 7
In questa pagina 4
The cell
The basic element that stores one bit: it has two stable states and can be written (at least once) and read. It has a select line, a control line (read/write) and a data line.
RAM
Random Access Memory: random access for reading and writing, volatile (it loses its data without power).
Definition (dynamic and static RAM)
DRAM (dynamic) SRAM (static) cell a capacitor and an access transistor a flip-flop (typically 6 transistors) bit charge present/absent state of the flip-flop refresh needed: the charge leaks, so it must be read and rewritten periodically (every few ms) not needed while powered density and cost high density, low cost per bit low density, high cost speed slower faster use main memory cache
Example. An SRAM cell uses about transistors, a DRAM cell one transistor and one capacitor: for the same area the DRAM holds more bits.
Reading a DRAM is destructive (it discharges the capacitor) and requires the bit to be rewritten.
ROM and non-volatile memories
| Type | Writing | Erasing |
|---|---|---|
| ROM | at the factory, with the chip mask | impossible |
| PROM | once, electrically, by the user | impossible |
| EPROM | electrically | with ultraviolet light, whole chip |
| EEPROM | electrically, byte by byte | electrically, byte by byte (slow) |
| Flash | electrically | electrically, by blocks (fast) |
Uses: firmware and BIOS, microprograms, function tables, programs of embedded systems; flash is the technology of SSDs and USB sticks.
Organisation of chips
Definition (memory chip ). A chip contains words of bits: it has address lines and data lines. Internally the cells form a matrix: the address is split into row and column, decoded separately. In DRAMs row and column arrive in two steps on the same lines (signals RAS and CAS), halving the pins.
Example. A 1 MB memory, 1-byte word, built with bit chips.
- Each chip gives 1 bit: for an 8-bit word we need 8 chips in parallel, forming a bank of = 256 KB.
- For 1 MB we need banks, so 32 chips.
- Address: bits. The low 18 bits () go to all chips, the high 2 bits enter a 2-to-4 decoder that enables one of the 4 banks.
Synchronous DRAM
SDRAM works with the bus clock: after the initial address it transfers a block of consecutive data (burst) with no further waits, suited to filling a cache line. DDR transfers on both clock edges (DDR2, DDR3, DDR4, DDR5 raise frequency and data per cycle).
Errors
Permanent errors (faults) and soft errors (random, non-destructive, for example due to radiation or particles). Words are protected with check bits computed on writing and verified on reading: the Hamming code corrects a single error, and with one extra parity bit it also detects double errors (SEC-DED).
Typical mistakes
- Thinking a ROM has sequential access: it is random access like RAM, only not writable.
- Counting chips by dividing only the capacities in bytes, without considering the word width of the chip.
Versione ripasso
RAM
Volatile, random access. DRAM: capacitor + transistor, needs refresh (every few ms), dense and cheap, slower, reads are destructive; used as main memory. SRAM: flip-flop (about 6 transistors), no refresh, faster, costly, low density; used for cache.
Non-volatile
ROM (mask, never changes); PROM (once, electrically); EPROM (UV erase, whole chip); EEPROM (byte by byte, slow); Flash (erase by blocks, fast; SSDs, USB sticks). Uses: firmware, microprograms, embedded programs.
Chips
chip: address lines, data lines; row and column decoded separately (DRAM: RAS and CAS on shared pins). Example 1 MB from chips: 8 chips per bank (256 KB), 4 banks, 32 chips; 20 address bits, low 18 to all chips, high 2 into a 2-to-4 decoder.
Synchronous and errors
SDRAM bursts consecutive data (fills a cache line); DDR uses both clock edges. Errors: permanent and soft; Hamming corrects 1 error, plus parity (SEC-DED) detects 2.
Typical mistakes: ROM is random access, not sequential; count chips using the chip word width, not only capacities.