Cambridge O Level2210

Computer architecture

Computer Science 2210 Chapter Notes

What this chapter covers

Computer architectureInput and output devicesData storageNetwork hardware
ShareWhatsAppPost
Computer architecture notes

Unable to load PDF

The notes viewer could not load. Please refresh the page.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Computer architecture notes as text: skim, search, and jump between subtopics.

~15 min read

1. The CPU and Fetch-Decode-Execute Cycle

The Central Processing Unit (CPU) is often called the 'brain' of the computer. Its main job is to process all the data and instructions that make a computer work. It does this by continuously running a process called the Fetch-Decode-Execute cycle. This cycle is the fundamental operation of a CPU. It involves three main stages: 1. Fetch: The CPU retrieves the next instruction from memory (RAM). 2. Decode: The CPU's Control Unit interprets the instruction to understand what needs to be done. 3. Execute: The instruction is carried out. This might involve a calculation by the Arithmetic Logic Unit (ALU), moving data, or changing the state of the computer.

Key term

Central Processing Unit (CPU): The core component of a computer that receives and executes instructions, performing most of the processing.

Examiner insight

Examiners award marks for clearly linking each stage of the Fetch-Decode-Execute cycle to the specific actions performed and the components involved.

Common pitfall

Simply listing the words 'Fetch', 'Decode', 'Execute' without explaining what happens at each stage will not score full marks.

Worked example 13 marks

Describe the three stages of the Fetch-Decode-Execute cycle.

  1. 1

    Step 1: Fetch - The CPU fetches the next instruction from the memory address currently held in the Program Counter (PC). This instruction is copied to the CPU via the data bus.

  2. 2

    Step 2: Decode - The Control Unit (CU) within the CPU decodes the instruction. It determines what operation needs to be performed.

  3. 3

    Step 3: Execute - The instruction is carried out. This may involve the Arithmetic Logic Unit (ALU) performing a calculation, or data being moved between registers or memory.

Recap

  • The CPU is the brain of the computer, processing instructions.
  • The Fetch-Decode-Execute cycle is the basic process the CPU uses to run programs.
  • The Fetch stage retrieves an instruction from memory.
  • The Decode stage interprets what the instruction means.
  • The Execute stage carries out the instruction's command.

Quick check

  1. What is the common name for the component that processes all data and instructions in a computer?1 mark
  2. Which stage of the instruction cycle involves interpreting the instruction?1 mark

2. Inside the CPU: Von Neumann Architecture

Most modern computers are based on the Von Neumann architecture. This design states that both program instructions and data are stored in the same memory space and are treated the same way. The CPU contains several key components to manage this. The Control Unit (CU) acts like a traffic cop, directing the flow of data and coordinating the actions of the other components. The Arithmetic Logic Unit (ALU) performs all mathematical calculations (add, subtract) and logical operations (AND, OR, NOT). Registers are small, extremely fast memory locations inside the CPU used for temporary storage. Key registers include: Program Counter (PC) which holds the address of the next instruction; Memory Address Register (MAR) which holds the address of the memory location to be accessed; Memory Data Register (MDR) which holds the data being transferred to or from memory; and the Accumulator (ACC) which stores the results of calculations from the ALU.

Key term

Von Neumann Architecture: A computer architecture where program instructions and data are stored in the same memory, which is read by a CPU.

Examiner insight

For full marks on questions about CPU components, you must state both the full name of the component (e.g., Memory Address Register) and its specific function.

Common pitfall

Confusing the roles of the Memory Address Register (MAR), which holds the address, and the Memory Data Register (MDR), which holds the actual data or instruction.

Worked example 14 marks

A CPU needs to fetch an instruction from RAM. Describe the role of the Program Counter (PC), Memory Address Register (MAR), and Memory Data Register (MDR) in this process.

  1. 1

    Step 1: The address of the next instruction is stored in the Program Counter (PC).

  2. 2

    Step 2: The contents of the PC are copied to the Memory Address Register (MAR).

  3. 3

    Step 3: The instruction located at the address in the MAR is fetched from RAM.

  4. 4

    Step 4: This instruction is then copied into the Memory Data Register (MDR) before being sent to be decoded.

Recap

  • Von Neumann architecture stores instructions and data in the same memory.
  • The Control Unit (CU) directs all operations within the CPU.
  • The Arithmetic Logic Unit (ALU) performs calculations and logical comparisons.
  • Registers are small, fast memory locations within the CPU.
  • The PC holds the next instruction's address, the MAR holds the address to be accessed, and the MDR holds the data being transferred.

