What is RAM and how does it work?
The fast workspace behind a running device
RAM stands for Random Access Memory. It holds the variables, intermediate results and temporary data a computer or controller needs while it is running. Conventional DRAM and SRAM are volatile: their contents cannot be relied on after power is removed.
Think of RAM as a workbench and persistent storage as the shelves beside it. The workbench keeps current jobs within easy reach; the shelves hold material for later. This describes their roles, not a rule that every device must copy its entire program into RAM.
Random access means choosing an address
The word “random” does not mean the processor selects data by chance. It can access a chosen address without reading every earlier address first. After reading address 100, it can request address 900 directly. Actual access time still depends on the memory technology, caches, controller and other activity.
For a write, the memory interface receives the address, data and control information needed to store a value. For a read, it selects the requested location and returns its contents. A controller coordinates timing, and the interface may be parallel or serial. RAM describes an access method; it does not specify one connector or bus.
Consider a simplified temperature controller. A measurement of 25 is stored in a RAM variable and compared with a limit. When the next reading is 26, the program updates that variable. The previous reading has been replaced, not automatically archived. Keeping a history requires a separate logging process.
Two common ways to hold a bit
| Property | DRAM | SRAM |
|---|---|---|
| Storage mechanism | A typical cell uses a transistor and a capacitor. | A transistor circuit holds a stable logic state. |
| Refresh | Periodic refresh is needed because stored charge leaks away. | No periodic refresh is needed while the supply remains valid. |
| Typical role | High-capacity main memory in computers. | Processor caches, microcontroller variables and data buffers. |
| Without power | Does not provide persistent storage. | Does not provide persistent storage. |
“Static” in SRAM does not mean nonvolatile. See the DRAM and SRAM comparison for a closer look. DDR4 and DDR5 belong to the synchronous DRAM family. Double data rate means transfers occur on both edges of the clock signal; DDR4 and DDR5 are not interchangeable modules.
Working memory is different from stored firmware
Traditional ROM holds fixed instructions or data. Modern devices often use rewritable Flash or EEPROM for firmware and settings. NOR and NAND Flash suit different jobs; a suitable system can execute instructions directly from NOR Flash. RAM gives the running application a place to read and update working data.
There are also exceptions to the everyday association between RAM and volatility. NVRAM covers solutions that retain data, while technologies such as FRAM and MRAM provide nonvolatile storage. Those capabilities should never be assumed for an ordinary computer DRAM module.
What this means on the factory floor
A PLC needs working memory for input states, calculations and variables. A production counter that must survive a power failure needs an explicit retention arrangement. The scope of “retain” or persistent variables depends on the controller, configuration and storage method. A larger RAM specification alone says nothing about whether that counter will survive a shutdown.
A datalogger may collect measurements in a RAM buffer before committing them to persistent storage. This supports live monitoring, but uncommitted readings can be lost when power fails. When checking logging capacity, ask separately about buffer space and retained records. On a SCADA workstation, displays, communication tasks and analysis also consume working memory.
Capacity is only one part of performance
Capacity, bandwidth and latency answer different questions. Capacity is how much data fits, bandwidth is how much can be transferred per unit of time, and latency is the wait for access. A computer short of RAM may page data to storage and slow down. An embedded system may instead encounter allocation failures or buffer overruns. Adding capacity to a system that already has enough does not automatically make its processor faster. Consider the capacity and speed trade-off alongside memory power consumption.
