Welcome to Systems Architecture!

Ever wondered what actually happens inside your computer or phone when you tap an icon? In this chapter, we are going to look at the "brain" of the computer: the Central Processing Unit (CPU). We will explore how it’s built, how it thinks, and what makes one computer faster than another.

Don't worry if some of the words sound like robot-talk at first—we'll break everything down using simple analogies you use every day!

1. The Von Neumann Architecture

Most modern computers are based on a design called the Von Neumann architecture. Named after a mathematician, this design describes how the CPU (the brain) works with Main Memory (the storage for what you are currently doing).

The Key Components

Imagine a chef working in a kitchen. This will help us understand the parts of the CPU:

  • Arithmetic Logic Unit (ALU): This is the "Calculator." It handles all the mathematical checks (like \(1 + 1\)) and logic decisions (is 5 greater than 3?). Analogy: The chef actually chopping and cooking the food.
  • Control Unit (CU): This is the "Manager." It coordinates all the activities of the CPU, following instructions and telling other parts of the computer what to do. Analogy: The head chef reading the recipe and telling assistants what to do.
  • Clock: This is the "Metronome." It sends out a constant pulse to keep all the components in sync. The faster the clock, the more instructions the CPU can handle per second.
  • Register: These are tiny, super-fast storage areas inside the CPU. They hold a single piece of data or an instruction that the CPU is using right now. Analogy: The small bit of space on the chef's cutting board.
  • Bus: These are the "Connectors." A bus is a collection of wires used to send data and signals between the CPU, memory, and other parts. Analogy: The hallways or conveyor belts moving ingredients around.

Quick Review: The Main Memory (RAM) holds the programs and data currently in use, while the CPU processes them using the parts listed above.

Key Takeaway: The Von Neumann architecture is the basic blueprint of a computer, where data and instructions are stored in memory and moved to the CPU to be processed.

2. The Fetch-Execute Cycle

The CPU is constantly running a three-step loop called the Fetch-Execute Cycle. It does this billions of times every second!

Step 1: Fetch

The CPU fetches (retrieves) the next instruction from the Main Memory (RAM) and brings it into the CPU via the bus.

Step 2: Decode

The Control Unit looks at the instruction and decodes it. This means it figures out what the instruction actually wants the computer to do (e.g., "Add these numbers" or "Save this file").

Step 3: Execute

The CPU executes (carries out) the instruction. This might involve the ALU doing a calculation or moving data from one place to another.

Did you know? This cycle happens so fast that your computer can perform billions of these "Fetch-Decode-Execute" steps every single second!

3. CPU Performance

Why is a brand-new gaming laptop faster than an old school computer? It usually comes down to three things:

Clock Speed

This is measured in Hertz (Hz), usually Gigahertz (GHz). It tells us how many Fetch-Execute cycles the CPU can do per second.
Example: A 3GHz processor can do 3 billion cycles every second!

Number of Cores

A "core" is like a complete copy of a CPU. A dual-core processor has two "brains," and a quad-core has four.
Analogy: If one chef can cook a meal in 20 minutes, two chefs (cores) working together can often get it done much faster!

Cache Size

Cache (pronounced "cash") is a tiny amount of very fast memory inside the CPU. It stores data that the CPU uses frequently so it doesn't have to wait to get it from the slower RAM.
Analogy: Cache is like having the salt and pepper right in your pocket instead of having to walk to the pantry every time you need them.

Common Mistake: Students often think doubling the cores always doubles the speed. It doesn't! Sometimes programs aren't designed to be split between multiple "chefs," so one core might end up waiting for another to finish.

4. Memory

Computers use different types of memory for different jobs. The two most important ones to know are RAM and ROM.

RAM (Random Access Memory)

  • Role: Holds the operating system, programs, and data currently being used.
  • Volatile: This is a big word that just means temporary. If you turn off the power, everything in RAM is deleted.

ROM (Read Only Memory)

  • Role: Holds the "startup" instructions for the computer (the BIOS).
  • Non-volatile: This means permanent. It keeps its data even when the power is turned off.
  • Read-Only: As the name suggests, the CPU can read from it, but usually cannot change what is written there.

Memory Aid (The "V" Trick):
Volatile = Vanishes when the power goes off! (RAM)
Non-volatile = Never vanishes! (ROM)

Key Takeaway: RAM is your "work desk" (big but temporary), while ROM is the "instruction manual" (small but permanent).

5. Embedded Systems

Not every computer is a PC or a laptop. Many devices have a "mini-computer" inside them designed to do just one specific job. These are called Embedded Systems.

Characteristics:

  • They are built into a larger device.
  • They have a dedicated, single purpose.
  • They are usually very reliable and efficient.

Real-world Examples:

  • Washing machines (controlling the wash cycle).
  • Microwaves (controlling the timer and heat).
  • Digital watches.
  • Anti-lock braking systems (ABS) in cars.

Quick Review: A laptop is not an embedded system because it is a "general-purpose" computer—it can do many different tasks like gaming, writing, or browsing the web.

Key Takeaway: If it's a computer inside a machine that only does one specific job, it's an Embedded System.