Cpu
Cpu
Cpu
As you can see in the above picture, the CPU chip is usually in the shape of a square or rectangle
and has one notched corner to help place the chip properly into the CPU socket. On the bottom
of the chip are hundreds of connector pins that plug into each of the corresponding holes in the
socket. Today, most CPU's resemble the picture shown above. Over the years, there have been
dozens of different types of sockets on motherboards. Each socket only supports specific types of
A CPU has four primary functions: fetch, decode, execute, and writeback.
Fetch
In the first step, the CPU retrieves the instruction that it needs to run from program memory.
Each instruction in a program (which contains millions of instructions) is stored at a specific
address. The CPU has a program counter, which keeps track of the CPUs position in the
program more specifically, the address of the instruction that the CPU is accessing.
Decode
For this step, its important to know that no matter what code a program is written in, the
compiler for that specific language breaks the code down to Assembly Language. Assembly
language is a language that the CPU understands, but may vary between different CPUs. From
there on, an assembler translates Assembly Language into binary code, which the CPU can
manipulate to execute the instructions it is given.
Execute
Based on the instructions it is given, the CPU can then do one of three things:
1) Using its Arithmetic Logic Unit (ALU), the CPU can calculate extremely complicated
mathematical functions;
2) Move data from one memory location to another;
3) Jump to different addresses in the program based on decisions made by the CPU itself.
The diagram above shows the setup of an extremely simple microprocessor capable of
performing these actions.
Writeback
Typically, each of the actions taken by the CPU produces some sort of output. The CPU takes
this output and writes it into the computers memory. For example, if a program wanted to
execute the first item of the list above on two operands, 3 and 5, the output, 8, would be written
back into a specific address. However, for the 3rd bullet, the program counter (which, as stated
above, is used to keep track of the CPUs progress through a program) simply changes to reflect
the start of the next set of instructions.
When these four steps have been completed, the Program Counter moves onto the next
instruction and repeats the entire process again, until the termination of the program.
Another important component of a CPU is called the clock. The clock produces a signal that
acts to synchronize the logic units within the CPU as they execute the instructions given in a
program. In the diagram above, the purple line represents the signal of a clock as it is being
inputted into a logic unit. For every time the line goes from low to high, and back to low (one
cycle), an instruction is carried out.
Thus, the CPU Clock speed refers to the number of times that a CPUs clock cycles per second.
Typical computers have a clock speed around 2.8 GHz (Gigahertz), which means that the clock
cycles 2.8 billion times a second, and executes an equivalent number of instructions.