Study Guide

CPU Performance and Embedded Systems

How the number of cores, the size of the cache and the speed of the clock affect how fast a CPU works, and why each has limits; what an instruction set is; and how an embedded system differs from a general-purpose computer.

Lesson 3.3 Computer Systems

For: Cambridge IGCSE Computer Science learners

Stage: Think

One cook or four?

Two school kitchens (made-up ones) each have to prepare 600 lunches. Kitchen A has one cook. Kitchen B has four cooks, and each can work from the recipe folder on their own.

Think it through

Kitchen B will almost certainly finish sooner. Will it finish exactly four times as fast? Give two reasons why it might not.

Show what happens

Probably not. Some jobs must wait for others (the sauce cannot be poured until it has been made), and the cooks may need to share things such as the oven, so some of their time is spent waiting. A computer’s processor has the same problem.

A core is a complete processing unit inside a CPU: it has its own control unit, ALU and registers, so it can fetch, decode and execute instructions by itself. A CPU with two cores is called dual-core, with four cores quad-core, and so on. Each core can work on a different instruction at the same time, so a multi-core CPU can run several programs, or several parts of one program, together.

More cores usually help, but only when there is separate work for them to do. The program has to be written so that its work can be split into parts that can run at the same time, and some work has to wait for the results of other work. So doubling the number of cores does not normally double the speed.

Check your understanding

A program does one long calculation in which every step needs the answer from the step before. It runs on a CPU with four cores, then on one with eight. What is most likely to happen?
Show the answer

Answer: B. It gains little, because each step waits for the one before, so the extra cores have nothing to do at once.

More cores help only with work that can be shared out.

Stage: Discover

The beat the CPU works to

In the made-up kitchen, a metronome ticks on the wall. On every tick, each cook completes one small action: crack an egg, stir once, turn a page.

Think it through

The kitchen manager speeds the metronome up. What do you expect to happen to the number of lunches made each hour? What might go wrong if the beat is made faster and faster?

Show what happens

More actions per second, so more lunches, at first. But cooks cannot move faster than they can move, and a fast beat means more effort and heat in the kitchen. A CPU’s clock behaves in a similar way.

A CPU has a clock: a part that sends out electrical pulses at a steady rate, which keep all the CPU’s parts working in step. Each pulse is one clock cycle, a chance for the CPU to do one small step of its work. The clock speed is the number of clock cycles per second. It is measured in hertz (Hz): one cycle per second. A gigahertz (GHz) is a billion cycles per second.

A higher clock speed means more clock cycles every second, so the CPU can carry out more instructions in each second. A 3 GHz CPU has 3 billion clock cycles a second.

