🧠 Welcome to Systems Architecture: The Brains of the Computer

Hello future Computer Scientists! This chapter is incredibly important because we are finally going to look inside the box. We’ll learn about the core components that make your computer, phone, or tablet actually work.
Think of Systems Architecture as studying the blueprints of a building. Once you understand the blueprints, you understand how everything connects and functions! Don't worry if some terms sound tricky at first—we'll break them down using simple analogies.

Key Goal: Understand how the Central Processing Unit (CPU) works and how it uses memory to follow instructions.

1. The Central Processing Unit (CPU): The Master Chef

The Central Processing Unit (CPU) is often called the "brain" of the computer. Its job is to process all the instructions it receives from software and hardware. Every click, every calculation, and every decision is handled by the CPU.

1.1 Key Components of the CPU

The CPU isn't just one piece; it's made up of three essential parts that work together:

  • The Arithmetic Logic Unit (ALU):
  • This is the calculator and decision-maker. It handles all the mathematical operations (like addition, subtraction—called Arithmetic) and logical comparisons (like checking if one number is greater than another—called Logic).
    Analogy: The ALU is the chef’s sharp knife and measuring cups.

  • The Control Unit (CU):
  • This unit manages and coordinates all the components of the computer system. It controls the flow of data inside the CPU and to other parts like memory. It fetches instructions and decides what to do next.
    Analogy: The CU is the head chef or manager, reading the recipe and making sure everyone does their job at the right time.

  • Registers:
  • These are tiny, high-speed memory locations used to temporarily hold data and instructions needed immediately by the CPU. They are the fastest type of memory.
    Analogy: Registers are the small scratchpads or sticky notes the chef uses to jot down current measurements or tasks.

🔥 Quick Review Tip:
To remember the components: The CPU is controlled by the CU, which uses the ALU to perform calculations, all while using temporary Registers. (C-A-R)
1.2 The Fetch-Execute Cycle

The CPU constantly repeats a fundamental process called the Fetch-Execute Cycle (or Instruction Cycle). This is how the computer follows instructions. It happens millions of times per second!

Imagine the CPU is a postman delivering mail (instructions) from the post office (Memory) to the house (CPU components).

  1. Fetch: The Control Unit (CU) fetches (retrieves) the next instruction and any necessary data from the main memory (RAM).
  2. Decode: The CU translates or decodes the instruction to figure out what it needs to do (e.g., "Add these two numbers," or "Move this data").
  3. Execute: The instruction is carried out. If it’s a calculation, the ALU does the math. If it’s a data transfer, the CU handles the movement.

The cycle then repeats for the next instruction.

Mnemonic Magic:
Fetch – Decode – Execute. (FDE!)
1.3 Factors Affecting CPU Performance

When you buy a computer, you see terms like GHz, Dual-Core, and Cache. These are the three main factors that determine how fast a CPU can process instructions:

  1. Clock Speed:
  2. Measured in Gigahertz (GHz). Clock speed dictates how many cycles (FDE cycles) the CPU can perform per second. A 3.0 GHz CPU can execute roughly three billion cycles per second. Higher clock speed means the computer runs faster.
    Analogy: How quickly the Master Chef can follow one step of the recipe.

  3. Number of Cores:
  4. A core is essentially an independent processing unit within the CPU. A single core can only handle one instruction at a time. A Dual-Core CPU has two processors working together, a Quad-Core has four, and so on. More cores allow the CPU to run multiple tasks (like surfing the web and streaming music) simultaneously.
    Analogy: The number of chefs working in the kitchen at once. More chefs = more tasks completed faster.

  5. Cache Memory:
  6. Cache is a very small amount of extremely fast memory located directly on or near the CPU chip. If the CPU needs data, it checks the Cache first. If the data is there (a "cache hit"), it is retrieved almost instantly, speeding up processing significantly. If it’s not there (a "cache miss"), the CPU must go to the slower main memory (RAM). Larger cache generally improves performance.
    Analogy: Ingredients kept right next to the chef, rather than having to walk all the way to the main fridge (RAM).

