Cambridge IGCSE0478

Computer architecture

Computer Science 0478 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.

~16 min read

1. The CPU and Von Neumann Architecture

The Central Processing Unit (CPU) is often called the 'brain' of the computer. Its main job is to process all data and instructions. Most modern computers use the Von Neumann architecture, a design where both program instructions and the data they use are stored together in the same primary memory (RAM). The CPU contains several key components to help it work. The Control Unit (CU) manages the flow of data, directs the operations of the processor, and tells the other components what to do. The Arithmetic Logic Unit (ALU) performs all mathematical calculations (like addition and subtraction) and logical operations (like AND, OR, and NOT).

Key term

Von Neumann Architecture: A computer architecture where program instructions and data are stored in the same memory, ready to be processed by the CPU.

Examiner insight

Examiners expect you to clearly distinguish between the roles of the Control Unit (managing and directing) and the Arithmetic Logic Unit (calculating and comparing).

Common pitfall

Mixing up the CU and ALU. Remember: 'Arithmetic' in ALU tells you it does the maths, while the CU 'Controls' everything.

Fun fact

The Von Neumann architecture was first described in a 1945 report for the EDVAC computer. This single design principle still underpins almost every computer, smartphone, and tablet you use today.

Worked example 14 marks

A computer's CPU contains the Control Unit (CU) and the Arithmetic Logic Unit (ALU). Describe the function of each component. [4]

  1. 1
    1. The Control Unit (CU) manages the execution of instructions. It sends control signals to other parts of the CPU and the rest of the computer. [1 mark]
  2. 2
    1. The CU fetches instructions from memory, decodes them, and directs the necessary components to carry them out. [1 mark]
  3. 3
    1. The Arithmetic Logic Unit (ALU) is responsible for performing all calculations. This includes arithmetic operations like addition and subtraction. [1 mark]
  4. 4
    1. The ALU also performs all logical comparisons, such as checking if one value is greater than, less than, or equal to another. [1 mark]

Recap

  • The CPU processes all data and instructions in a computer.
  • Von Neumann architecture stores programs and data in the same memory.
  • The Control Unit (CU) directs the flow of data and instructions.
  • The Arithmetic Logic Unit (ALU) performs all calculations and logical comparisons.

Quick check

  1. Which part of the CPU would be used to work out '5 + 3'?1 mark
  2. Which part of the CPU directs the fetch-decode-execute cycle?1 mark

2. The Fetch-Decode-Execute Cycle

The CPU processes instructions using a continuous three-step process called the Fetch-Decode-Execute cycle. This cycle is the fundamental operation of a computer. It uses special storage locations inside the CPU called registers. The main steps are: 1. Fetch: The address of the next instruction is copied from the Program Counter (PC) to the Memory Address Register (MAR). The instruction at that address is then copied from RAM into the Memory Data Register (MDR) and then into the Current Instruction Register (CIR). Finally, the PC is incremented to point to the next instruction. 2. Decode: The Control Unit (CU) examines the instruction in the CIR. It interprets what needs to be done, such as 'add' or 'load data'. 3. Execute: The decoded instruction is carried out. This might involve the ALU performing a calculation, data being moved between registers, or data being written back to memory. The result of a calculation is often stored in a register called the Accumulator (ACC).

Key term

Program Counter (PC): A register in the CPU that holds the memory address of the next instruction to be fetched from primary memory.

Examiner insight

For high marks, you must describe the role of specific registers (PC, MAR, MDR, CIR) at each stage of the cycle, not just give a vague overview.

Common pitfall

Forgetting to mention that the Program Counter (PC) is incremented during the fetch stage. This is a crucial step to ensure the CPU processes instructions in the correct sequence.

Worked example 15 marks

Describe the 'Fetch' and 'Decode' stages of the fetch-decode-execute cycle, mentioning the registers involved. [5]

  1. 1

    Fetch Stage:

  2. 2
    1. The address of the next instruction is copied from the Program Counter (PC) to the Memory Address Register (MAR). [1 mark]
  3. 3
    1. The instruction stored at the address in the MAR is fetched from memory and placed in the Memory Data Register (MDR). [1 mark]
  4. 4
    1. The instruction is then copied from the MDR to the Current Instruction Register (CIR). [1 mark]
  5. 5
    1. The value in the PC is incremented by one. [1 mark]
  6. 6

    Decode Stage:

  7. 7
    1. The Control Unit (CU) interprets the instruction that is now stored in the CIR to determine what needs to be done. [1 mark]

