How does data processing move data through a computer’s CPU and memory?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

In a stored-program computer, data and instructions are held in main memory as bit patterns. The central processing unit (CPU) moves and processes this information through a continuous "fetch-decode-execute" cycle, regulated by a high-frequency clock.1

The Processing Cycle

  1. Fetch: The CPU uses a program counter to identify the memory address of the next instruction, which is then retrieved from memory and stored in a register.1
  2. Decode: The CPU interprets the instruction to determine the required operation and the location of the necessary data (operands), which may reside in registers or memory.1
  3. Execute: The arithmetic-logic unit (ALU) performs the operation. Results are stored back in registers or memory, and the program counter is updated to point to the next instruction.1

Memory Hierarchy and Speed

Because main memory (RAM) is slower than the CPU, computers use cache memory—a small, high-speed static RAM (SRAM) located on the CPU chip—to store frequently accessed data and instructions, reducing latency. Modern CPUs further optimize this movement using instruction-level parallelism, such as pipelines, which allow multiple instructions to be processed simultaneously at different stages of the cycle.123