What a computer is, and how it is built
The definition, the five characteristics, the block diagram, and what each functional unit actually does when a program runs.
Module contents
A computer is an electronic device that accepts data, processes it according to a stored set of instructions, produces output, and can store both the data and the results.
Four verbs, in order: input → process → output → storage. Every part of the machine exists to serve one of them.
The word "stored" is doing a lot of work in that definition. A calculator processes data too, but you must supply each instruction as you go. A computer holds the whole sequence of instructions — the program — inside itself and then follows it without further help. That single idea, the stored-program concept, is what separates a computer from every machine that came before it.
Characteristics of a computer
| Characteristic | What it means |
|---|---|
| Speed | Operations are measured in millions or billions per second. Time is quoted in milliseconds ( s), microseconds ( s), nanoseconds ( s) and picoseconds ( s). |
| Accuracy | The machine does not make arithmetic mistakes. Wrong output comes from wrong input or wrong instructions — GIGO, garbage in, garbage out. |
| Diligence | No tiredness, no boredom, no loss of concentration. The ten-millionth calculation gets the same care as the first. |
| Versatility | The same hardware runs a payroll, edits a photograph and plays music, because only the program changes. |
| Storage capacity | Vast amounts of data held indefinitely and retrieved in a fraction of a second. |
And the honest limitations: a computer has no intelligence of its own (it does exactly what it is told), no intuition, and cannot decide what to do in a situation its program does not cover.
The block diagram
Every computer, from a phone to a supercomputer, has the same five functional units.
1. Input unit
Accepts data and instructions from the outside world and converts them into the binary form the machine can hold. Keyboard, mouse, scanner, microphone.
2. Memory unit (primary storage)
Holds four things while the computer works: the data waiting to be processed, the instructions of the program, the intermediate results, and the final results waiting to go out.
3. Arithmetic and Logic Unit (ALU)
Where the work happens. It performs
- arithmetic operations: , , ,
- logical operations: comparisons such as , , , and the Boolean operations AND, OR, NOT
Data is brought from memory into the ALU, operated on, and the result sent back.
4. Control Unit (CU)
The unit that manages the other four. It does not process data itself; it directs. For each instruction it repeats a cycle:
called the machine cycle or instruction cycle.
5. Output unit
Converts results from binary back into a form people can use — characters on a screen, ink on paper, sound from a speaker.
The CPU. The ALU and the CU together, plus a small set of registers, make up the Central Processing Unit — the processor. It is often called the brain of the computer, which flatters it: the CPU has no knowledge, only the ability to follow instructions very quickly.
Registers and why they exist
A register is a very small, very fast storage location inside the CPU that holds one item at a time. The CPU cannot work directly out of main memory at full speed, so values are staged in registers first.
| Register | Holds |
|---|---|
| PC — Program Counter | The address of the next instruction to be fetched |
| IR — Instruction Register | The instruction currently being executed |
| MAR — Memory Address Register | The memory address being read from or written to |
| MBR/MDR — Memory Buffer Register | The data just read from, or about to be written to, memory |
| Accumulator | The result of the current arithmetic or logic operation |
Buses
The units are joined by a bus — a set of parallel wires carrying signals. Three of them:
- Data bus — carries the data itself. Its width (8, 16, 32, 64 lines) is how many bits move at once.
- Address bus — carries the address of the memory location wanted. Its width fixes how much memory can be addressed: address lines reach locations.
- Control bus — carries the timing and command signals that say read, write, now.
Hardware, software and firmware
- Hardware — the physical parts you can touch.
- Software — the programs; instructions with no physical substance.
- Firmware — software stored permanently in a hardware chip (ROM), such as the BIOS. It sits between the two: written like software, delivered like hardware.
- Humanware / liveware — the people who operate the system.
A computer with no software is inert. Software with no hardware cannot run. The syllabus phrase for this is that they are complementary.
Worked examples
2 solvedEvery step is shown, in the order you would write it in an answer book.
Tracing one instruction through the machine cycle
Question
A program contains the instruction ADD the number in location 200 to the accumulator. Describe what each functional unit does, step by step.
Fetch — the control unit collects the instruction
The PC holds the address of this instruction. The CU copies that address into the MAR, memory returns the instruction into the MBR, and it is moved into the IR. The PC is then incremented so it points at the next instruction.
Decode — the control unit works out what is being asked
The CU examines the instruction in the IR and separates it into two parts: the operation code (ADD) and the operand address (200). It now knows it must fetch a value and hand it to the ALU.
Fetch the operand
Address is placed on the address bus, the control bus signals read, and the value stored there travels back along the data bus into the MBR.
Execute — the ALU does the arithmetic
The CU signals the ALU to add the value in the MBR to the value already in the accumulator. The addition itself is the only step in which data is actually changed.
Store the result
The sum stays in the accumulator, ready for the next instruction. Had the instruction been STORE, the result would travel back over the data bus to a memory location instead.
Repeat
Control returns to the CU, which reads the PC and begins the next fetch. The machine does nothing else, ever — it simply repeats this cycle billions of times a second.
Answer
Fetch (CU + memory + buses) → decode (CU) → fetch operand (memory) → execute (ALU) → store (accumulator/memory), then the cycle repeats.
NoteExam questions on the block diagram are really questions about this cycle. Learn the cycle and the diagram explains itself.
Reading a specification
Question
A processor has a -bit address bus and a -bit data bus. How much memory can it address, and how many bytes move in one transfer?
Address bus width fixes the number of locations
address lines can select distinct locations. With :
Convert to familiar units
Each location holds one byte, so
Data bus width fixes the transfer size
lines carry bits at once:
Read the meaning
This is exactly why 32-bit systems could not use more than 4 GB of RAM — not a licensing limit but an arithmetic one. Widening the address bus to lines raises the ceiling to bytes, or exbibytes.
Answer
bytes GB addressable; bytes per transfer.
Practice problems
6 with solutionsWork each one on paper first. The full solution — not just the answer — is one click away.
Define a computer and list its five characteristics with one line each.
Show solutionHide solution
Definition. A computer is an electronic device that accepts data and instructions as input, processes the data according to a stored program, produces output, and can store data and results for later use.
Characteristics.
- Speed — performs millions to billions of operations per second; timings are quoted in milli-, micro-, nano- and picoseconds.
- Accuracy — arithmetic is always correct; errors trace back to wrong input or wrong instructions (GIGO).
- Diligence — works indefinitely without tiredness, boredom or loss of concentration.
- Versatility — the same hardware performs completely different tasks because only the program changes.
- Storage capacity — stores very large volumes of data permanently and retrieves any item quickly.
Full marks usually need the limitations too: no intelligence of its own, no intuition, and no ability to handle a case the program does not cover.
Distinguish between hardware, software and firmware, with one example of each.
Show solutionHide solution
| Hardware | Software | Firmware | |
|---|---|---|---|
| Nature | Physical, tangible | Logical, intangible | Program held permanently in hardware |
| Made by | Manufacturing | Programming | Programming, then burnt into a chip |
| Changed by | Replacing a part | Installing a new version | Flashing the chip |
| Wears out? | Yes | No | No |
| Example | Keyboard, RAM, hard disk | Windows, MS Word, a C compiler | BIOS/UEFI, the program inside a washing machine's controller |
Firmware is the interesting case: it is written like software but delivered inside a hardware component, usually in ROM, and it is what allows the machine to start up before any real software has loaded.
Draw the block diagram of a digital computer and explain the function of each unit.
Show solutionHide solution
Block diagram.
Solid arrows show the flow of data; the control unit additionally sends control signals to every other unit.
1. Input unit. Accepts data and instructions from the user and converts them into binary form. Keyboard, mouse, scanner, microphone.
2. Memory unit. Primary storage. Holds the program being executed, the data it needs, intermediate results and the output waiting to be sent.
3. Arithmetic and Logic Unit. Carries out all arithmetic () and all logical operations (comparison, AND, OR, NOT). It is the only unit that changes data values.
4. Control unit. Directs and coordinates the whole system. It fetches each instruction, decodes it, and issues the control signals that cause it to be executed. It processes no data itself.
5. Output unit. Converts binary results into human-readable form — display, printer, speaker.
The ALU and CU together with the registers form the CPU.
What is the machine cycle? Name the registers involved and state what each holds.
Show solutionHide solution
The machine cycle (instruction cycle) is the sequence the control unit repeats for every instruction in a program:
- Fetch — bring the next instruction from memory into the CPU.
- Decode — separate it into operation code and operand, and work out what is required.
- Execute — the ALU performs the operation.
- Store — put the result in the accumulator or back into memory.
A program is nothing more than this cycle repeated once per instruction.
Registers involved.
| Register | Holds |
|---|---|
| Program Counter (PC) | Address of the next instruction |
| Instruction Register (IR) | The instruction currently being executed |
| Memory Address Register (MAR) | The address being read from or written to |
| Memory Buffer Register (MBR) | The data travelling to or from memory |
| Accumulator (AC) | The result of the current ALU operation |
Note that the PC is incremented during the fetch phase, not at the end — which is why a jump instruction works by overwriting the PC during execute.
What is a bus? Describe the three types and explain what the width of each determines.
Show solutionHide solution
A bus is a group of parallel conducting lines that carries signals between the functional units of a computer. Instead of a separate wire between every pair of components, all units share one set of lines.
1. Data bus. Carries the data and instructions themselves, in both directions (memory → CPU and CPU → memory). Its width is the number of bits transferred simultaneously — a -bit data bus moves bytes per transfer. A wider data bus therefore raises throughput.
2. Address bus. Carries the address of the memory location or device being accessed. It is unidirectional — only the CPU puts addresses on it. Its width fixes the addressable memory: lines give locations.
3. Control bus. Carries the command and timing signals that say what is to happen and when — read, write, interrupt, clock, reset. It is bidirectional, since devices also signal back to the CPU.
Summary: the data bus decides how much moves at a time, the address bus decides how much memory can exist, and the control bus decides when and what kind of transfer happens.
"A computer is fast and accurate but has no intelligence." Justify this statement with reference to GIGO.
Show solutionHide solution
The statement separates two different things: capability and judgement.
Fast and accurate. The circuits perform arithmetic in nanoseconds, and they perform it correctly every time. A computer will not misadd two numbers, will not lose concentration on the ten-millionth record, and will not produce a different answer on a Monday. This is a property of the hardware.
No intelligence. The machine has no idea what its numbers mean. It cannot notice that a date of birth in the year 2190 is impossible, that a salary of is nonsense, or that the user meant to type 100 rather than 1000 — unless a programmer has explicitly written an instruction to check for exactly that. It follows the instructions it is given, faithfully and literally, including instructions that are wrong.
GIGO — Garbage In, Garbage Out. This is the practical consequence. The accuracy of the output depends entirely on the accuracy of the input and of the program:
The second line is the danger. A wrong answer arrives with exactly the same speed, formatting and apparent authority as a right one. The machine offers no warning because it cannot tell the difference.
Consequence for practice. This is why real systems spend so much effort on validation (is this value of a plausible type and range?) and verification (was it entered as intended?), and why the responsibility for a wrong result always sits with the people who supplied the data or wrote the program — never with the computer.