
Registers, cache, and main memory keep instructions and data close to the processor. Their capacities, costs, and response times differ. The memory hierarchy balances those differences so the CPU can work quickly without using expensive memory for everything.
1. Internal memory
1.1. The memory hierarchy

Registers are closest to the CPU’s execution units. Cache holds copies of recently or frequently used data. Main memory holds the programs and data in active use. An SSD or hard drive provides more persistent capacity, with much higher access latency.
1.2. Registers
Registers hold values the CPU is working on, including operands, addresses, and control information. The instruction pointer, for example, identifies where execution should continue.
1.3. Cache

When data is already cached, a cache hit avoids a slower main-memory access. L1 is generally small and fast. L2 is larger, and L3 is larger still and often shared among cores. The exact layout depends on the processor.
1.4. Main memory
RAM holds active instructions and data. Most main memory uses DRAM, which must be refreshed while powered. It loses its contents when power is removed. Compare capacity, supported memory generation, channel configuration, data rate, and latency when choosing modules.
2. Memory types
2.1. SRAM
Static RAM keeps its state while powered without periodic refresh. Its relatively large cells are costly per bit, so it is commonly used in processor caches.
2.2. DRAM
Dynamic RAM stores bits as charge that must be refreshed. Its higher density makes it suitable for main memory.
2.2.1. DRAM generations
SDRAM synchronizes transfers to a clock. DDR SDRAM transfers data on both clock edges. DDR, DDR2, DDR3, DDR4, and DDR5 have different electrical and physical requirements. Use the generation and module form factor listed in the motherboard manual.
2.2.2. Latency, clock rate, transfer rate, and bandwidth
MHz measures clock cycles per second. MT/s measures transfers per second. A DDR4-3200 module transfers at 3,200 MT/s with a 1,600 MHz interface clock. A 64-bit data path carries 8 bytes per transfer, so its theoretical bandwidth is 25.6 GB/s. A CAS latency of CL16 at a 1,600 MHz clock corresponds to about 10 ns. Those figures describe different things: throughput and the time to begin a particular operation.
2.3. RDRAM
Rambus DRAM was used in some older systems. It uses a different interface and cannot be substituted for DDR memory.
2.4. VRAM
Graphics memory stores textures, frame buffers, and data used by the GPU. Dedicated graphics cards often use GDDR memory. Some accelerators use high-bandwidth memory, while integrated graphics commonly share system RAM.
2.5. ECC memory
Error-correcting code memory can detect and correct certain errors. The supported correction scheme depends on the system. Check the processor, motherboard, and module together. On-die error correction does not by itself provide the same protection as system-level ECC.
2.6. ROM, PROM, EPROM, EEPROM, and flash
| Type | How it is written or erased |
|---|---|
| ROM | Written during manufacture in mask ROM. |
| PROM | Programmed once after manufacture. |
| EPROM | Erased with ultraviolet light and then reprogrammed. |
| EEPROM | Erased and rewritten electrically. |
| Flash | A form of EEPROM whose erase operations work on blocks. Used for firmware and storage. |
3. Newer memory technologies
High-bandwidth memory stacks memory dies to provide a wide interface. Nonvolatile approaches such as MRAM and resistive memory explore different trade-offs between endurance, cost, data retention, and speed. Whether they replace a memory tier depends on the workload and design.
4. Practice exercises
4.1. Install a RAM module
Open Eniun PC Lab in English and locate the memory slots. Use the motherboard instructions to choose slots, identify the keyed notch, and confirm the module is fully seated.
4.2. Check your understanding
Why would a system with sufficient RAM still benefit from a larger CPU cache?
A larger cache may keep more frequently accessed data close to the CPU and reduce trips to main memory.
4.3. Investigate a slower computer after a RAM upgrade
Solve the case of the computer that slowed down after its memory was doubled in Eniun Casos. Compare the channel configuration, effective transfer rate, and workload before deciding whether capacity explains the result.