Part 1: Fundamental Concepts of Computing
Part 1: Fundamental Concepts of Computing — read through each chapter in order. Diagrams, tables and worked examples included.
1. What Is a Computer & How It Works
What Is a Computer & How It Works
A computer is a machine that follows instructions to store, move, and transform information. It does not "think" the way a person does; instead it performs millions of tiny, exact steps so quickly that the result looks intelligent. Before you write a single line of code, it helps to understand the machine your programs will run on.
Hardware vs Software
Everything about a computer falls into two categories:
- Hardware — the physical parts you could touch: the processor chip, memory sticks, hard drive, keyboard, and screen. Think of hardware as the body.
- Software — the instructions that tell the hardware what to do: the operating system, your web browser, and the programs you will write. Think of software as the knowledge and habits that make the body useful.
A great analogy is a kitchen. The oven, knives, and pans are the hardware. A recipe is the software — a set of instructions. The same kitchen can cook countless dishes depending on which recipe you follow, just as the same computer can run countless programs.
The Core Components
Four kinds of hardware cooperate on every task. Keep these roles in mind — nearly every programming idea eventually connects back to one of them.
| Component | What it does | Everyday analogy |
|---|---|---|
| CPU (Central Processing Unit) | Carries out instructions: arithmetic, comparisons, and control decisions. The "brain". | A very fast chef who can only follow one tiny instruction at a time, but does so billions of times per second. |
| RAM (Main Memory) | Holds the data and instructions the CPU is using right now. Fast but temporary — it empties when power is lost. | The kitchen counter: roomy enough for what you are cooking this minute, but you clear it when you finish. |
| Storage (Disk / SSD) | Keeps files and programs permanently, even when the power is off. Slower than RAM but much larger. | The pantry and fridge: ingredients stay there long-term until you carry them to the counter. |
| Input / Output (I/O) | Moves information between the computer and the outside world — keyboard and mouse in, screen and speakers out. | Your hands and senses: how the chef receives orders and serves finished plates. |
The von Neumann Architecture
Almost every modern computer follows a design named after mathematician John von Neumann. Its key idea is simple but powerful: programs and data live together in the same memory. The CPU fetches an instruction from memory, decodes what it means, executes it, and repeats — a loop called the fetch–decode–execute cycle. Information travels between the parts along shared wires called a bus.
How a Task Actually Happens
Imagine you double-click a program. Storage hands the program's instructions to RAM. The CPU's control unit fetches the first instruction, figures out what it means, and directs the ALU (Arithmetic Logic Unit) to do any math or comparison. Results flow back to memory or out to the screen through I/O. This cycle repeats billions of times to produce everything from a moving cursor to a video game.
You now have the mental model that the rest of this course builds on: a computer is a fast, literal instruction-follower that keeps its working data in memory and its permanent data in storage. Programming is simply the craft of writing those instructions clearly enough that this literal machine does exactly what you intend.