The basic idea: take in, work on, put out
Almost every computer, whether it is a laptop, a phone or the controller in a washing machine, follows the same loop. It takes in information, works on it, keeps some of it for later, and sends results back out. The design of how those jobs are divided up is what people usually mean by computer architecture.
Seen this way, a computer is less mysterious. Each part has a narrow job, and the parts pass information to one another over short electrical pathways. The impressive behaviour comes from doing a very large number of very simple steps very quickly.
Switches at the bottom
At the lowest level, a computer is built from tiny electronic switches called transistors. A switch is either passing current or not, which gives two states. Those two states are written as 1 and 0.
On their own, single switches do little. Grouped into small arrangements called logic gates, they can answer simple questions such as “are both of these inputs on?” Connect enough gates together and you can add numbers, compare them, and move them around. Modern chips contain a vast number of these switches, packed onto a piece of silicon smaller than a postage stamp.
Everything the machine handles, including text, photos, music and programs, is stored as patterns of these two states. The idea is covered in more detail in the discussion of binary code, but the key point here is that the hardware only ever needs to tell “on” from “off”.
Input: getting information in
Input devices turn something in the physical world into electrical signals the computer can use. A keyboard reports which key was pressed. A mouse or trackpad reports movement and clicks. A microphone turns sound waves into a stream of numbers. A camera measures light. On a phone, the touchscreen reports where a finger is.
Network connections are also a kind of input: data arriving over Wi-Fi from a wireless router is just another stream of signals that the computer must interpret.
Processing: the central processing unit
The processor, or central processing unit, is the part that carries out instructions. A program is a long list of very small instructions, such as “fetch this number”, “add these two numbers” or “jump to a different instruction if the result is zero”. The processor repeats a cycle: fetch an instruction, work out what it asks for, carry it out, and move on to the next one.
Two ideas help explain how fast this feels:
- Clock speed is roughly how many of these steps the processor can pace itself through each second. Modern chips run at billions of cycles per second.
- Cores are separate processing units on one chip. More cores let a computer work on several tasks at the same time, though how much that helps depends on whether the software can be split up that way.
Some work, such as drawing detailed images, is handed to a specialised chip. That is the role of a graphics processor, which is good at doing many similar calculations in parallel.
Memory and storage: where information waits
A processor is fast but has very little room of its own. It needs somewhere close by to hold the programs and data it is working on right now. That is the job of memory, which is quick but temporary. Contents are generally lost when the power goes off.
Storage is the long-term place. Files, apps and the system itself stay there when the computer is switched off. Storage is much larger and cheaper per unit of space than memory, but slower to reach. Today it is usually a flash-based drive, or in some machines a spinning disk.
A helpful picture is a desk and a filing cabinet. The desk is small and convenient, and you work on whatever is on it. The cabinet holds far more but takes longer to fetch from. Computers constantly move material between the two. Having too little memory means that shuffling happens more often, and that is one of several reasons computer performance can drop when many things are open.
The operating system: the manager
Between the hardware and the programs you use sits the operating system. It decides which program gets to use the processor and for how long, hands out memory, keeps track of files, and lets programs talk to devices without each one needing to know the details of every keyboard or screen. Because of it, a program written once can run on many different machines.
Output: getting results back to you
Output is the reverse of input. The computer turns internal numbers back into something people can see or hear. A screen is a grid of tiny dots called pixels, and the computer tells each one what colour to be. A speaker turns a stream of numbers into vibrations. A printer turns a page description into ink on paper. A network connection sends data out as well.
For a screen, the path usually looks like this: the processor and graphics hardware work out what each pixel should show, the result is placed in a section of memory, and the display circuitry reads it many times a second and lights the pixels accordingly. The number of times per second the picture is redrawn is the refresh rate.
One example from end to end
Suppose you press a key while typing in a document.
- The keyboard sends a signal saying which key was pressed.
- The operating system receives it and passes it to the program that has your attention.
- The program, running on the processor, works with data held in memory, adding the character to the text.
- The program asks the operating system to redraw the window, and the graphics hardware prepares the new picture.
- The screen updates, showing the letter.
- When you save, the program asks the operating system to write the document to storage.
All of that normally happens in a tiny fraction of a second, which is why it seems instant.
Why this picture is worth having
Knowing the roles makes everyday problems easier to reason about. A slow computer might be short of memory, have a nearly full drive, or be limited by an older processor. A program that will not start might be waiting on storage, or on something the operating system has not yet provided. The computer hardware you choose to buy matters most where your own work puts pressure on it: memory for many open tasks, storage space for large files, and graphics power for games or video editing.
None of these ideas is specific to one brand or one device. Once you can name the parts and what each one does, new gadgets tend to look like familiar arrangements of the same pieces.