IB Computer Science · A1 · Computer fundamentals
A1.1 Computer hardware and operation
Describe the main components of a computer system, explain how the CPU runs instructions, compare RAM and ROM, and identify common input, output and storage devices.
1/5A computer system is built from a few core components
Part 1 of 5: A computer system is built from a few core components
When you type a message, several parts of a computer work together. Some take in data, one processes it, and others store or show the result. The physical parts make up the hardware. Software, meaning the programs, tells the hardware what to do.
The central processing unit (CPU) carries out program instructions. It reads them from main memory, which holds the programs and data currently in use. Input devices send data in, and output devices present results. Storage keeps data when the power is off.
Key terms · tap one for its definition
hardware
Hardware is the set of physical components of a computer system, such as the processor, memory and devices.
central processing unit
The central processing unit (CPU) is the component that fetches, decodes and executes program instructions.
Part 2 of 5: The CPU contains a control unit, an ALU and registers
Now look inside the CPU, where three parts do most of the work. The control unit directs the flow of data and signals the other parts when to act. The arithmetic logic unit (ALU) carries out calculations and logical comparisons.
Each small storage location inside the CPU is called a register. Registers hold the instruction, data or address being used at that moment. Registers are much faster than main memory, but there are very few of them.
Key terms · tap one for its definition
control unit
The control unit is the part of the CPU that directs the fetching, decoding and execution of instructions.
arithmetic logic unit
The arithmetic logic unit (ALU) is the part of the CPU that performs arithmetic operations and logical comparisons.
register
A register is a very small, very fast storage location inside the CPU that holds an instruction, data or an address.

Quick check
One question on the part you just read
Easy
Show answer and explanation
Answer: D · Worked explanation
Part 3 of 5: Each instruction passes through fetch, decode and execute
Now that the parts are named, follow one instruction through them. The fetch–decode–execute cycle is how the CPU runs a program, one instruction at a time. A register called the program counter holds the address of the next instruction.
- Fetch: the instruction at that address is copied from memory into the CPU, and the counter moves on.
- Decode: the control unit works out which operation is needed and which data it uses.
- Execute: the ALU or another part carries out the operation and stores the result.
Key terms · tap one for its definition
fetch–decode–execute cycle
The fetch–decode–execute cycle is the repeated sequence in which the CPU fetches an instruction from memory, decodes it and executes it.
program counter
The program counter is a register that holds the memory address of the next instruction to be fetched.
Part 4 of 5: RAM and ROM differ in volatility and purpose
The CPU needs somewhere to find its instructions, which brings us to memory. RAM is the main memory that holds programs and data while they are in use. It can be read and written quickly, but it is volatile, so it loses its contents when power is removed.
ROM holds instructions that must stay in place, such as the code that starts a computer. Its contents survive when power is removed, and they are not normally changed during use.
RAM compared with ROM
- Feature
- Contents when power is removed
- RAM
- Lost
- ROM
- Kept
- Feature
- Normal use
- RAM
- Read and written
- ROM
- Read only
- Feature
- Typical contents
- RAM
- Programs and data in use
- ROM
- Start-up instructions
Key terms · tap one for its definition
RAM
RAM (random-access memory) is the main memory that holds the programs and data currently in use and can be read and written.
volatile
Volatile memory is memory that loses its stored contents when the power supply is removed.
ROM
ROM (read-only memory) is non-volatile memory that holds fixed instructions, such as start-up code, and is not normally written to during use.

