Computer Processors - CPU Operation

The processor is an electronic circuit thatdenoted by the decoder. This operation is done
executes computer programs. It performs it inon the operand contained along with the
four basic phases:instruction bits in the memory word.. The
1. Fetch: In this phase, the processor collects theoperation can be addition, subtraction, AND, or
bytes to execute from memory (which may beany mathematical or logical operation.
RAM or cache). Each instruction is saved in4. Write Back: once the processor done the
memory as one or more bytes depending on theoperation, it writes it back to the memory in the
processor type. The more the word +length, theplace denoted by the instruction. This result may
more complexity and power consumption of thebe fed to other instructions in the same program.
processor. Once the processor collects the bytes,This processes are repeated for each instruction
then it is ready to decode it.until the whole program is executed. recall that
2. Decoding: In this phase, the processor takesthe program is composed of a series of
the bytes read in the previous step and inputinstructions that are hold in memory. each time an
them to the decoder. The decoder activates theninstruction is encountered, the above phases are
the line corresponding to the instruction whoserepeated for each instruction.
bytes equal to the bytes read from the fetchingModern processors can execute these phases in
phase. Each instruction in the processor is mappedparallel by techniques called parallel processing. this
to a certain bits or bytes by the designer so thatwill allow for higher speed of execution but at the
when the processor fetches these bits or bytes,cost of the coplexity of the hardware and power
it can understand them. The number of bits usedconsumption. parrallel processing requires to
to represent each instruction may vary accordingmonitor processes which are executed in parallel
to the processor type. Note that this number ofsuch that they cannot alter variables at the same
bits may not take the whole word in thetime. this is what is called synchronization. if two
memory. For example if the word is representedprograms which are executed at the same time
by 8 bits, then the first four bits can be assignedaccess the same variable it will lead to errors in
to the instruction part and the last four bits canthe results. this is one reason that make parallel
be assigned to the data which is needed for theprocessing more complicated. In terms of
instruction to execute.programming, processes are called threading,
3. Executing: once the processor knows thewhich means that the programmer can create
meaning of the bits by the decoder, it goes thentwo blocks of instructions which are executed at
to the execute phase. In this phase, thethe same time.
processor makes the necessary operation as