🔑 Key Takeaway for CPU: The CPU uses the FDE cycle, and its speed depends on how many cores it has, how high its clock speed is, and how large its fast Cache memory is.


2. Memory: RAM vs. ROM

Memory is vital because the CPU needs a place to store instructions and data while they are being actively used. We mostly talk about two types of main memory: RAM and ROM.

Analogy: If the CPU is the chef, the kitchen countertop (desk space) is RAM, and the unchanging instruction book (rules for starting up) is ROM.

2.1 Random Access Memory (RAM)
  • Purpose: RAM is the computer's main working memory. It temporarily holds the operating system, current applications, and the data they are using.
  • Volatile: This is the most important characteristic. RAM is volatile, meaning that when the power is turned off, all data stored in RAM is immediately lost.
  • Read/Write: Data can be written to and read from RAM very quickly.
  • Speed/Size: The more RAM you have, the more programs your computer can run smoothly at the same time.
2.2 Read Only Memory (ROM)
  • Purpose: ROM stores the startup instructions needed to boot the computer (often called the BIOS or UEFI). These instructions tell the computer how to load the operating system from the hard drive.
  • Non-Volatile: ROM is non-volatile. The data remains even when the power is off. If ROM lost its data, your computer wouldn't know how to start!
  • Read-Only: As the name suggests, this data is usually written once during manufacture and cannot easily be changed.
Common Mistake Alert!
Don't confuse ROM with RAM. If your computer crashes before you save your work, that work was in RAM and is lost. The program that crashed (the operating system) is stored permanently in ROM and Secondary Storage, so you can restart!

🔑 Key Takeaway for Memory: RAM is fast, temporary, and volatile (loses data on power loss). ROM is small, permanent, and non-volatile (stores essential startup instructions).


3. Embedded Systems

Not all computers look like laptops or desktop PCs. Many devices have tiny, dedicated computer systems hidden inside them. These are called embedded systems.

3.1 Definition and Characteristics
  • An embedded system is a dedicated computer system designed to perform one or a very small number of specific functions.
  • It is built (embedded) into a larger mechanical or electrical device.
  • Because they perform specific tasks, they are often much simpler, smaller, and cheaper than general-purpose computers.
3.2 Real-World Examples of Embedded Systems

You interact with embedded systems dozens of times a day without realising it!

  • Washing Machines: Controls the cycles, water temperature, and spin speed.
  • Traffic Lights: Controls the sequencing and timing of the lights.
  • Smart Watches/Fitness Trackers: Monitors heartbeat, tracks steps, and manages notifications.
  • Digital Cameras: Manages image capture, focusing, and processing.
  • MP3 Players: Manages playback and volume control.

Did you know? Even the sophisticated control systems in modern cars (like ABS brakes or engine management) are run by complex embedded systems.

🔑 Key Takeaway for Embedded Systems: They are specialized computer systems performing single, dedicated tasks within larger devices.


4. Primary vs. Secondary Storage

We already discussed RAM and ROM (which are types of Primary Storage). Now let's clarify the difference between Primary and Secondary storage.

4.1 Primary Storage (Memory)
  • Purpose: Used by the CPU for active work. It includes RAM and ROM.
  • Speed: Extremely fast, allowing immediate access for the CPU.
  • Volatility: Mostly volatile (RAM).
4.2 Secondary Storage (Backing Storage)
  • Purpose: To permanently store all data, applications, and the operating system when the computer is turned off.
  • Speed: Much slower than Primary Storage.
  • Volatility: Always non-volatile (retains data without power).
  • Examples: Hard Disk Drives (HDDs), Solid State Drives (SSDs), USB drives, and CDs/DVDs.
Summary Review Box
CPU: The brain. Uses FDE cycle.
RAM: Temporary workspace (Volatile).
ROM: Permanent startup guide (Non-Volatile).
Secondary Storage: Permanent file storage (Non-Volatile).
Embedded Systems: Dedicated computers inside other devices.