Ruled

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.

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

CharacteristicWhat it means
SpeedOperations are measured in millions or billions per second. Time is quoted in milliseconds ( s), microseconds ( s), nanoseconds ( s) and picoseconds ( s).
AccuracyThe machine does not make arithmetic mistakes. Wrong output comes from wrong input or wrong instructions — GIGO, garbage in, garbage out.
DiligenceNo tiredness, no boredom, no loss of concentration. The ten-millionth calculation gets the same care as the first.
VersatilityThe same hardware runs a payroll, edits a photograph and plays music, because only the program changes.
Storage capacityVast 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.

RegisterHolds
PC — Program CounterThe address of the next instruction to be fetched
IR — Instruction RegisterThe instruction currently being executed
MAR — Memory Address RegisterThe memory address being read from or written to
MBR/MDR — Memory Buffer RegisterThe data just read from, or about to be written to, memory
AccumulatorThe 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 solved

Every step is shown, in the order you would write it in an answer book.

Example 1

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

Example 2

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?

  1. Address bus width fixes the number of locations

    address lines can select distinct locations. With :

  2. Convert to familiar units

    Each location holds one byte, so

  3. Data bus width fixes the transfer size

    lines carry bits at once:

  4. 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 solutions

Work each one on paper first. The full solution — not just the answer — is one click away.

Problem 1Basic

Define a computer and list its five characteristics with one line each.

Show 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.

  1. Speed — performs millions to billions of operations per second; timings are quoted in milli-, micro-, nano- and picoseconds.
  2. Accuracy — arithmetic is always correct; errors trace back to wrong input or wrong instructions (GIGO).
  3. Diligence — works indefinitely without tiredness, boredom or loss of concentration.
  4. Versatility — the same hardware performs completely different tasks because only the program changes.
  5. 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.

AnswerSpeed, accuracy, diligence, versatility, storage capacity.
Problem 2Basic

Distinguish between hardware, software and firmware, with one example of each.

Show solution
HardwareSoftwareFirmware
NaturePhysical, tangibleLogical, intangibleProgram held permanently in hardware
Made byManufacturingProgrammingProgramming, then burnt into a chip
Changed byReplacing a partInstalling a new versionFlashing the chip
Wears out?YesNoNo
ExampleKeyboard, RAM, hard diskWindows, MS Word, a C compilerBIOS/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.

AnswerHardware is physical; software is the programs; firmware is software permanently stored in a hardware chip, e.g. the BIOS.
Problem 3Exam level

Draw the block diagram of a digital computer and explain the function of each unit.

Show 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.

AnswerFive units: input, memory, ALU, control unit, output — with ALU + CU forming the CPU.
Problem 4Exam level

What is the machine cycle? Name the registers involved and state what each holds.

Show 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.

RegisterHolds
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.

AnswerFetch → decode → execute → store, using PC, IR, MAR, MBR and the accumulator.
Problem 5Exam level

What is a bus? Describe the three types and explain what the width of each determines.

Show 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.

AnswerData bus (width = bits per transfer), address bus (width = addressable locations), control bus (timing and command signals).
Problem 6Challenge

"A computer is fast and accurate but has no intelligence." Justify this statement with reference to GIGO.

Show 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.

AnswerSpeed and accuracy are hardware properties; correctness of meaning depends wholly on the input and the program, so wrong input yields wrong output delivered with full confidence — GIGO.