CS Basics: CPU Architecture

A practical overview of how the Central Processing Unit - the brain of a computer - manages and executes instructions through coordinated sub-systems.

Originally written by Carl Mills · December 12, 2017

Why Start Here?

Before diving into web development, understanding the foundation of computing helps everything make more sense. The CPU is where every instruction - from rendering a web page to compiling code - ultimately executes.

Core Components of the CPU

Control Unit (CU)

Coordinates all CPU activities. It instructs memory, arithmetic units, and input/output components what to do and when. It ensures the entire system operates in sync.

Arithmetic & Logic Unit (ALU)

Performs integer-based calculations and Boolean logic (true/false). Handles binary operations on whole numbers.

Floating Point Unit (FPU)

Processes decimal and fractional numbers. The ALU passes non-integer operations to the FPU for more complex math.

Data Cache Unit (DCU)

Temporarily stores data awaiting processing - similar to a waiting room that holds information until the CPU is ready.

Instruction Cache

Holds instructions in a queue before they are executed. These can come from software or internal processes within the CPU.

Instruction Set

The CPU's native "language." Defines how it interprets and carries out instructions, schedules operations, and prioritises tasks.

Decode Unit

Translates software instructions from human-readable or assembly language into binary form the CPU can process directly.

Prefetch Unit

Reads ahead to identify which data and instructions will be needed next. Passes them to the Control Unit along with their memory addresses to optimise execution.

Clock Speed

Measured in MHz or GHz, the clock speed determines how many instructions the CPU can execute per second. The higher the frequency, the faster the processing.

Key Concept: Von Neumann Architecture

This CPU model - the basis for most modern computers - uses the same memory and bus system for both instructions and data. It simplifies design but can cause a performance bottleneck known as the Von Neumann bottleneck when instructions and data compete for bandwidth.

Boolean Logic and Beyond

A Boolean value can be only 0 (false) or 1 (true). These fundamental values underpin all logic operations that allow the CPU to make decisions, process conditions, and branch execution paths.

Grasping these mechanics removes the "magic" from how computers operate. From here, the next step is moving up a level - understanding how binary translates into assembly language and beyond.

Next in the Series

In the next post, we move from CPU hardware into programming - exploring logical instructions and bitwise operators

Continue to Binary → Assembly