What Is a CPU?

A Guide to CPUs and their Operation for Beginners

© Andy Coates

A beginners guide to the CPU and a brief description of its operation.

At the heart of all modern computers is a device known as a CPU. But what is a CPU, and what does it do?

What Is a CPU?

CPU stands for “Central Processing Unit”, and may sometimes be referred to by the term “processor”. A CPU consists of one or more electronic components that control the operation of a computer by following instructions and manipulating data.

Physically, a CPU was the size of a small room in the early days of computing, but now it can be implemented on a piece of silicon no bigger than a thumbnail. Today’s CPUs are usually microprocessors, with all the necessary components in a small package a few centimetres to each side.

A CPU consists of several units, including the Arithmetic and Logic Unit (ALU), local storage for intermediate results (registers), a control unit, and possibly a cache to speed access to memory.

Inside a computer, the CPU is connected to the computer’s memory, disk drives, graphics cards and other devices by dozens of tiny wires. These wires are arranged into what is known as “buses” and each device is plugged into the bus that is appropriate for that device.

CPU Operation

Whilst computers seem to be able to perform amazing feats of maths, solve complex problems or play realistic video games, the CPUs that control them do all of this by following a simple procedure repeatedly. This procedure is known as the fetch-execute cycle;

Fetching an Instruction

The CPU fetches its instructions from the computer’s memory. The memory may be in ROM (Read Only Memory) or in RAM (Random Access Memory) into which it must have been initially loaded from another device, such as a hard disk. The CPU maintains a counter internally of which instruction is to be fetched the next time an instruction is requested. This counter is known as the Instruction Pointer (IP). Once an instruction has been fetched, the IP is moved forward in memory to point to the next instruction to be fetched.

Decoding an Instruction

Once the instruction has been fetched, it must be decoded to determine what it is the instruction is intended to do.

Fetching Data

Part of the instruction that has been fetched may refer to one or more items of data held in the computer’s memory. The data is retrieved by using the “address” of the data that was given as part of the instruction. The data is copied from memory into a small area of local storage held on the CPU itself. This storage is known as a register. There may be up to several hundred registers in a modern CPU, depending upon the design.

Execute the Instruction

Once the instruction has been decoded and any necessary data has been obtained, the instruction can be executed. The instruction may perform arithmetic on the data held in one or more registers, make a decision about the data held in a register or change the Instruction Pointer so a different instruction from the one in sequence will be executed next. An instruction may also just simply move data from one storage area to another.

Storing Data

Once the instruction has completed, any data that may have been changed by the instruction is copied from the register(s) to an address in memory where it will overwrite any value previously stored there.

By cycling through this simple fetch-execute cycle rapidly, a CPU and the computer it controls can become a powerful tool, performing complex tasks that 50 years ago would have seemed impossible, but which users now take for granted.

Source: MIT OpenCourseWare


The copyright of the article What Is a CPU? in Computer Hardware/Accessories is owned by Andy Coates. Permission to republish What Is a CPU? must be granted by the author in writing.




Post this Article to facebook Add this Article to del.icio.us! Digg this Article furl this Article Add this Article to Reddit Add this Article to Technorati Add this Article to Newsvine Add this Article to Windows Live Add this Article to Yahoo Add this Article to StumbleUpon Add this Article to BlinkLists Add this Article to Spurl Add this Article to Google Add this Article to Ask Add this Article to Squidoo