Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 55 ยท Meet the Computer

What Is a Computer?

Learn what a computer really is: a programmable machine that takes input, processes it, stores data and produces output, plus a short history from gears to chips.

You use computers all day: the phone in your pocket, the laptop on your desk, the card reader at the supermarket, even the thermostat on the wall. They look very different, yet they all share one idea. A computer is a machine that follows a list of instructions to turn data you give it into data you want. The list of instructions is called a program, and the fact that you can swap the program without rebuilding the machine is what makes a computer special.

This lesson gives you the mental model that the rest of the tutorial builds on. You will meet the four jobs every computer does (input, processing, storage and output), see why "programmable" is the key word, and take a quick walk through history from gears and punched cards to chips with billions of switches. After this lesson you can move on to Hardware and Software.

The four jobs of a computer

Whatever its size, a computer repeats a loop of four jobs:

  1. Input: data comes in. You press a key, tap a screen, a microphone hears a sound, a sensor reads a temperature.
  2. Processing: the machine calculates, compares and decides, following the program.
  3. Storage: data is kept, briefly while it is being used or for years on a disk.
  4. Output: results go out. Pixels light up, a speaker plays a sound, a file is saved, a motor turns.

Take a calculator app. You tap 7, +, 5 (input). The processor adds the numbers (processing). The app holds 7 while you type 5 (storage). The screen shows 12 (output). The same pattern fits a video call, a game, or an online shop.

flowchart LR
  I["Input<br/>keyboard, touch, sensors"] --> P["Processing<br/>CPU follows the program"]
  P --> O["Output<br/>screen, speaker, files"]
  P <--> S["Storage<br/>memory and disks"]

Every computer repeats input, processing and output, with storage holding data and the program in between.

Notice that storage sits next to the processor with arrows in both directions: the processor reads data from it and writes results back. Storage holds two kinds of things, the data and the program itself. We will return to that second part because it was a big idea in computing history.

Why "programmable" matters

A pocket calculator from the 1980s does arithmetic, but you cannot make it play music. Its behavior is fixed in its circuits. A general-purpose computer is different: its circuits can do only a few tiny operations (add, compare, move a number), but you can combine those operations in any order by writing a program. Change the program and the same hardware becomes a word processor, a web browser or a game console.

This is why one phone can replace a camera, a map, a flashlight and a music player. Nothing changed in the metal. Only the programs differ. A good way to hold this in your head is:

  • Hardware is the machine that can do many simple things.
  • Software is the recipe that says which simple things to do, in which order.

You will explore that split in the next lesson. For now, try a tiny machine whose program is passed in as data.

JS The same machine, two different programs

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The function run is the "hardware": it never changes. The arrays of small steps are the "software". Swap the array and you get a different machine. Real processors work the same way, except their steps are numbers called instructions, and there are billions of them per second.

The steps above are still JavaScript functions. A real computer stores its program as plain data in memory, next to the numbers. This second machine does the same: the program is a list of text instructions that the machine reads one by one.

JS A program stored as data

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Edit a line, for example change MUL 3 to MUL 10, and the output changes without touching the loop. That is the stored-program idea in twenty lines.

In these examples the engine and the data are real JavaScript, but the "processor" is just a loop. It stands in for what a CPU does; a real CPU has no idea about functions, only about simple numeric instructions. You will build a closer model in The CPU.

A short history

People have always built tools to help with arithmetic. Here are the milestones that matter most for understanding today's machines.

  • Counting aids (thousands of years ago). Tally sticks and the abacus store numbers physically.
  • Mechanical calculators (1600s). Gears add and subtract. They are fast for one task but cannot be reprogrammed.
  • Jacquard loom (1804). Punched cards tell a loom which threads to lift. Change the cards and you weave a different pattern: an early program stored on a physical medium.
  • Analytical Engine (1830s). Charles Babbage designed a mechanical machine with a processing part, a memory and punched-card input. Ada Lovelace wrote notes describing how such a machine could be given a sequence of operations. It was never completed in their lifetime.
  • Electronic computers (1940s). Machines such as ENIAC used thousands of vacuum tubes. Early ones were rewired or reconfigured by hand to change the task.
  • Stored-program computers (late 1940s). The program is kept in memory right next to the data, so loading a new program takes seconds instead of days of rewiring. Nearly every computer today follows this plan.
  • Transistors and chips (1950s onward). Tiny switches replaced bulky tubes. Putting many on one slice of silicon gave us the integrated circuit, and later the microprocessor, a whole processor on one chip.
  • Personal computers, the web, smartphones (1970s to now). Computers shrank, got cheaper, and became connected.
timeline
  title From gears to chips
  1804 : Punched cards control a loom
  1830s : Analytical Engine designed
  1940s : Vacuum-tube computers
  Late 1940s : Stored-program idea
  1950s : Transistors
  1970s : Microprocessors and PCs
  2007 onward : Smartphones everywhere

A few turning points on the way to the computers you use today.

Each step made computers smaller, faster, cheaper and more general. A phone today has far more computing power than the room-sized machines of the 1950s, and it fits in a pocket.

What a computer is not

A few common misunderstandings are worth clearing up.

  • A computer is not "smart" by itself. It does exactly what its program says, very quickly. Mistakes in a program (bugs) produce wrong results just as quickly.
  • A computer is not only the box with a screen. Routers, game consoles, cars, smart TVs and washing machines all contain computers.
  • The screen, keyboard and mouse are not the computer. They are input and output devices. The thinking happens in the processor and memory.

When you meet an unfamiliar device, ask four questions: what goes in, what is computed, what is remembered, and what comes out? You can describe almost any computer system with those four.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which list names the four basic jobs of a computer?

    Every computer takes input, processes it, keeps data in storage and produces output. The other lists are real terms but not the basic cycle.
  2. 2. What makes a general-purpose computer different from a fixed-function calculator?

    A general-purpose computer is programmable: changing the program changes what the machine does, without changing its circuits.
  3. 3. What was the key idea of the stored-program computer?

    Keeping the program in memory means a new task is loaded in seconds instead of rewiring the machine.
  4. 4. A keyboard is an example of which part of the cycle?

    A keyboard sends data into the computer, so it is an input device.

Summary

  • A computer follows a program to turn input data into output data.
  • Its four jobs are input, processing, storage and output.
  • Being programmable is what makes one machine able to do many tasks.
  • The stored-program idea (program and data in memory) underlies almost all modern computers.
  • History moved from gears and punched cards to vacuum tubes, transistors and microprocessors.
  • Screens and keyboards are devices attached to the computer, not the whole computer.

Next, see how the physical parts and the programs fit together in Hardware and Software.