Recap

  • The Fetch-Decode-Execute cycle is how the CPU processes instructions.
  • The Fetch stage retrieves an instruction from memory.
  • The Decode stage interprets what the instruction means.
  • The Execute stage carries out the instruction.
  • Key registers used include the PC, MAR, MDR, and CIR.

Quick check

  1. Which register holds the instruction while it is being decoded?1 mark
  2. What is the purpose of incrementing the Program Counter?1 mark

3. Factors Affecting CPU Performance

How fast a computer feels depends heavily on its CPU's performance. Three main factors determine this: 1. Clock Speed: This is the number of 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 means more instructions can be processed in a given time. 2. Number of Cores: A core is a single processing unit within the CPU. A dual-core CPU has two processing units, a quad-core has four, and so on. Multiple cores allow the CPU to perform multiple tasks simultaneously (parallel processing), which can significantly speed up performance, especially when multitasking. 3. Cache Size: Cache is a small amount of very fast, expensive memory located directly on the CPU chip. It stores frequently used instructions and data. A larger cache means more data can be accessed quickly without having to go to the much slower RAM, which boosts overall speed.

Key term

Clock Speed: The number of fetch-decode-execute cycles a CPU can perform per second, measured in Hertz (Hz).

Examiner insight

When explaining why more cores improve performance, use phrases like 'parallel processing' or 'simultaneous execution of tasks' to show a deeper understanding.

Common pitfall

Stating that a dual-core CPU is simply 'twice as fast' as a single-core one. The actual performance gain depends on whether the software is designed to use multiple cores.

Fun fact

The world's fastest supercomputer, Frontier, has over 8.7 million CPU cores, allowing it to perform over a quintillion (a billion billion) calculations per second!

Worked example 14 marks

A student is choosing between two CPUs. CPU A is a 3.2 GHz dual-core processor with 4MB of cache. CPU B is a 2.8 GHz quad-core processor with 8MB of cache. Explain two reasons why CPU B is likely to offer better performance. [4]

  1. 1
    1. CPU B has more cores (quad-core vs dual-core). This means it can execute more instructions at the same time / perform parallel processing. [1 mark] This will improve performance on tasks that can be split up, such as video editing or running multiple applications. [1 mark]
  2. 2
    1. CPU B has a larger cache size (8MB vs 4MB). [1 mark] This means more frequently accessed data and instructions can be stored in the faster cache memory, reducing the need to access the slower RAM, which speeds up processing. [1 mark]

Recap

  • Higher clock speed means more instructions processed per second.
  • More cores allow for parallel processing of multiple tasks.
  • Larger cache size reduces the time spent accessing slower RAM.
  • All three factors (clock speed, cores, cache) contribute to overall CPU performance.

Quick check

  1. A CPU has a clock speed of 4.0 GHz. How many cycles can it perform per second?1 mark
  2. What is the main advantage of having a multi-core processor?1 mark

4. Embedded Systems and Sensors

An embedded system is a computer system with a dedicated function within a larger mechanical or electrical system. Unlike a general-purpose computer (like a PC), an embedded system is designed to do one specific job. Examples are found everywhere: in a washing machine to control wash cycles, in a digital watch, or in a car's engine management system. They often use a simpler processor called a microprocessor. Sensors are input devices used by computer systems (including embedded systems) to measure physical properties from the real world. They convert an analogue measurement (like temperature or light level) into a digital signal the computer can process. Common sensors include: Temperature sensors (in thermostats), Light sensors (in automatic streetlights), Pressure sensors (in weather stations), and Infrared sensors (in security alarms to detect movement).

Key term

Embedded System: A computer system with a dedicated function, built into a larger device, such as a washing machine or a car.

Examiner insight

When asked for an example of an embedded system, be specific. 'A car' is too vague; 'A car's engine management system' or 'An anti-lock braking system' are better answers.

Common pitfall

Confusing a microprocessor (used in embedded systems) with a CPU (used in general-purpose computers). A microprocessor is typically less powerful and designed for a specific task.

Fun fact

The average modern car can have over 100 embedded systems, controlling everything from the radio and air conditioning to safety features like airbags and ABS.

Worked example 13 marks

a) What is an embedded system? [1]b) Give two examples of devices that contain an embedded system. [2]

  1. 1

    a) An embedded system is a computer system designed for a specific function within a larger device. [1 mark]

  2. 2

    b) Example 1: A washing machine (to control cycles). [1 mark]

  3. 3

    b) Example 2: A digital camera (to control focus and settings). (Other valid examples: microwave oven, GPS navigator, traffic lights). [1 mark]

Worked example 22 marks

For each scenario, identify the most appropriate sensor.i) To automatically turn on lights when it gets dark. ii) To detect an intruder in a room based on body heat. [2]

  1. 1

    i) A light sensor. [1 mark]

  2. 2

    ii) An infrared (or motion) sensor. [1 mark]

Recap

  • An embedded system is a dedicated computer within a larger device.
  • Examples of embedded systems include washing machines, digital cameras, and engine management systems.
  • Sensors are input devices that measure physical data from the environment.
  • Common sensors include light, temperature, pressure, and infrared sensors.

Quick check

  1. Is a laptop an example of an embedded system? Explain your answer.2 marks
  2. What type of sensor would be used in a digital thermostat?1 mark

5. Primary Memory: RAM and ROM

Primary memory is the main memory in a computer 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 programs, and any data the computer is actively using. It is volatile, which means all its contents are lost when the computer is turned off. You can both read data from and write data to RAM. The more RAM a computer has, the more applications it can run smoothly at once. Read-Only Memory (ROM) is non-volatile, meaning it keeps its contents even when the power is off. It contains the essential startup instructions for the computer, known as the BIOS (Basic Input/Output System) or bootstrap loader. As the name suggests, this data is 'read-only' and cannot normally be changed by the user.

Key term

Volatile Memory: Memory that requires power to maintain the stored information and loses its contents when the power is turned off.

Examiner insight

Be precise about what is stored in RAM (current programs/data) versus what is stored in ROM (startup instructions/BIOS). Marks are often awarded for this specific knowledge.

Common pitfall

Confusing RAM and ROM. A good way to remember is that you need RAM to 'run' your programs, while ROM is 'read-only' and just gets the computer started.

Worked example 14 marks

Compare RAM and ROM by explaining two differences between them. [4]

  1. 1
    1. RAM is volatile, meaning its contents are lost when the power is turned off. [1 mark] In contrast, ROM is non-volatile, so it retains its data without power. [1 mark]
  2. 2
    1. RAM is used to store the operating system and currently running applications and data. [1 mark] ROM is used to store the computer's startup instructions (BIOS/bootstrap loader). [1 mark]
  3. 3

    (Alternative point) RAM is read/write, meaning data can be changed. ROM is read-only, meaning its contents are permanent and cannot be easily changed.

Recap

  • Primary memory (RAM and ROM) is directly accessed by the CPU.
  • RAM is volatile memory that stores currently running programs and data.
  • ROM is non-volatile memory that stores the computer's startup instructions.
  • Volatile memory loses data when power is off; non-volatile memory does not.

Quick check

  1. When you open a web browser, is it loaded into RAM or ROM?1 mark
  2. What does it mean for memory to be 'non-volatile'?1 mark

6. Secondary Storage Devices

Secondary storage is non-volatile, long-term storage for your files, applications, and operating system. It's where your data is kept when the computer is off. The CPU does not access it directly; data must first be copied into RAM. There are three main types: 1. Magnetic Storage (e.g., Hard Disk Drive - HDD): Uses spinning magnetic platters and a moving read/write head to store data. They offer huge capacities for a low price but are relatively slow and can be damaged by knocks due to their moving parts. 2. Optical Storage (e.g., CD, DVD, Blu-ray): Uses a laser to read and write data as microscopic pits and lands on the surface of a spinning disc. They are cheap and portable but have small capacities and are slower than other types. 3. Solid-State Storage (e.g., Solid-State Drive - SSD, USB flash drive): Uses flash memory chips (NAND) with no moving parts. This makes them extremely fast, durable, and silent. Their main drawback is that they are more expensive per gigabyte than HDDs.

Key term

Solid-State Drive (SSD): A non-volatile storage device that uses flash memory to store data persistently, offering much faster access times than a traditional hard disk drive.

Examiner insight

For questions about how storage media work, examiners look for key technical terms like 'magnetic platters' and 'read/write head' for HDDs, or 'pits and lands' and 'laser' for optical discs.

Common pitfall

Confusing solid-state drives (SSDs) with RAM. Although both use solid-state technology, an SSD is non-volatile secondary storage, while RAM is volatile primary memory.

Fun fact

A single Blu-ray disc can hold up to 100GB of data, which is equivalent to the storage capacity of over 140 CDs!

Worked example 14 marks

Describe how data is read from an optical disc, such as a CD-ROM. [4]

  1. 1
    1. The disc is spun at high speed in the disc drive. [1 mark]
  2. 2
    1. A laser beam is shone onto the surface of the disc. [1 mark]
  3. 3
    1. The surface is covered in microscopic pits and lands. The laser light is reflected differently from a pit than from a land. [1 mark]
  4. 4
    1. A sensor detects the changes in reflected light, which are interpreted as binary 1s and 0s. [1 mark]

Worked example 22 marks

Give two reasons why a user might choose to install their operating system on a Solid-State Drive (SSD) instead of a Hard Disk Drive (HDD). [2]

  1. 1
    1. An SSD has much faster data access speeds, which means the computer will boot up much quicker. [1 mark]
  2. 2
    1. An SSD has no moving parts, making it more reliable and durable than an HDD, which is important for storing the OS. [1 mark]

Recap

  • Secondary storage is non-volatile memory for long-term data storage.
  • Magnetic storage (HDD) is cheap with high capacity but is slow and has moving parts.
  • Optical storage (CD/DVD) uses a laser to read pits and lands on a disc.
  • Solid-state storage (SSD) is very fast and durable because it has no moving parts.

Quick check

  1. State the three main categories of secondary storage.3 marks
  2. Which type of storage has no moving parts?1 mark

7. Virtual Memory and Cloud Storage

Sometimes, a computer needs more RAM than it physically has. Virtual Memory is a solution where a section of secondary storage (usually the hard drive or SSD) is used as a temporary extension of RAM. When RAM becomes full, the operating system moves inactive data and programs from RAM to a 'paging file' or 'swap file' on the secondary storage device. This frees up space in RAM for new data. While this allows you to run more applications at once, it comes at a cost: accessing data from secondary storage is significantly slower than accessing RAM, which can slow down the computer. Cloud Storage is a modern way to store data. Instead of saving files on your local device, you upload them over the internet to remote servers owned by a third-party company (like Google Drive or Dropbox). Key advantages include being able to access your files from any device with an internet connection and automatic backups. However, disadvantages include the need for a constant internet connection, potential security risks, and ongoing subscription fees.

Key term

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

Examiner insight

When explaining virtual memory, clearly state that it is slower than RAM and that this performance hit (sometimes called 'disk thrashing') is its main drawback.

Common pitfall

Thinking virtual memory is a physical component you can buy. It's a memory management technique that uses part of your existing hard drive or SSD.

Worked example 13 marks

Explain what virtual memory is and why it is needed. [3]

  1. 1
    1. Virtual memory is a section of the hard drive (or other secondary storage) that is used as an extension of RAM. [1 mark]
  2. 2
    1. It is needed when the physical RAM is full, but the user wants to load more programs or data. [1 mark]
  3. 3
    1. The operating system moves inactive data from RAM to virtual memory to free up space for active processes. [1 mark]

Worked example 22 marks

A company is considering moving its file storage from local servers to the cloud. State one advantage and one disadvantage of this approach. [2]

  1. 1
    1. Advantage: Employees can access files from anywhere with an internet connection, which is good for remote working. (Other valid answers: disaster recovery, no need to maintain hardware). [1 mark]
  2. 2
    1. Disadvantage: A reliable internet connection is required to access files, and without it, work can stop. (Other valid answers: security/privacy concerns, ongoing subscription costs). [1 mark]

Recap

  • Virtual memory uses secondary storage to extend RAM when it is full.
  • Using virtual memory is much slower than using physical RAM.
  • Cloud storage means saving data on remote servers via the internet.
  • Cloud storage offers great accessibility but requires an internet connection and poses potential security concerns.

Quick check

  1. What is the main drawback of using virtual memory?1 mark
  2. Give one reason why a business might use cloud storage for backups.1 mark

End-of-chapter exercise

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

  1. Identify two factors that can affect the performance of a CPU.2 marks
  2. State the purpose of ROM in a computer system.1 mark
  3. Describe the steps involved in the 'fetch' stage of the fetch-decode-execute cycle. You must refer to the registers used.4 marks
  4. Explain the difference between magnetic and solid-state storage, giving one example of a device for each.4 marks
  5. An automated greenhouse uses sensors to control its environment. Identify a suitable sensor for monitoring temperature and a suitable sensor for monitoring soil moisture levels.2 marks
  6. Explain two benefits of using cloud storage compared to storing data on a local hard drive.4 marks
  7. A computer becomes very slow when running multiple large applications. Explain how virtual memory is used in this situation and why it causes the computer to slow down.5 marks
  8. A modern laptop has a quad-core, 3.0 GHz CPU and 16 GB of RAM. Describe the role of the cores and the RAM in allowing the user to edit a high-definition video while also browsing the internet.6 marks
  9. Describe the purpose of the Control Unit (CU) and the Arithmetic Logic Unit (ALU) within a Von Neumann processor architecture.4 marks
  10. What is an embedded system? Give one example of a device that contains an embedded system.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