Short-Term Memory

The CPU executes the instructions, and random access memory (RAM) is the place where instructions wait to be executed. Think of it as short-term memory. If I told you how to build a paper airplane, my instructions couldn’t be stored in your hands, even though your hands are actually executing my instructions. Instead, the instructions are kept in your short-term memory and executed by your hands one at a time. RAM also stores any data, such as variables, that is relevant to the program’s execution. We discuss this application of RAM in further detail in Chapter 5, “Data (Types), Data (Structures), Data(bases).”

If you’re like me, you can hold about four instructions in your head at once, and you probably ask for these instructions ...

Get Learning to Program now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.