RAM with Address Control
Enhanced RAM system with address and data control switches. Advanced memory operations and data storage concepts.
Lo que aprenderás
- Decompose a RAM into address decoder + word registers + output MUX.
- Recognize that address bits drive both write-enable decoding and read-out selection.
- Calculate the components for an N-word RAM: log₂N-bit address, N-output decoder, N-to-1 read MUX.
- Apply this structure to register files and FIFOs.
- Compare gate-level RAM with monolithic RAM blocks (dense but opaque).
Cómo funciona
This circuit shows a RAM with explicit address control, exposing the address decoder and the read/write multiplexer that are usually hidden inside the RAM block. The decoder converts a binary address into one-hot word-select lines; the write path gates write-enable per-word; the read path uses an output MUX to route the selected word's data out.
For a 4-word, 4-bit RAM: - 2-bit address → 2-to-4 decoder → 4 word-select lines. - Each word is a 4-bit register with its own write-enable (decoder output AND global WE). - Output MUX is a 4-to-1 (per bit) controlled by the same address.
This decomposition makes the address-decoded write and address-driven read patterns explicit, helping you see why scaling to N words requires log₂(N)-bit addresses, an N-output decoder, and an N-to-1 output MUX (per bit).
Real RAM blocks bury these details in dedicated array structures (sense amplifiers, bit lines, row drivers), but the logical model is the same: address selects, data flows.
Pruébalo paso a paso
Configura las entradas en la simulación de arriba, lee qué debería suceder y verifícalo.
- 1Addr = 00 DataIn = 1010 WE = 1 Clock = risingEsperado:
RAM[0] = 1010Lo que verás: Decoder asserts word-0 select; combined with WE, word 0's flip-flops capture 1010. - 2Addr = 01 WE = 0Esperado:
DataOut = (whatever word 1 holds)Lo que verás: Decoder asserts word-1 select; output MUX routes word 1 to DataOut. WE low so no write. - 3Addr = 10 DataIn = 0011 WE = 1 Clock = risingEsperado:
RAM[2] = 0011Lo que verás: Different address — decoder picks word 2 — write 0011. Each address writes a separate word. - 4Addr = 00 WE = 0Esperado:
DataOut = 1010Lo que verás: Read address 0 — output reflects what was stored earlier. The previously written value is preserved.
Componentes utilizados
Aplicaciones en el mundo real
CPU register file. A 32-register file is essentially this circuit at 32 words: 5-bit address, 5-to-32 decoder, 32 4-bit registers, 32-to-1 output MUX (per bit).
Custom block-RAM design in ASICs. Logic designers building specialized RAMs (e.g., dual-port FIFOs) start from this address-decoded structure.
Educational comparison with monolithic RAM blocks. Seeing the address decoder and MUX explicit makes it easier to understand why block RAMs have specific address widths and access patterns.
FIFO buffer cells. Each FIFO entry is a register; the head and tail pointers' decoded outputs gate read/write to specific entries.
Configurable address-mapped peripherals. Each peripheral register is an addressable cell; the bus address decoder routes reads and writes to the correct register.