Central processing unit

From Fox Labs Wiki
Jump to navigation Jump to search

A central processing unit (CPU), also a central processor or a main processor, is the most important processor in a given computer.

Operation

The fundamental operation of most CPUs, regardless of the physical form they take, is to execute a sequence of instructions that is called a program. The instructions to be executed are stored in some form of computer memory. Nearly all CPUs follow the fetch, decode and execute steps in their operation, which is collectively known as the instruction cycle.

Fetch

The fetch step involves retrieving from memory the next instruction to be executed. The instruction's location (address) in memory is determined by the program counter (called the "instruction pointer" on Intel x86 processors). After the instruction is fetched, the program counter is incremented by the length of the instruction so that it will contain the address of the next instruction in the sequence.

Decode

The instruction that the CPU retrieves from memory determines what the CPU will do. In the decode step, performed by binary decoder circuitry known as the instruction decoder, the instruction is converted into signals that control the other parts of the CPU.

Execute

After the fetch and decode steps, the execute step is performed. Depending on the CPU architecture, this may consist of a single action or a sequence of actions. During each action, control signals electrically enable or disable various parts of the CPU so they can perform all or part of the desired operation. The action is then completed, typically in response to a clock pulse. Very often, results of an operation are written to an internal CPU register for quick access by subsequent instruction.

Template:Basic computer components

Template:Electronic components