Quick check

  1. Which component of the CPU performs calculations?1 mark
  2. Which register holds the address of the next instruction to be fetched?1 mark

3. CPU Performance: Cores, Clock Speed, Cache

The performance of a CPU is not determined by a single factor, but by a combination of features. The three most important are Clock Speed, Number of Cores, and Cache Size. Clock Speed is the number of Fetch-Decode-Execute cycles the CPU can perform per second, measured in Gigahertz (GHz). A 3 GHz CPU can perform 3 billion cycles per second. A higher clock speed generally means faster processing. Cores are individual processing units within the CPU. A dual-core CPU has two processing units, a quad-core has four. More cores allow the CPU to perform multiple tasks simultaneously (parallel processing), which significantly improves performance in multitasking environments. Cache is a small amount of very fast, expensive memory located on the CPU itself. It stores frequently used instructions and data, so the CPU doesn't have to wait for them to be fetched from the much slower RAM. A larger cache size can lead to a big performance boost.

Key term

Clock Speed: The rate at which a processor can complete a processing cycle, measured in Hertz (Hz).

Examiner insight

When explaining why a CPU is faster, link each feature (e.g., more cores) to a specific performance benefit (e.g., better performance on multitasking).

Common pitfall

Stating that a higher clock speed 'makes the computer faster' without explaining that it means more instructions can be executed per second.

Fun fact

The first commercial microprocessor, the Intel 4004 from 1971, had a clock speed of 740 kHz. A modern 3.7 GHz CPU is over 5000 times faster in terms of clock speed alone.

Worked example 13 marks

A student is upgrading their PC. They are choosing between a 3.0 GHz dual-core CPU and a 2.8 GHz quad-core CPU. Explain which CPU would be better for playing a modern video game while also streaming the gameplay online.

  1. 1

    Step 1: The 2.8 GHz quad-core CPU would be better for this scenario.

  2. 2

    Step 2: Playing a game and streaming are two separate, intensive tasks. A quad-core CPU has four cores, allowing it to handle these multiple tasks in parallel more effectively than a dual-core CPU.

  3. 3

    Step 3: Although the clock speed is slightly lower, the ability to dedicate separate cores to the game and the streaming software will result in smoother overall performance and less lag.

Recap

  • CPU performance is affected by clock speed, number of cores, and cache size.
  • Clock speed determines how many instructions are executed per second.
  • More cores allow for better parallel processing and multitasking.
  • Cache is very fast memory on the CPU that stores frequently used data.
  • A balance of these three factors is key to overall performance.

Quick check

  1. What unit is used to measure clock speed?1 mark
  2. What is the main benefit of having a multi-core processor?1 mark

4. Primary Memory: RAM and ROM

Primary memory is the main memory in a computer system that is directly accessible by the CPU. There are two main types: RAM and ROM. Random Access Memory (RAM) is used to store the operating system, currently running applications, and the data they are using. RAM is volatile, which means its contents are lost when the computer is powered off. It is also read/write, meaning data can be both read from it and written to it. The more RAM a computer has, the more applications it can run smoothly at the same time. Read-Only Memory (ROM) is non-volatile, meaning it retains its data even when the power is off. It is read-only, so its contents cannot be easily changed. ROM contains the essential startup instructions for the computer, known as the BIOS (Basic Input/Output System) or bootstrap loader. This program checks the hardware and loads the operating system from the hard drive into RAM when the computer is turned on.

Key term

Volatile Memory: Memory that requires power to maintain the stored information; its contents are lost when power is turned off.

Examiner insight

Candidates must be able to clearly differentiate between RAM and ROM based on their purpose, volatility, and whether they are read/write or read-only.

Common pitfall

Confusing RAM and ROM. Remember 'RAM' for 'Running Applications and Memory' (which are temporary), and 'ROM' for 'Read-Only instructions for startup' (which are permanent).

Worked example 14 marks

Compare RAM and ROM. You should mention volatility, purpose, and whether data can be changed.

  1. 1

    Step 1: Volatility: RAM is volatile, meaning its contents are erased when power is turned off. ROM is non-volatile, so it retains its contents without power.

  2. 2

    Step 2: Purpose: RAM's purpose is to store the operating system, open programs and data currently in use. ROM's purpose is to store the computer's startup instructions (BIOS).

  3. 3

    Step 3: Data Modification: RAM is read/write, so data can be changed, added, and removed. ROM is read-only, so its contents are permanent and cannot be changed by the user.

