Memories - ROM, RAM, SRAM and DRAM
In questa pagina 3
A memory is a set of cells storing bits, with the circuitry to move information to and from the cells. In a computer it holds instructions and data. Moving new data into the memory is writing, moving stored data out is reading. Information is organised in groups of bits called words (usually multiples of 8). A memory can be stand-alone (a chip of its own) or embedded in a larger chip.
Classification
- By read/write capability: read-only memories (ROM and programmable variants PROM, EPROM, EEPROM, Flash, see Programmable Logic Devices - ROM, PLA, PAL and FPGAProgrammable logic devices (PLD) have logic structures configurable by the manufacturer or the user, which is hardware configuration and not software programming. ROM: 2^k words of n bits, a decoder followed by programmable ORs, so a physical truth table; PLA: programmable AND and OR arrays with product terms shared between outputs; PAL: programmable ANDs and fixed ORs, no sharing; FPGA: programmable logic blocks with look-up tables and flip-flops, programmable routing and I/O, with a volatile or non-volatile configuration memory. Programming is irreversible (fuse, anti-fuse, mask) or reconfigurable (SRAM, floating gate).Programmable Logic Devices - ROM, PLA, PAL and FPGA →) and read/write memories.
- By access:
- RAM (Random Access Memory): every bit takes the same effort, whatever the order of accesses (SRAM, DRAM);
- SAM (Serial Access Memory): reaching a bit requires scanning data, so time depends on position (magnetic tape, CD); consecutive locations are faster than arbitrary addresses;
- hybrid access: whole portions (blocks, sectors, pages) are accessed, as in Flash.
- By volatility: volatile (SRAM, DRAM lose data without power) and non-volatile (Flash, ROM).
Characteristics: capacity; speed (random access time in ns, or sequential throughput in Mbit/s); power consumption; retention (how long data last); endurance (number of erase/program cycles).
A ROM with address bits and outputs holds words of bits; being a truth table, a ROM is a combinational circuit.
RAM
Interface of a RAM: data input ( bits), data output ( bits), address ( bits), read and write controls.
Formula (RAM capacity). Capacity is the number of words times the bits per word: bits. Addresses go from to . The number of address bits is independent of .
Example. 16-bit data lines and 10-bit address: words of bits, capacity bits bits KB. A word is read or written in parallel on all its bits, as a unit (the minimum addressable quantity).
Operations.
- Write: apply the word address, apply data to the data inputs, activate write.
- Read: apply the address, activate read.
- A Chip Select (CS) signal enables the chip for read and write. Control signals are normally supplied by the CPU.
Timing example. CPU clock period ns. A write cycle of ns needs clock cycles: at the first edge supply the address and memory enable; at the second activate write and supply the data (activating write before the address is stable would write wrong locations); address and data must stay stable beyond the write edge. A read cycle of ns also needs cycles: at the first edge supply the address and activate enable and read; after the access time the memory presents the data; at a later edge the CPU copies it into one of its registers.
SRAM and DRAM
- SRAM (Static RAM): bits are in bistable elements (latches): the information stays valid as long as power is applied, with no external action.
- DRAM (Dynamic RAM): the information is the charge on a capacitor, accessed through an n-channel MOSFET; the capacitor leaks, so periodic refresh (rewriting) is needed.
SRAM is simpler to use (no refresh) and faster; DRAM has lower consumption, takes less area and so costs less per bit. Typical use: SRAM for the cache (very fast, density matters little), DRAM for main memory.
SRAM cell and bit slice
The cell is modelled by an SR latch (Sequential Systems - State, Latches and Flip-FlopsA sequential circuit has outputs that depend on the inputs and on the state held in memory elements; it is a combinational network with flip-flops in a feedback loop, where present state is the flip-flop outputs and next state is their inputs. Synchronous circuits update only on the clock edge. The SR latch (NOR) sets, resets, holds, and forbids S=R=1; the D latch is transparent while C=1; the edge-triggered D flip-flop is two D latches in cascade (master-slave) and samples D only on the active clock edge, with Q(t+1)=D(t).Sequential Systems - State, Latches and Flip-Flops →) whose state is the stored bit; Set and Reset are enabled by a Select signal: with the content is unchanged. Several cells with shared read/write logic form a bit slice: if the word select of cell is 0 the cell holds; if it is 1 and bit select , then writes the input data and reads the bit onto the output. Only one word select at a time may be 1.
SRAM chip and coincident selection
A 4-to-16 decoder generates the word-select lines from the address bits (one active). A three-state buffer at the output, driven by Chip Select, connects the output to the data line or leaves it disconnected, in high impedance (Hi-Z).
The same cells can be arranged as a matrix: instead of one 4-to-16 decoder use two 2-to-4 decoders, a row decoder () and a column decoder (); the selected cell is at the intersection (coincident selection). This gives smaller decoders (fewer or narrower ANDs) and a better chip shape, hence faster access.
chip with a array: the column-decoder outputs drive the bit select of two bit slices, so one address bit less is needed and 2 bits are read/written together.
Arrays of chips
Property (array of memory chips). If the memory required is larger than one chip, build an array.
- More words: for ( address bits) from four chips ( address bits), feed the 2 extra address bits to a 2-to-4 decoder that enables (Chip Select) one of the 4 chips. On read, the 8-bit bus carries the selected chip's data, while non-selected outputs are in high impedance.
- More bits per word: for connect two chips with the same addresses: the address width (16) stays, the output width doubles.
Example. from chips: chips and address bits for the chip-select decoder.
Useful relations. number of chips ; address bits ; chip-decoder bits .
Versione ripasso
- Classification: read-only (ROM family) or read/write; RAM (random), SAM (serial; consecutive locations faster) or hybrid (Flash, by blocks); volatile (SRAM, DRAM) or non-volatile (Flash, ROM). Parameters: capacity, access time or throughput, power, retention, endurance. A ROM is combinational.
- RAM : address bits (independent of ), data bits, read/write, CS. Capacity bits; has 10 address bits and is 2 KB. Write: address, data, activate write (address stable first). Read: address, read, data after access time. Cycle of 75 ns at 20 ns clock needs cycles.
- SRAM: latch cells, fast, no refresh, used for caches. DRAM: capacitor plus MOSFET, refresh needed, denser and cheaper, used for main memory.
- Organisation: bit slice with shared logic, only one word select active; tri-state output (Hi-Z) controlled by CS; matrix uses two 2-to-4 decoders (row and column, coincident selection) instead of one 4-to-16.
- Arrays: more words, extra address bits to a decoder driving CS (outputs of unselected chips Hi-Z); more bits, chips in parallel with the same addresses. from : 4 chips, 2 extra address bits.
- Mistakes: tying address bits to word width; saying SRAM needs refresh or forgetting DRAM's; thinking a ROM is sequential; assuming unselected chips output 0 (they are Hi-Z); equating RAM with volatile (Flash is non-volatile).