🎮 Interactive

How Does a Processor Work?

Fetch, decode, execute: billions of times a second

🎮

Loading…

Summary

A processor is a machine that reads the instructions in memory one by one and carries them out. For every instruction it repeats the same three steps: it fetches the instruction from memory, decodes which instruction it is, and executes it. The program counter holds the address of the next instruction; instructions are very simple jobs such as adding numbers, reading data from memory, writing to memory or jumping to another part of the program. Complex programs come from billions of these simple instructions running one after another.

In depth

Almost every computer today follows the layout John von Neumann described in 1945: instructions and data sit in the same memory, both simply as numbers. The processor fetches the byte at the address the program counter (PC) points to, over the address and data buses, into the instruction register (IR), and increases the counter by one. The control unit decodes the byte's opcode and decides which paths to open. In the execute phase the arithmetic logic unit (ALU) adds or subtracts, and the result is written to a register or to memory; jump instructions change the counter's value to build loops and decisions. Real processors run this cycle billions of times a second and handle many instructions at once in different phases.

#processor#machine code#fetch-decode-execute#von Neumann#ALU#memory

Rate How Does a Processor Work?

What did you think of this content? Click the stars to leave your rating.

Not rated yet

Comments

0

Leave a Comment and Rating

Sign in to comment and rate. Membership is free.

Loading comments...