Quick check
One question on the part you just read
Easy
Show answer and explanation
Answer: C · Worked explanation
Part 5 of 5: Devices move data into, out of and around a computer
Data has to reach the computer, and results have to come back out. An input device sends data to the computer, such as a keyboard, mouse, microphone or camera. An output device presents results to the user, such as a monitor, speaker or printer.
Long-term data lives in secondary storage, which keeps programs and files when the power is off. Examples are a hard disk drive, a solid-state drive and an optical disc.
A solid-state drive has no moving parts and reads quickly. A hard disk drive uses spinning magnetic platters and usually costs less per gigabyte.
Key terms · tap one for its definition
input device
An input device is a hardware device that sends data from the user or the environment into a computer.
output device
An output device is a hardware device that presents the results of processing to the user.
secondary storage
Secondary storage is non-volatile storage, separate from main memory, that keeps programs and files for long-term use.
Check your recall[15 marks]
6 written questions. Answer each one in your head or on paper, then open the mark scheme.
- 1.Describe[2 marks]
Describe the roles of the control unit and the arithmetic logic unit in the CPU.
Show mark schemeHide mark scheme
Model answer
The control unit directs the fetching, decoding and execution of instructions and signals the other parts. The ALU carries out arithmetic operations and logical comparisons.
- 1 mark for stating that the control unit directs or coordinates the steps of processing
- 1 mark for stating that the ALU performs calculations and logical comparisons
- 2.Outline[3 marks]
Outline the fetch–decode–execute cycle.
Show mark schemeHide mark scheme
Model answer
The instruction at the address held in the program counter is fetched from memory. The control unit decodes it to find the operation needed. The operation is then executed, for example by the ALU.
- 1 mark for stating that the instruction is fetched from memory using the address in the program counter
- 1 mark for stating that the instruction is decoded to work out the operation and data needed
- 1 mark for stating that the operation is then executed
- 3.Distinguish[3 marks]
Distinguish between RAM and ROM.
Show mark schemeHide mark scheme
Model answer
RAM holds programs and data in use, can be read and written, and is volatile. ROM holds fixed instructions such as start-up code, is normally read only, and keeps its contents when power is removed.
- 1 mark for stating that RAM is volatile but ROM keeps its contents without power
- 1 mark for stating that RAM is read and written but ROM is normally only read
- 1 mark for giving the typical contents of each, such as programs in use for RAM and start-up instructions for ROM
- 4.Explain[3 marks]
Explain why a computer needs secondary storage as well as RAM.
Show mark schemeHide mark scheme
Model answer
RAM is volatile, so it loses its contents when power is removed. Secondary storage keeps programs and files without power. The computer can then load them into RAM again when it is next used.
- 1 mark for stating that RAM loses its contents when power is removed
- 1 mark for stating that secondary storage keeps programs and files without power
- 1 mark for linking this to files being available again after the computer is switched off
- 5.Identify[3 marks]
Identify one input device, one output device and one secondary storage device.
Show mark schemeHide mark scheme
Model answer
Input device: a keyboard. Output device: a monitor. Secondary storage device: a solid-state drive.
- 1 mark for identifying a correct input device such as a keyboard, mouse or microphone
- 1 mark for identifying a correct output device such as a monitor, speaker or printer
- 1 mark for identifying a correct secondary storage device such as a hard disk drive or solid-state drive
- 6.State[1 mark]
State the role of the program counter.
Show mark schemeHide mark scheme
Model answer
It holds the address of the next instruction to be fetched.
- 1 mark for stating that it holds the memory address of the next instruction

Practice this topic
10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)
0 right0 of 10 answered
Includes the 2 quick checks in the note above.
EasyIdentify[1 mark]
Show answer and explanation
Answer: B · Worked explanation
MediumPredict[1 mark]
Show answer and explanation
Answer: C · Worked explanation
Medium[1 mark]
Show answer and explanation
Answer: A · Worked explanation
MediumIdentify[1 mark]
Show answer and explanation
Answer: B · Worked explanation
MediumPredict[1 mark]
Show answer and explanation
Answer: D · Worked explanation
Hard[2 marks]
Show answer and explanation
Answer: A · Worked explanation
HardDeduce[2 marks]
Show answer and explanation
Answer: C · Worked explanation
Hard[2 marks]
Show answer and explanation
Answer: D · Worked explanation