Recap

  • Primary memory is directly accessed by the CPU and includes RAM and ROM.
  • RAM (Random Access Memory) is volatile and stores currently used programs and data.
  • ROM (Read-Only Memory) is non-volatile and stores the computer's bootup instructions.
  • RAM is read/write, while ROM is read-only.
  • Losing power erases everything in RAM, but not in ROM.

Quick check

  1. Is RAM volatile or non-volatile?1 mark
  2. What is the name of the program stored in ROM that starts the computer?1 mark

5. Secondary Storage

Secondary storage is non-volatile, long-term storage for programs and data. It's where your files, applications, and operating system are saved when the power is off. It is not directly accessed by the CPU. Data must first be copied from secondary storage into RAM to be used. There are three main types: Magnetic storage, like a Hard Disk Drive (HDD), uses spinning magnetic platters and a read/write head to store data by magnetising spots on the disk's surface. Optical storage, like CDs, DVDs, and Blu-ray discs, uses a laser to read tiny indentations (pits) and flat areas (lands) on the surface of a spinning disc. Solid-State storage, like a Solid-State Drive (SSD) or USB flash drive, uses flash memory chips. It has no moving parts, making it much faster, more durable, and quieter than an HDD.

Key term

Secondary Storage: Non-volatile storage that is not directly accessible by the CPU, used for long-term storage of files and programs.

Examiner insight

For questions on storage types, be prepared to compare them on criteria like speed, capacity, durability, portability and cost.

Fun fact

The first HDD, the IBM 350 Disk Storage Unit from 1956, was the size of two refrigerators and could store about 3.75 MB of data. A modern microSD card the size of a fingernail can store over 1 TB (a million times more).

Worked example 14 marks

A user is buying a new laptop. Explain two reasons why they might choose a laptop with a Solid-State Drive (SSD) instead of a Hard Disk Drive (HDD).

  1. 1

    Step 1: Faster access speeds. SSDs have no moving parts and use flash memory, allowing them to read and write data much faster than an HDD. This leads to faster boot times and application loading.

  2. 2

    Step 2: Increased durability. Because SSDs have no moving parts, they are more resistant to damage from being dropped or knocked, which is a significant advantage for a portable device like a laptop.

Worked example 23 marks

Describe how data is read from an optical disc.

  1. 1

    Step 1: The disc is spun at a high speed.

  2. 2

    Step 2: A laser beam is shone onto the surface of the disc.

  3. 3

    Step 3: The surface is covered in microscopic pits and lands. The laser light is reflected differently by pits and lands.

  4. 4

    Step 4: A sensor detects the changes in reflection, which are interpreted as binary 1s and 0s.

Recap

  • Secondary storage is for long-term, non-volatile data storage.
  • Data is copied from secondary storage to RAM for processing.
  • Magnetic storage (HDD) uses spinning platters and is cheap with high capacity.
  • Optical storage (CD/DVD) uses a laser to read pits and lands.
  • Solid-state storage (SSD) uses flash memory, is very fast, and has no moving parts.

Quick check

  1. Give one example of magnetic storage.1 mark
  2. Which type of secondary storage has no moving parts?1 mark

6. Virtual Memory and Cloud Storage

Sometimes, a computer's RAM becomes full. To handle this, the operating system can use Virtual Memory. This is a technique where a portion of the secondary storage (like the HDD or SSD) is set aside to be used as an extension of RAM. When RAM is full and a new program needs to be loaded, the OS moves the least-used data from RAM into this space on the hard drive (called the paging file or swap file). This frees up RAM for the new task. However, accessing the hard drive is much slower than accessing RAM, so heavy use of virtual memory can cause the computer to slow down noticeably, a phenomenon known as 'disk thrashing'.

Cloud Storage is a different concept. It involves storing your data on remote servers owned and maintained by a third-party company (like Google Drive or Dropbox), which you access over the internet. Advantages include being able to access your files from any device with an internet connection, easy sharing, and automatic backups. Disadvantages include needing a constant internet connection to access files, potential security and privacy risks, and ongoing subscription costs.

Key term

Virtual Memory: A memory management technique where secondary storage is used as if it were part of the main memory (RAM).

Examiner insight

Examiners expect students to understand that virtual memory is a solution to a lack of RAM but comes with a significant performance penalty.

Common pitfall

Thinking virtual memory is a physical type of memory. It's a technique that uses part of the secondary storage (e.g., HDD or SSD).

