Edexcel International Advanced Level Computer Science, point 1.1.3
A computer system built on von Neumann architecture (1.1.2) has four groups of internal components that work together: the CPU, memory, input/output and the buses that connect them.
a. Central processing unit (CPU)
- Definition: the component that fetches, decodes and executes instructions.
- Function: it carries out processing and controls the other components.
- Characteristics: it contains the control unit, the ALU and registers (1.1.4). Its speed depends on the clock speed, the number of cores and the cache.
- Why needed: without it, nothing would carry out the program's instructions or control the other parts.
b. Memory
Random access memory (RAM)
- Definition: main memory that holds the programs and data currently in use.
- Characteristics: volatile (contents are lost when power is off), read and write, and any location can be reached directly (randomly) in about the same time.
- Function: it gives the CPU fast working storage, much faster than secondary storage.
- Why needed: secondary storage is far too slow for the CPU, so the programs and data in use are copied into RAM, where the CPU can reach them quickly.
Read-only memory (ROM)
- Definition: memory whose contents are fixed in manufacture or can only be changed with difficulty.
- Characteristics: non-volatile (keeps its contents without power), and normally read only.
- Function: it holds the start-up instructions that run when the computer is switched on, such as the BIOS (basic input/output system), which checks the hardware and loads the operating system, and other firmware.
- Why needed: RAM is empty when the power comes on, so the instructions to start the computer must be kept somewhere non-volatile.
Cache
- Definition: a small amount of very fast memory between the CPU and RAM, holding copies of recently used or likely-to-be-used instructions and data.
- Characteristics: faster, smaller and more expensive per byte than RAM, and often on the CPU chip.
- Function: it reduces the time the CPU waits for RAM (see the memory hierarchy, 1.1.6).
- Why needed: the CPU is much faster than RAM, so without cache it would spend much of its time waiting.
- Operation: when the CPU needs an item, it checks the cache first. If the item is there (a cache hit), it is used straight away. If not (a cache miss), it is fetched from RAM, and a copy is kept in the cache for next time.
| Benefits of cache | Drawbacks of cache |
|---|---|
| Much faster for the CPU to reach than RAM | Expensive per byte, so it is small |
| Frequently used items are fetched quickly, so the CPU waits less | Takes up space on the CPU chip |
| Very close to the CPU (often on the same chip) | Only helps with frequently used items; others still come from RAM |
| RAM | ROM | Cache | |
|---|---|---|---|
| Volatile? | Yes | No | Yes |
| Read and write? | Yes | Normally read only | Yes |
| Speed | Fast | Slower than RAM | Fastest |
| Size | GBs | Small (MBs or less) | Small (KBs to MBs) |
| Holds | Programs and data in use | Start-up instructions | Copies of the most-used items |
c. Input/output (I/O)
- Definition: the parts that connect the computer to the outside world: input devices (keyboard, mouse, sensor) and output devices (screen, speaker, printer), and the I/O controllers and ports that connect them.
- Function: it lets data and instructions come in, and results go out. Devices are much slower than the CPU, so I/O controllers and interrupts are used (1.2).
- Why needed: without I/O, users couldn't give the computer data or see its results.
d. Buses
A bus is a set of parallel wires that carries signals between components. There are three.
| Bus | Carries | Direction | Width decides |
|---|---|---|---|
| Address bus | The address of the memory location or device being used | One way, from the CPU | The number of locations that can be addressed |
| Data bus | The data and instructions being moved | Both ways | How many bits move at once |
| Control bus | Control signals: read, write, clock, interrupt request, and so on | Both ways | The types of signal available |
Why needed: the components have to exchange addresses, data and control signals, and the buses are the paths that carry them.
Addressable memory
Each address is a binary number. An address bus that is bits wide can carry different addresses, so it can address memory locations.
If each location holds one byte, the memory size is bytes. If each location holds a word of bits, the memory is bits.
| Address bus width | Locations () | Memory (1 byte each) |
|---|---|---|
| 8 bits | 256 | 256 B |
| 16 bits | 65,536 | 64 KiB |
| 20 bits | 1,048,576 | 1 MiB |
| 32 bits | 4,294,967,296 | 4 GiB |
| 64 bits | 16 EiB (far more than is ever fitted) |
Doubling the memory needs one extra address line.
The sizes can be written two ways. bytes is bytes, which is 4 GiB (using powers of 2) or about 4.29 GB (using powers of 10). Both are correct, and you may see either.
Worked example
Task: a computer has a 24-bit address bus and a 16-bit data bus. Each memory location holds 16 bits. How many locations can be addressed, and what is the maximum memory size in bytes?
- Locations .
- Each location is 16 bits = 2 bytes.
- Memory bytes MiB.
The data bus width (16) says how much moves at once. It doesn't change the number of locations.
Exam tip: learn the direction of each bus: the address bus is one way (CPU to memory), the data bus is two way. For addressable memory, give the expression and the working. The address bus width sets the number of locations, and the data bus width sets the size of each transfer. Be able to fill in a diagram showing the components and buses.
Check yourself
Why is the address bus one-way but the data bus two-way?
Only the CPU sends addresses out, to say where to read or write. Data must travel both from memory to the CPU (read) and from the CPU to memory (write).
Give two differences between RAM and ROM
RAM is volatile and ROM is non-volatile; RAM can be read and written freely, but ROM is normally read only; RAM holds programs and data in use, and ROM holds start-up instructions.
How many memory locations can a 12-bit address bus address?
2¹² = 4096.
What is the purpose of cache memory?
To hold copies of recently or frequently used instructions and data in very fast memory, so the CPU waits less for RAM.
What does the control bus carry?
Control signals such as read, write, the clock and interrupt requests.