The CPU, otherwise known as the central processing unit, or processor, is the main processor of a given computer. It is in charge of executing instructions. It usually does so as part of the instruction cycle. Those instructions can range from arithmetic, logic, control, and input/output operations. It is often compared to the ‘brain’ of a computer.

ISA

Every CPU executes a very specific set of instructions defined by an ISA (instruction set architecture). This instruction set bridges the assembly’s intent to what the hardware actually does. In CPSC 213, that will be the toy assembly language, SM213.

Interrupts

The flow and control of the CPU can be changed by interrupts, making it capable of returning to a task once it completes.

Composition

Modern day CPUs have a lot of different components that enable them to be very performant, most of which is outside of the scope of CPSC 213. Within the scope of 213 however, they contain an ALU and registers.

Non-testable

Some other components include the control unit, the cache, and the clock.

Multithreading

CPUs can also have a varying amount of cores. Each of these cores is also sometimes subdivided into multiple ‘logical cores’. On my desktop computer for example, the AMD Ryzen 5 7600x chip I have installed has 6 cores with 12 threads.

Non-testable

This technique of having multiple logical cores per hardware cores is called SMT. It is really interesting and really complicated.

Each of these threads/logical cores has its own individual set of registers, and can execute a single thread at a time.

Non-testable

In reality, even single core-CPUs can execute multiple threads at a time (or appear to be doing so) through a process called time-slicing.