If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Computer memory

When input devices send binary data to a CPU, it immediately stores that data in memory to make it easier to process.
Let's say we ask a computer to add 2 + 4. Here's what it will do:
  • Store 2 (0010) and 4 (0100) in memory
  • Use a circuit in the CPU to calculate the result
  • Store 6 (0110) in memory
Since the CPU is constantly using data from memory, they're connected via a memory bus, a high speed communication transfer system, typically made from wires, conductors, or optical fibers.
Illustration of the communication between CPU and memory, with a CPU on the left and memory on the right. A bidirectional arrow flows between them with binary data.

Memory size

Memory is designed for fast access and typically stores only the data and instructions that are necessary for the currently running programs on a computer.
Computer memory isn't infinite, so there's a limit to how much data we can input before we overflow the memory. Computers also vary a lot in memory size, usually because of physical size constraints. A desktop computer can remember more than your phone, but your phone can remember more than the Raspberry Pi.
🔍 How much memory does your computer have? Most computers make it easy to find out.
My own MacBookPro has 16 GB of RAM, which is more than enough for my needs:
Screenshot from MacBookPro with overview of the computer specifications. Includes a line that says "Memory: 16 GB 1600 MHz DDR3".

Memory types

This type of memory, also called main memory or RAM (Random Access Memory), is only used for temporary storage of data. When you restart a computer, it typically wipes the memory entirely. Memory wouldn't be a good place to store data for later, like files and programs.
Computers store long-term data in a different type of memory: external memory or secondary storage, like a hard drive or USB drive. We'll learn about that next.

🙋🏽🙋🏻‍♀️🙋🏿‍♂️Do you have any questions about this topic? We'd love to answer— just ask in the questions area below!

Want to join the conversation?