Turn each clock speed into clock cycles per second. The first row is done for you.
Clock speedClock cycles per second
1 GHz1 000 000 000
3 GHz
2.5 GHz
4 GHz

    Show the completed table
    Clock speedClock cycles per second
    1 GHz1 000 000 000
    3 GHz3000000000
    2.5 GHz2500000000
    4 GHz4000000000

    Check your understanding

    Why do CPU makers not simply keep raising the clock speed as high as possible?
    Show the answer

    Answer: C. A faster clock produces more heat and uses more power, so there is a limit to how fast a CPU can run.

    A faster clock does more work each second, but it also makes more heat and uses more power.

    Stage: Think

    A shelf within reach

    The kitchen’s main stores are in a storeroom across the yard. The cooks use salt, oil and flour constantly, and the stores are a long walk away.

    Think it through

    What would sensible cooks do about the things they use all the time, and what would decide how much they could keep at the counter?

    Show what happens

    They would keep copies of the most-used items on a shelf at the counter, and walk to the storeroom only for things that are not there. What they can keep is limited by how much room the shelf has. A CPU does the same with memory.

    Fetching instructions and data from RAM is slow compared with how quickly a CPU works, so the CPU would often have to wait. To reduce the waiting, the CPU has a cache: a small amount of very fast memory, on or very close to the CPU, that keeps copies of the instructions and data used most often. The CPU looks in the cache first. If what it needs is there, it is delivered quickly. If not, it is fetched from RAM, and a copy is usually kept in the cache for next time.

    A larger cache can hold more of what the CPU needs, so it finds what it wants in the cache more often and waits for RAM less. Cache has limits. It costs much more than RAM and takes up space on the CPU chip, so it is always far smaller than RAM; and beyond a certain size, most of what a program uses repeatedly already fits, so adding more makes little difference.

    Do not confuse: Cache and RAM

    Which is faster?Cache
    Very fast, small, on or beside the CPU. Holds copies of what is used most often.The salt on the counter shelf.
    Which is bigger?RAM
    Much larger, but slower to reach. Holds the programs and data currently in use.The storeroom across the yard.

    Check your understanding

    Why can a CPU with a larger cache perform better than one with a smaller cache?
    Show the answer

    Answer: D. It can keep more of what it uses often, so it waits for RAM less often.

    A larger cache means fewer waits for RAM, up to a point.

    Stage: Apply

    Which change would help?

    Cores, cache and clock speed can each improve performance, in different ways. The number alone does not tell the whole story.

    It is tempting to think that the CPU with the biggest numbers is always fastest. A CPU with a higher clock speed and fewer cores can be slower than another for work that can be shared out, and a CPU with a small cache can be held back by waiting for RAM, whatever its clock speed. Performance depends on all three together, and on the program being run.

    Apply it

    A computer is used to play music, run a video call and edit a document all at once, and each of them seems to wait for its turn on the CPU. Which change is most likely to help?
    Show the answer

    Answer: B. Replacing the CPU with one that has more cores.

    Separate programs are work that can be shared out between cores.

    Which one is being described: cores, cache or clock speed? Type one word for each.
    What it describesWhich one
    It keeps copies of the most-used instructions and data close to the CPU.
    It sets how many steps the CPU can take each second, in GHz.
    Each can fetch, decode and execute instructions separately, at the same time as the others.
    A bigger one means the CPU waits for RAM less often.

      Show the completed table
      What it describesWhich one
      It keeps copies of the most-used instructions and data close to the CPU.cache
      It sets how many steps the CPU can take each second, in GHz.clock speed
      Each can fetch, decode and execute instructions separately, at the same time as the others.cores
      A bigger one means the CPU waits for RAM less often.cache

      Apply it

      Jamal says: “My phone’s CPU has 8 cores and runs at 3 GHz, so it must be faster than your laptop’s, which has 4 cores and runs at 3.5 GHz.” What can you say about this?
      Show the answer

      Answer: C. It cannot be known from these numbers alone: cache, and how much work can be shared out, also matter.

      The three factors act together, and the program matters too.

      Stage: Think

      What a CPU can be told to do

      Think it through

      A CPU is an electronic circuit. It cannot read English, or Python, or Scratch. In what form must an instruction reach it? And who has to decide which instructions it will understand?

      Show what happens

      An instruction must reach the CPU as a pattern of bits (1s and 0s). Whoever designs the CPU decides which patterns it will recognise, and what each one makes it do.

      A CPU’s instruction set is the list of all the commands that it can process, such as add, compare, load a value from memory or store a value to memory. Each command is written in machine code: a binary pattern, the only form of instruction that a CPU can carry out directly. During the decode stage, the control unit recognises which command a pattern is.

      Programs that people write in languages such as Python are changed into machine code before the CPU can run them. Different designs of CPU have different instruction sets: a typical laptop’s CPU and a typical phone’s CPU often use different ones.

      Check your understanding

      Which statement about an instruction set is correct?
      Show the answer

      Answer: C. It is the list of commands that a particular CPU can process, each of them in machine code.

      The instruction set lists the commands a CPU can process, in machine code.

      Apply it

      A machine-code program was made for a CPU with one instruction set, and is copied to a computer whose CPU has a different instruction set. What is most likely to happen when it is run?
      Show the answer

      Answer: B. It will not run correctly, because the binary patterns do not mean the same to the other CPU.

      A program in machine code belongs to one instruction set.

      Stage: Discover

      Computers you do not call computers

      Think it through

      A washing machine and a laptop both contain a processor. What does the washing machine’s processor do all day and night, compared with the laptop’s?

      Show what happens

      The washing machine’s processor does one job, controlling the wash (filling, heating, spinning, stopping). The laptop’s processor runs many different programs that the user chooses, and can be given new ones at any time.

      An embedded system is a computer system, usually a small processor with memory, built into a larger device to perform one dedicated function. Its program is usually fixed, stored permanently inside the device, and the user does not change it. A general-purpose computer, such as a personal computer (PC) or a laptop, is the opposite: it can carry out many different functions, depending on which programs are run.

      Embedded systems usually have these characteristics: they do one dedicated job; they are small and use little power; they are built to run reliably for years without attention; they have few, simple controls (buttons or a small display); and they often use sensors and actuators to monitor and control the device. Examples are in:

      • domestic appliances, such as a washing machine or a microwave oven;
      • cars, for example controlling the engine, or the anti-lock braking;
      • security systems, such as a burglar alarm that reads its sensors;
      • lighting systems, for example street lights that switch on when it gets dark;
      • vending machines, which accept money, check it and release the item chosen.

      A computer being small, or having a processor, does not make it an embedded system. What matters is what it is for: an embedded system has one dedicated job inside a bigger device. A tablet is small too, but it runs whatever programs its user chooses, so it is a general-purpose computer.

      Is each device an embedded system or a general-purpose computer? Type embedded or general.
      Device or systemEmbedded or general
      The controller inside a washing machine
      A school’s laptop
      The control panel of a burglar alarm
      A desktop PC
      The system in a vending machine
      The engine controller in a car

        Show the completed table
        Device or systemEmbedded or general
        The controller inside a washing machineembedded
        A school’s laptopgeneral
        The control panel of a burglar alarmembedded
        A desktop PCgeneral
        The system in a vending machineembedded
        The engine controller in a carembedded

        Stage: Apply

        Embedded or general-purpose?

        Check your understanding

        Which statement best explains why the control system of a vending machine is an embedded system?
        Show the answer

        Answer: A. It is built into the machine to do one dedicated job, and users do not change its program.

        Embedded: one dedicated function inside a larger device.

        Apply it

        Four devices are listed: a street-lighting controller, a security-alarm panel, a laptop and a microwave oven. Which one is NOT an embedded system?
        Show the answer

        Answer: D. The laptop, which runs whatever programs its user chooses.

        The other three are embedded systems with one dedicated function.

        Stage: Consolidate

        Show what you know

        Think it through

        Explain to a friend, in your own words, how cores, cache and the clock each affect how fast a CPU works, and give one limit for each.

        Show a model answer

        A good answer covers all three. For example: “More cores let a CPU do several things at once, but only if the work can be shared out. A bigger cache lets the CPU keep more of what it uses often close by, so it waits for RAM less, but cache is expensive, so it stays small. A higher clock speed means more steps every second, but it makes more heat and uses more power.”

        Check your understanding

        Two CPUs are the same in every way except the clock speed: CPU P runs at 2 GHz and CPU Q at 3 GHz. Which statement is true?
        Show the answer

        Answer: A. CPU Q has more cycles every second, so it can carry out more instructions each second.

        A faster clock means more clock cycles per second.

        • A core is a complete processing unit inside a CPU; more cores can do more work at once, but only if there is work that can be shared out.
        • The clock speed, in hertz, is the number of clock cycles per second; a higher clock speed does more each second, but makes more heat and uses more power.
        • The cache is small, very fast memory that keeps copies of what the CPU uses most, so that it waits for RAM less; a larger cache helps, with limits of cost and space.
        • An instruction set is the list of commands a CPU can process; each one is in machine code, binary that the CPU can carry out directly.
        • An embedded system does one dedicated function inside a larger device, such as a washing machine, a car, an alarm, street lighting or a vending machine. A general-purpose computer can do many different things.

        Sources and scope

        • What this lesson is. The third lesson of the Computer Systems module, written for this site. It teaches Cambridge IGCSE Computer Science (0478) points 3.1.3, 3.1.4 and 3.1.5 (2026 to 2028, version 6), after Lessons 1 and 2. Its curriculum links are provisional and imply no endorsement by any examination board. It has not been approved by the site owner.
        • Original material. The two school kitchens, the metronome, the storeroom, the listed devices and Jamal’s claim are fictional and were written for this lesson.
        • Simplified on purpose. The kitchen is an analogy and has limits. The effect of the clock is described as “more instructions each second”; in real CPUs the number of clock cycles an instruction takes varies, and different designs do different amounts of work per cycle. Cache is described as one memory, though real CPUs have several levels of it. Instruction sets are described in outline; no real instruction set is taught.