+---------+ +-----------------+
| | | |
| CPU | <------> | RAM |
| | | Running Program |
+---------+ | & Data |
+-----------------+
Arrows show data flow:
- CPU reads instructions and data from RAM
- CPU processes data
- CPU writes results back to RAM
- RAM temporarily holds data and instructions while program runsThis diagram shows the CPU connected to RAM, which holds the running program and its data temporarily.
Think of RAM as a workspace where the CPU keeps the information it needs right now. The CPU fetches instructions and data from RAM, processes them, and then stores results back in RAM. This back-and-forth happens very fast while the program runs.
RAM is temporary memory: when the computer turns off, everything in RAM is lost. This is why programs and files are saved to permanent storage like a hard drive.