CS 100 (Learn)CS 100 (Web)Module 02


The Central Processing Unit (CPU)

The "brain" of any computer is known as the CPU (or sometimes as just the processor). It performs most of the "computing".

In this course, we will not discuss how CPUs work in great detail. However, you might be surprised that most CPUs only perform a few very basic operations:

The magic of the CPU is twofold:

  1. A lot can be accomplished with those few basic operations, and
  2. CPUs are really really fast.

Each CPU has its own machine language that is used to give it instructions. Typically, instructions designed for one CPU will not work on another. However, many CPU manufacturers have chosen to make their machine languages compatible (e.g., Intel and AMD). In addition, there are ways to tackle CPU and hardware incompatibilities with software, which we will discuss later.

When you are buying a computer, the CPU is one of the most important components to consider. Unfortunately, depending on the computer you're looking at and where you're shopping, the CPU information may be prominently displayed with confusing acronyms, or it may be hidden away as an insignificant detail. This problem is made worse because of marketing materials intentionally designed to obfuscate (confuse) and mislead.

If buying a computer is analogous to buying a car, then the CPU is like the engine of the car. For some consumers, the make, model and capacity of the engine/CPU is extremely important, but for others the colour, size, and features of the car/computer are more important. As with a car engine, the CPU is one of the most significant costs of a computer, and so the price of the computer is often a reflection of the quality of the CPU.

There are a few key characteristics of a CPU that are worth paying attention to.

  1. Make & Model. Each manufacturer has different CPU models that will determine the characteristics of the CPU. For example, an Intel i7 processor is more powerful than an i3 processor.

  2. Speed. The speed of a modern CPU is measured in GHz (Gigahertz). A 3 GHz processor can theoretically perform 3 billion operations per second ("Giga" = billion, "hertz" = per second).

  3. Number of Cores. Most modern CPUs are a combination of several processors or cores. A quad-core processor has four independent processors built into a single chip. Effectively, a quad-core can do four times as much computation as a single core. Multitasking with multiple cores will be briefly discussed later.

  4. Power Consumption. With mobile devices, power consumption has become very important. The speed and number of cores can affect the power consumption. Some processors can even slow down their speed and switch to a "low power mode" to save battery life.

  5. Cache. Cache (pronounced cash) is briefly discussed in a section later. For now, all you need to know is that a big cache is better.

The most popular CPUs for desktop computers (PCs and Mac) are Intel and AMD. For mobile devices, ARM-based CPUs are very popular because of their power consumption (e.g., Snapdragon and Apple's A12)