Computer Processors: CPU Operation

Feb 8
15:47

2010

Youssef Edward

Youssef Edward

  • Share this article on Facebook
  • Share this article on Twitter
  • Share this article on Linkedin

Computer processors(CPU) are the most impotant device for the computer to work. here is an explanation on how it works

mediaimage
Computer processors (also called CPU) are the most important part in the computer at all. It controls the overall remaining components of the computer such as the mouse,Computer Processors: CPU Operation  Articles keyboard, monitors, and others. The processor is an electronic circuit that executes computer programs. It does in four basic phases:
1. Fetch: in this phase, the processor collects the bytes to execute from memory (which may be RAM or cache). Each instruction is saved in memory as one or more bytes called word. The more the word length, the more complexity and power consumption of the processor. Once the processor collects the bytes, then it is ready to decode it.
2. Decoding: In this phase, the processor takes the bytes read in the previous step and input them to the decoder. The decoder activates then the line corresponding to the instruction whose bytes equal to the bytes read from the fetching phase. Each instruction in the processor is mapped to a certain bits or bytes by the designer so that when the processor fetches these bits or bytes, it can understand them. The number of bits used to represent each instruction may vary according to the processor type. Note that this number of bits may not take the whole word in the memory. For example if the word is represented by 8 bits, then the first four bits can be assigned to the instruction part and the last four bits can be assigned to the data which is needed for the instruction to execute.
3. Executing: once the processor knows the meaning of the bits by the decoder, it goes then to the execute phase. In this phase, the processor makes the necessary operation as denoted by the decoder. This operation is done on the operand contained along with the instruction bits in the memory word.. The operation can be addition, subtraction, AND, or any mathematical or logical operation.
4. Write Back: once the processor done the operation, it writes it back to the memory in the place denoted by the instruction. This result may be fed to other instructions in the same program.
This processes are repeated for each instruction until the whole program is executed. recall that the program is composed of a series of instructions that are hold in memory. each time an instruction is encountered, the above phases are repeated for each instruction. 
Modern processors can execute these phases in parallel by techniques called parallel processing. this will allow for higher speed of execution but at the cost of the coplexity of the hardware and power consumption. parrallel processing requires to monitor processes which are executed in parallel such that they cannot alter variables at the same time. this is what is called synchronization. if two programs which are executed at the same time access the same variable it will lead to errors in the results. this is one reason that make parallel processing more complicated. In terms of programming, processes are called threading, which means that the programmer can create two blocks of instructions which are executed at the same time.

Categories: