Salta al contenuto
Note per Studenti Memories - ROM, RAM, SRAM and DRAM Report

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

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 kk address bits and nn outputs holds 2k2^k words of nn bits; being a truth table, a ROM is a combinational circuit.

RAM

Interface of a RAM: data input (nn bits), data output (nn bits), address (kk bits), read and write controls.

Formula (RAM capacity). Capacity is the number of words 2k2^k times the bits per word: size=2k×n\text{size}=2^k\times n bits. Addresses go from 00 to 2k−12^k-1. The number of address bits kk is independent of nn.

Example. 16-bit data lines and 10-bit address: 10241024 words of 1616 bits, capacity 1K×161\mathrm K\times16 bits =214=2^{14} bits =2=2 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 2020 ns. A write cycle of 7575 ns needs ⌈75/20⌉=4\lceil75/20\rceil=4 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 6565 ns also needs ⌈65/20⌉=4\lceil65/20\rceil=4 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 Select=0Select=0 the content is unchanged. Several cells with shared read/write logic form a bit slice: if the word select of cell ii is 0 the cell holds; if it is 1 and bit select =1=1, then Read/Write‾=0Read/\overline{Write}=0 writes the input data and Read/Write‾=1Read/\overline{Write}=1 reads the bit onto the output. Only one word select at a time may be 1.

16×116\times1 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 1616 cells can be arranged as a 4×44\times4 matrix: instead of one 4-to-16 decoder use two 2-to-4 decoders, a row decoder (A3,A2A_3,A_2) and a column decoder (A1,A0A_1,A_0); 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.

8×28\times2 chip with a 4×44\times4 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 256K×8256\mathrm K\times8 (1818 address bits) from four 64K×864\mathrm K\times8 chips (1616 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 64K×1664\mathrm K\times16 connect two 64K×864\mathrm K\times8 chips with the same addresses: the address width (16) stays, the output width doubles.

Example. 256K×8256\mathrm K\times8 from 64K×864\mathrm K\times8 chips: 256/64=4256/64=4 chips and 18−16=218-16=2 address bits for the chip-select decoder.

Useful relations. number of chips =required capacitychip capacity=\dfrac{\text{required capacity}}{\text{chip capacity}}; address bits =log⁡2(#words)=\log_2(\#\text{words}); chip-decoder bits =log⁡2(#chips in the vertical direction)=\log_2(\#\text{chips in the vertical direction}).

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 2k×n2^k\times n: kk address bits (independent of nn), nn data bits, read/write, CS. Capacity 2k×n2^k\times n bits; 1K×161\mathrm K\times16 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 ⌈75/20⌉=4\lceil75/20\rceil=4 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; 4×44\times4 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. 256K×8256\mathrm K\times8 from 64K×864\mathrm K\times8: 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).

Teoria collegata