Back

Common CPU components and their function

 Introduction
The Central Processing Unit, or CPU, is the central part of a computer, the brain that does all of the computations. Because the CPU performs many different functions, you need to divide it up into its main parts to understand it. Only then can you successfully describe what it does.

 There are four component parts that need a mention. These are:

    1. The Arithmetic Logic Unit (known as the ALU).
    2. The Control Unit.
    3. The Registers.
    4. The Immediate Access Store or IAS, and cache. This is where all the programs we are currently using, and all the data we currently need is held and is very important. You will hear the IAS called other names, including the memory, main memory, memory unit, Random Access Memory, RAM and primary memory). Some authors treat the IAS as part of the CPU and show it as such. Others treat it as a separate component which 'talks' to the CPU. Either way, the other components in the CPU (the ALU, the Control Unit and the Registers) will be reading from and using data held in the IAS, and will be writing data back to the IAS. We will treat the IAS as part of the CPU.

CPU

The ALU
The Arithmetic Logic Unit is that part of the CPU that does all the calculations. It has electronic circuits that can manipulate data in various ways. It has three main functions.

    1. It can perform arithmetic calculations on data. For example, it can add and subtract two numbers together or multiply and divide numbers (in binary, of course).
    2. It can perform logical operations on data. These are computations that involve, for example, the use of AND, OR and NOT.
    3. The third job of the ALU is to hold data it has already worked on, ready to be sent out, and to hold data that has been fetched, ready to be processed. All data that goes into and out of the CPU goes via the ALU. The ALU acts like a revolving door for data, letting data pass in as well as out of the CPU.

The ALU, then, performs arithmetic and logic calculations and acts as a 'revolving door' for data going into and out of the CPU.

The Control Unit
This part of the CPU is responsible for managing how instructions are executed. It has some very important jobs to do! It is in charge of fetching instructions and data from wherever they are stored in the memory unit. It does this by sending control signals at the right time to various parts of the computer that then access the correct memory unit location and retrieve the contents of that location. Its next very important job is to interpret, or 'decode', an instruction so that it knows what has to be done. It has a special piece of equipment called an 'instruction decoder' to do this. Once it has done this, it can then execute the instruction. It can send signals to all the different parts of the CPU telling them what to do and when.

Any program you write or application you run is made up of a sequence of instructions. When you 'run' a program, it is the control unit that is fetching, then decoding and finally executing every instruction, one after another. Unsurprisingly, this is known as the 'fetch-decode-execute cycle' and is dealt with in another section.

Registers
No discussion about a CPU would be complete without mentioning the role of 'registers'. The registers are an integral part of the CPU. They are a type of memory that can be accessed very quickly compared to other types of memory. The pieces of information they hold are needed by the CPU to run each program instruction during a 'fetch-decode-execute cycle' (more on this in another section) or they can be used to hold values that are generated as part of the ALU working on data. There are a number of very special registers that do very specific jobs and again, these will be dealt with in detail in another section.

Immediate Access Store (IAS) - commonly called RAM
The IAS (synonyms include memory, main memory, memory unit, Random Access Memory, RAM or primary memory) is the place where programs and the data that is needed by programs are held, ready to be fetched then decoded and executed by the CPU. The CPU may also use this place to store the results of any processing it does. It can be thought of as made up of lots of individual 'memory' locations, each capable of storing a byte of data. When you open an application, the application is typically moved from storage on your hard disk into the IAS, ready for the CPU. When you open a file, it is also moved from a storage device into the IAS. When you save work, on the other hand, it's moved from the IAS back into a storage device, such as your hard drive. It's important to remember that the operating system, the programs you are currently using and any data you are currently using are worked on by the CPU from the IAS, not from storage. The CPU does not work directly with storage devices, only the IAS.

Cache
This is an area of super-fast memory. You can think of it as sitting between the CPU and the RAM. Rather than fetching parts of a program currently being used, or fetching frequently used data from RAM, they could be put into the computer's cache and then fetched from there. Why? Because reading from cache is so much faster than reading from RAM. It speeds up processing time - your computer goes faster. Unfortunately, cache is much more expensive than RAM and computers usually have a limit on how much cache you can install. Nevertheless, another way to improve your computer's performance and therefore it's speed is to see if you can install some more cache memory.

Understanding how the CPU works, registers and low-level programming.
There are some excellent simulations, such as the Little Man Computer and SimCom available on the Internet to help you understand how programming (the software) works with the CPU, RAM and the registers (the hardware). Do a search for these and try them out. YouTube has some excellent help on the Little Man Computer.

Back