Worked example 13 marks

A user is editing a large video file and their computer becomes very slow and the hard drive light is constantly flashing. Explain why using virtual memory is likely the cause.

  1. 1

    Step 1: Video editing is a RAM-intensive task. The user's RAM has likely become full.

  2. 2

    Step 2: The operating system is now using virtual memory, moving data between RAM and the much slower hard drive to make space.

  3. 3

    Step 3: This constant swapping of data (known as paging or thrashing) is causing the slowdown, and the flashing hard drive light indicates it is being accessed continuously.

Worked example 22 marks

State one advantage and one disadvantage of using cloud storage compared to local storage.

  1. 1

    Step 1: Advantage: Accessibility. Files can be accessed from any device with an internet connection, anywhere in the world.

  2. 2

    Step 2: Disadvantage: Requires an internet connection. If you have no internet, you cannot access your files.

Recap

  • Virtual memory uses secondary storage as an extension of RAM when RAM is full.
  • Accessing virtual memory is significantly slower than accessing RAM.
  • Cloud storage means storing data on remote servers accessed via the internet.
  • Advantages of cloud storage include accessibility and easy sharing.
  • Disadvantages of cloud storage include dependency on internet and potential security issues.

Quick check

  1. When is virtual memory used by the operating system?1 mark
  2. State one advantage of using cloud storage.1 mark

7. Embedded Systems

Not all computers are general-purpose machines like PCs or laptops. An embedded system is a combination of computer hardware and software designed to perform a specific, dedicated function within a larger mechanical or electrical system. They are all around us. For example, the computer inside a washing machine only runs the washing cycles; it cannot be used to browse the internet. The system inside a digital watch only tells the time and runs a stopwatch; it cannot run word processing software. Key characteristics of an embedded system are that they have a specific task, are not usually programmable by the end-user, and often need to respond to events in real-time. They typically use a microprocessor, which is a less complex version of a CPU, along with memory and input/output peripherals tailored to their task.

Key term

Embedded System: A computer system with a dedicated function within a larger mechanical or electrical system.

Examiner insight

To get marks, you must be able to give clear examples of embedded systems and explain why they are 'embedded' (i.e., part of a larger device with a single purpose).

Common pitfall

Confusing a device that has an embedded system (like a washing machine) with the embedded system itself (the control unit inside it).

Fun fact

The average modern car has over 100 microprocessors running in various embedded systems, controlling everything from the radio and air conditioning to the anti-lock brakes and airbags.

Worked example 13 marks

Identify two devices, other than a washing machine, that contain an embedded system. For one of these devices, describe the purpose of the embedded system.

  1. 1

    Step 1: Two devices are a digital camera and a microwave oven.

  2. 2

    Step 2: Device: Digital camera.

  3. 3

    Step 3: Purpose: The embedded system in a digital camera controls the settings (e.g., aperture, shutter speed), processes the image from the sensor, and saves it to the memory card.

Recap

  • An embedded system is a computer designed for one specific task.
  • It is part of a larger device, like a microwave or a car.
  • Embedded systems are not general-purpose computers.
  • They use a microprocessor and are typically not programmable by the user.
  • Examples include traffic lights, digital watches, and engine management systems.

Quick check

  1. Is a laptop an example of an embedded system? Explain why or why not.2 marks

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. Describe the role of the Control Unit (CU) and the Arithmetic Logic Unit (ALU) in a CPU.4 marks
  2. A computer uses Von Neumann architecture. Describe the steps involved in fetching an instruction from memory, mentioning the Program Counter, MAR, and MDR.5 marks
  3. Explain the difference between RAM and ROM, stating an example of what is stored in each.4 marks
  4. Give two reasons why a solid-state drive (SSD) generally offers better performance than a hard disk drive (HDD).2 marks
  5. A user's computer is running slowly. Explain how a lack of RAM and the use of virtual memory could be the cause.3 marks
  6. What is an embedded system? Give two examples of devices that contain an embedded system.3 marks
  7. A photographer is choosing between local storage and cloud storage for their photos. Give one advantage and two disadvantages of using cloud storage.3 marks
  8. Explain how clock speed and the number of cores affect a CPU's performance.4 marks
  9. Describe how data is stored and read on magnetic storage, such as a Hard Disk Drive.4 marks
  10. A CPU needs to add two numbers together. Describe the role of the Accumulator (ACC) in this process.2 marks

Go deeper

Practise and revise with member-only material for this chapter.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters