CPUs

From CompSciWiki
Jump to: navigation, search

COMP1260 > System Software



Introduction

Of all the electrical components residing in your computer, the CPU is likely the most important. CPU stands for central processing unit (or "Processor" for short). As the name suggests, its job is to process instructions. This is the most vital role of all hardware in your computer, as the CPU's ability to process instructions is what makes your computer what it is. Ironically the CPU is also one of the smallest major components in your computer, with many modern CPUs comparable in size to a soda cracker.

 

...by students

If you are interested in building computers from their components, you might be interested to know that the CPU is the trickiest part to replace. This is due to the thermal paste that must be applied to it's surface, and the large heat sink and fan that must be mounted above it. The first time I attempted to remove a CPU, I asked my father for help getting the cooling mechanism off. The night ended with him gashing my motherboard with a fork many times. I learned that Motherboards are surprisingly durable, and planned to avoid retesting that theory in the future.

Looks like a soda cracker, right?

CPU design

The CPU receives commands and executes them, but how is this done?

Essentially all software that runs on your computer feeds the CPU instructions. What may be a bit trickier to understand is that all program instructions boil down to a set of commands the CPU recognizes. To the CPU, these basic commands are actually a series of electrical signals we interpret as ones and zeroes. Furthermore, these commands are all basically arithmetic operations and shifts(pushing all ones and zeroes left or right in a series).

Arithmetic Logic Unit

It is possible to conceptualize a CPU as a really fast calculator that accepts operands and arithmetic operators, spitting out results lightning fast and if necessary, storing them to memory for later use.

The mathematical operations take place in a section of the CPU named the ALU(arithmetic logic unit). This portion of the CPU is implemented through cleverly placed electrical AND and OR gates. Gates can be defined as electrical components in a circuit that receive and transmit electrical signals, the output of which is determined by the input. For example an AND gate receiving two ones will produces another one, wheres as the same gate receiving a one and a zero will produce a zero. A particular arrangement of these gates will give the ALU the ability to add and subtract, as well as many other useful operations.

CPU Clock

All CPUs employ a clock function that regulates the processing of all commands. Because all commands are executed using circuitry, one command cannot start until the previous is completely finished or stored. In order to maintain a smooth flow of instructions and keep temperatures normal, the clock will be set to specific frequency in the factory it is manufactured. Modifying the clock rate is possible in order to increase performance of the CPU, at the cost of heat production and sometimes system stability. Often called "overclocking", increasing a CPU's clock speed is not recommended unless you are familiar with it.

Optimization techniques

While all CPUs fulfill their roles as the mathematical brain of the computer, nothing is ever as simple as it seems. Many advanced techniques are employed inside of CPUs to increase their speed and their ability to execute more instructions at once.

Pipelining, is one such technique that is used to concurrently execute multiple commands on one CPU, effectively multiplying it's speed.

Many modern CPUs also contain multiple cores, allowing a CPU to execute two streams of instructions at once, while splitting it's resources for each in half. Since many systems today are constantly running dozens of processes, splitting the CPU like this can produce desirable effects.

CPU measurements

Due to its circuit implementation, a modern CPU is very fast, at least three orders of magnitude faster than modern memory[1].

When shopping for a CPU, the most common indicators for performance are the clock rate and the cache size. Cache size is often measured in MB(Megabytes), and clock rate in GHz(Gigahertz). Often the higher the numbers yield higher performance, though having multiple cores will yield a lower GHz rating due to the division of the CPU's resources. Most importantly, be sure to get a CPU that matches your motherboard's socket type. If the socket types do not match then your CPU will not fit in your system.


References

  1. Anastassia Ailamaki, Carnegie Mellon University (joint work with David DeWitt and Mark Hill at the University of Wisconsin-Madison) 2001: A Storage Model to Bridge the Processor/Memory Speed Gap Available from:[Carnegie Mellon] Accessed: 28 November 2008

Further Readings

[Wikipedia]
[ComputerHope]

Previous Page: External Storage

Next Page: RAM