Example: consider some computer program that has an instruction to add two numbers; this instruction, along with the other instructions of the program, is stored in main memory.
This simple example illustrates how the fetch–decode–execute cycle enables the CPU to perform even complex tasks step-by-step.
Why can't we store all of the instructions of a program directly on the CPU? Why do we use RAM?
Answer: The CPU has only several register in it, so its space is limited. Programs, especially long ones, simply won't fit into these registers, so they must be kept in a larger container: main memory.