CPU stands for Central Processing Unit. The CPU is like a really powerful calculator, being able to calculate billions of transactions per second.
Intel and AMD are the dominant CPU manufacturers.
Mike Meyers likes to equate the CPU to a man in a box. The man in the box can perform calculations (add, subtract, mulitiply, divide) very quickly. But since he’s in a box, there’s no way to communicate with him. So a system is created called the external data bus to allow for communications.
Imagine that with the external data bus there are 8 light bulbs outside of the box and 8 light bulbs inside the box with the man. Each light bulb inside the box is paired to a light bulb outside of the box. Light bulb 1 outside the box is paired with light bulb 1 inside the box. Light bulb 2 outside the box is paired with light bulb 2 inside the box, and so on. Each light bulb pair has a light switch under the outside light and under the inside light. Now if someone on the outside of the box turns on the light switch for bulb 1 outside of the box, both light 1 outside of the box and light bulb 1 inside of the box will turn on.
Thus, we have a means of communicating with the man in the box. Any number of light bulbs can be on or off at the same time. When a light bulb is on, this is equivalent to 1, and when a light bulb is off, this is equivalent to 0. And ta-dah we have binary code made up of 1s and 0s. So going back to the analogy if light bulb 1 and light bulb 4 are on with the rest off, this is equivalent to the binary code 10010000. Each light bulb has a binary value since it can only either be on or off. Each binary value is called a bit. Eight of these binary values are called a byte. So 8 bits equal a byte.
So let’s say that each pattern of lights means something different. A code book is created that says what each pattern of lights means. A code book is built into every single CPU, and it’s called machine language. Let’s say that the guy in the box is given the code book so he knows what each pattern means. So now, we have a means of communicating with the man in the box by turning on and off the bulbs on the outside of the box, which are then mirrored to the bulbs inside the box with the man.
Here is a sample code book that we give to the man in the box:
Code | Meaning |
10000000 | The next line is a number, put it in the AX register |
10010000 | The next line is a number, put it in the BX register |
10110000 | Add AX to BX and put the result in AX |
11000000 | Put the value of AX on the External Data Bus |
00000000 | The number 0 |
00000001 | The number 1 |
00000010 | The number 2 |
00000011 | The number 3 |
00000100 | The number 4 |
Inside of the box, with the man, there are also four racks of light bulbs. Each rack has 16 light bulbs on them. These racks are for storage areas so the man in the box can perform calculations. These are called registers. Let’s say the four registers are labeled AX register, BX register, CX register, and DX register. On a modern CPU, there could be a hundred registers that are 128 bits across.
Also inside of the box, let’s say there is a bell, much like the bell many convenience stores have to signal when someone has opened the door. This bell is called the clock. The clock’s job is to tell the CPU to do something. Let’s say this bell is connected to a doorbell on the outside of the box. So when you press the doorbell on the outside of the box, the bell inside of the box will ring. In actuality, the clock is just a wire.
So in the analogy let’s say we want the man in the box to add 1 + 3. Again we can only communicate to the man in the box, by switching on/off our 8 light bulbs outside of the box. So first we look at the codebook and determine that the code for “the next line is a number, put it in the AX register” is 10000000. So we turn on the lights on the outside of this box in the pattern 10000000. Again 1 means the light is on and 0 means the light is off. Then we press the door bell button. Now the man in the box (CPU) sees the pattern and turns off all the lights (zeroes everything out) to indicate he got the message. Next, we send the number 1 in binary, which according to the codebook is 00000001. We turn on the bulbs in that pattern and push the door bell again. In CPUs, there’s not a perfect one to one correlation where every time you push the doorbell (clock) something is going to happen. It depends on how complicated the command is. It could take 100 or 200 clock pushes until the CPU actually process the command. So the CPU zeroes everything out and we put in the next code of 10010000 to indicate “the next line is a number, put it in the BX register.” We push the clock door bell and wait for the lights to zero out. Then we put in the number 3 in binary, which is 00000011. Push the clock door bell. Wait for the CPU to zero out. Now, within the box, the binary number 1 is in the AX register and the binary number 3 is in the BX register. Now we tell the CPU to add these two numbers by referring to the codebook and turning on the outside lights in the pattern of 10110000, and again push the clock button. When the CPU zeroes out the lights, the binary number 4 will now be in the AX register. We can’t see inside the register, so we refer to our codebook again to get the code for “put the value of AX on the External Data Bus” which is 11000000. We light up the outside lights in the 11000000 and push the clock doorbell. Now instead of zeroing out, the outside lights will display a binary 4, which is 00000100.
So actually a CPU has multiple logic units (multiple guys in the box performing calculations). The different logic units may specialize in tasks. For example one logic unit is good for moving data, another is good with integer math, etc. CPUs use pipelines to optimize the processing of commands.
Single-core
Older CPUs were designed to process one transaction at a time. Each core has its own set of control unit, ALU, and registers.
Multicore
Modern technology has found ways to increase the number of CPUs that are available in a single processor. These separate CPUs are called separate cores. There can be dual (2) core, quad (4) core, octa(8)-core, etc. Each core has its own CPU, meaning that multiple transactions can be occurring at the same time. Each core has its own cache but it can also have a shared cache that is shared across all cores on the entire chip.
Virtualization
Virtualization allows you to simultaneously run different operating systems within a single hardware platform. The different operating systems share the same physical hardware components.
Virtualization via software provided doesn’t provide the fastest performance since the software needs to handle managing the different resources for each OS. Therefore, virtualization was added to the processor. Virtualization with the hardware makes things faster and easier to manage. Intel’s virtualization is called Intel Virtualization Technogology (VT) while AMD calls it AMD Virtualization (AMD-V).
Hyperthreading
A CPU core is designed to handle one transaction a time. Information is moved into a CPU, the CPU performs the transaction, and the results of the transaction are moved out of the CPU. The process of moving the information into and out of the CPU takes time, and during this time the CPU is idle. With hyperthreading, the CPU can be peforming another transaction instead of being idle while it waits for the transfer of information. Hypthreading increases performance by 15-30%.
The operating system in use must support hyperthreading, in order for it to be used. Most modern operating systems (for example Windows XP and later) do support hyperthreading.
Speeds
Processor specification will include its speed. The speed is listed in megahertz (MHz) or gigahertz (GHz) and refers to how many total transactions that can occur in a single second. One hertz means 1 time per second. Megahertz means millions of transactions per second. Modern CPUs have gigahertz speeds which are billions of transactions per second. This means that the clock can cycle billions of times per second.
There are many different components that determine the actual speed of the CPU. For example, clock speed, CPU architecture, bus speed, bus width, L1 cache size, L2 cache size, and operating system capabilities influence the speed.
The listed CPU speeds is the maximum that the CPU can go.
Overclocking
There’s a system crystal built onto every motherboard that drives the clock. The crystal oscillates and keeps time like a metronome to drive the clock. CPUs perform clock multiplying, which means they take the beat from the system crystal and multiply it.
Intel and AMD build and test their CPUs to operate at a set clock speed. However, CPUs can be run at a higher clock speed, but it requires a balancing act. A higher clock requires more power, generates more heat, and at some point cause the system to become unstable. The process of running the clock at a speed faster than it was designed to, is called overclocking. Overclocking adjusts the clock mulitiplier. Not all motherboards will allow you to overclock. If your motherboard does allow it then there would be setting in your BIOS called base clock (BCLK). The CPU on the motherboard must all allow you to overclock. After you’ve performed overclocking you can run stress tests to verify the stability of your system at the new clock speed. Note that overclocking will void your warranty since overclocking can damage your CPU and other components.
Integrated GPU
An integrated GPU means that the Graphics Processing Unit (GPU) is built into the CPU, and you don’t need a separate graphics card in your system.
However, if you require higher end graphics for video editing or gaming, then you would need a dedicated separate GPU for better speed and performance.
CPU Installation
Make sure you have a compatible CPU for your motherboard. The CPU must have the right socket and speed to match the motherboard.
Below is a video of how to install a CPU on the motherboard: