CPU

What Does The Central Processing Unit Do? by Andrew Josephides The Central Processing Unit, also known as CPU or processor, is a part of a computer that does all the calculations necessary to operate and run programs. The basic operation of most CPUs, is to execute a sequence of stored instructions called a program. The CPU has 4 main steps it takes during its operation. These main steps are fetch, decode, execute, and write back.

During the first step the processor has to “fetch” instructions from the program memory. The memory may be in ROM (Read-Only memory) or in RAM (Random Access Memory). 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) or the Program Counter (PC). Once an instruction has been fetched, the IP is moved forward in memory to point to the next instruction to be fetched.

The second step, decode, is when the processor analyzes the instruction that has been fetched. The instruction is broken down into small parts and dispersed to different parts of the processor to be prepared to execute.

During the third step of the processors operation it has to execute the instructions that it has just broken down. Various parts of the CPU are connected and communicate with the Arithmetic Logic Unit (ALU). The ALU will now calculate the addition or subtraction problem and store it in the registers.

During the final step of the operation the processor will now “write back” the results from the execute stage. The CPU will take the information from the registers and copy it over to an address in the memory that it will overrule any previous information stored there.