The Central Processing Unit (CPU): Architecture and Operation
In Week 7, we learned that a computer system combines Hardware, Software, and Peopleware. Inside the physical hardware, there are hundreds of electronic chips, capacitors, and wires.
Yet among all those components, one single silicon chip stands above all others in importance: The Central Processing Unit, or CPU.
Often called the "brain" or "engine room" of the computer, the CPU executes every calculation, carries out every program instruction, and directs every piece of hardware in the machine. In this lesson, we will look inside the CPU, dissect its two major subunits—the Arithmetic Logic Unit (ALU) and the Control Unit (CU)—and discover how Clock Speed governs its power.
Learning Outcomes
By the end of this lesson, you will be able to:
- Explain the central role of the CPU in the computer system.
- Describe the responsibilities of the Arithmetic Logic Unit (ALU).
- Describe the responsibilities of the Control Unit (CU).
- Explain what Registers are and how Clock Speed (GHz) measures processor performance.
Key Vocabulary
| Term | Technical Meaning |
|---|---|
| CPU (Central Processing Unit) | The primary microchip that interprets and executes machine instructions. |
| ALU (Arithmetic Logic Unit) | The subunit that carries out mathematical arithmetic and logical comparisons. |
| CU (Control Unit) | The supervisory subunit that fetches, decodes, and directs the flow of instructions and data. |
| Registers | Extremely fast, small temporary memory storage cells located directly inside the CPU chip. |
| Clock Speed (Gigahertz - GHz) | The frequency of electrical pulses generated by the system clock, measured in billions of cycles per second. |
Study Notes: Inside the Processor Architecture
+-------------------------------------------------------------------------+
| THE CENTRAL PROCESSING UNIT (CPU) |
| |
| +--------------------------+ +---------------------------+ |
| | CONTROL UNIT (CU) | | ARITHMETIC LOGIC UNIT(ALU)| |
| | | | | |
| | - Fetches instructions | <------> | - Math (+, -, *, /) | |
| | - Decodes operations | | - Logic (AND, OR, NOT) | |
| | - Supervises data buses | | - Comparisons (<, >, ==) | |
| +--------------------------+ +---------------------------+ |
| | | |
| +------------------+------------------+ |
| | |
| +---------------------------------+ |
| | INTERNAL REGISTERS & CACHE | |
| | Ultra-fast temporary storage | |
| +---------------------------------+ |
+-------------------------------------------------------------------------+
^
| (System Bus)
v
+-----------------------------+
| MAIN MEMORY (RAM MODULES) |
+-----------------------------+
1. The Arithmetic Logic Unit (ALU)
The ALU is the pure calculating engine of the processor:
- Arithmetic Operations: Performs fundamental mathematics: addition (+), subtraction (-), multiplication (*), and division (/).
- Logical Operations: Evaluates boolean logic: AND, OR, NOT.
- Relational Comparisons: Compares two values:
- Is $A$ greater than $B$? ($A > B$)
- Is $A$ equal to $B$? ($A == B$)
- Is the customer's account balance greater than the requested withdrawal?
2. The Control Unit (CU)
If the ALU is the mathematician, the Control Unit is the General Manager: - It does not calculate numbers itself. Instead, it directs traffic! - It fetches the next instruction from the computer's RAM memory. - It decodes the instruction (determines what operation needs to be done). - It signals the ALU when to calculate, tells RAM when to release data, and commands the monitor when to display the result.
3. Internal Registers
Registers are tiny, ultra-high-speed storage pockets built directly onto the silicon wafer of the CPU: - While RAM memory is fast, registers are over a hundred times faster! - They hold the immediate numbers the ALU is working on right at this microsecond (such as the two numbers being added together right now).
4. Processor Clock Speed: Gigahertz (GHz)
Inside the computer is a tiny quartz crystal called the System Clock: - The clock ticks millions or billions of times every single second like an electronic metronome. - On each tick of the clock, the CPU can execute a step of an instruction. - Hertz (Hz): 1 cycle per second. - Megahertz (MHz): 1 million cycles per second. - Gigahertz (GHz): 1 billion cycles per second! - A modern $3.2\text{ GHz}$ processor ticks 3,200,000,000 times every second, allowing it to process complex multimedia and video games with blinding speed.
Worked Example: Tracing a Simple Calculation
What happens inside the CPU when you calculate: $15 + 27$?
- Step 1 (Fetch): The Control Unit (CU) fetches the instruction
ADD 15, 27from the computer's RAM. - Step 2 (Decode): The CU decodes the instruction and recognizes that an addition operation is required.
- Step 3 (Load): The numbers
15and27are placed into internal CPU Registers. - Step 4 (Execute): The CU signals the ALU, which adds the two binary numbers together, producing
42. - Step 5 (Store): The result
42is written into an accumulator register and sent back to RAM or displayed on the monitor.
Practical Class Activity: The Human CPU Simulation
Three students model the internal workings of a processor: 1. Student 1 (Control Unit): Holds a paper labelled "CU". Holds a list of three instructions: - Instruction 1: Fetch 12 and 8 into Registers. - Instruction 2: Command ALU to Multiply. - Instruction 3: Display Answer on Blackboard. 2. Student 2 (Registers): Holds two paper cups labelled Register A and Register B. 3. Student 3 (ALU): Stands ready with chalk at the blackboard.
Execution:
- The CU reads Instruction 1: Hands 12 beans to Register A and 8 beans to Register B.
- The CU reads Instruction 2: Commands the ALU to multiply: $12 \times 8$.
- The ALU calculates mentally: $96$.
- The CU reads Instruction 3: ALU writes 96 in large chalk on the blackboard!
Common Mistakes & Corrections
| Common Mistake | Why It Is Incorrect | Proper Correction |
|---|---|---|
| "The large metal computer box on the floor is the CPU." | That large metal box is the System Unit. | The CPU is a small square microchip (about 4 cm wide) mounted inside on the motherboard beneath a cooling fan. |
| "A CPU with higher GHz is the only thing that makes a computer fast." | Sufficient RAM memory and fast SSD storage are equally vital to prevent system bottlenecks. | Overall computer performance depends on a balanced partnership between CPU, RAM, and storage. |
Notebook Summary
Copy Into Your Computing Notebook
- The CPU (Central Processing Unit) is the primary processing engine of the computer.
- The ALU (Arithmetic Logic Unit) handles arithmetic math (
+,-,*,/) and logical comparisons (<,>,==). - The CU (Control Unit) supervises instruction fetching, decoding, and data traffic flow.
- Registers provide ultra-fast temporary storage inside the processor chip.
- Clock Speed is measured in Gigahertz (GHz): billions of electrical clock pulses per second.