Processor Performance: Clock Speed, Cache, GPUs and Multi-Core

A processor is not described only by the cycle it runs. You also need the features that decide how quickly that cycle happens, and how a system can do more than one thing at a time: clock speed, cache memory, the GPU, parallel processing and multi-core chips. In this lesson you will see how these ideas fit together, work out a running time from a clock frequency, and watch a tiny cache decide between a hit and a miss, and look at how a pipeline, several cores and a GPU overlap work. A C program will do the same arithmetic, and another will replay a short cache trace.

What you will learn

  • What a clock is, how clock speed is measured (Hz, MHz, GHz), and how to find the clock period.
  • The relationship: running time = instruction count × CPI × clock period.
  • What cache memory is, why it is fast, and what a hit and a miss are.
  • What a GPU is for, and how it differs from a general-purpose CPU.
  • What parallel processing and multi-core processors are, and when they help.
  • How a simple pipeline overlaps the stages of several instructions so a core can finish close to one instruction per clock.

Part 1: Clock speed

The CPU is driven by a clock: a regular square wave that times the fetch–decode–execute cycle (and, in a real pipeline, the smaller steps inside it). The clock speed (clock frequency) is the number of ticks per second, measured in hertz. Modern processors are quoted in gigahertz (GHz): 1 GHz is 109 ticks per second. A 2 GHz clock ticks two billion times a second, so each tick lasts

period = 1 / frequency = 1 / 2 GHz = 0.5 ns

A nanosecond (ns) is 10−9 s. Raising the clock speed shortens the period, so more cycles happen each second, and a given program can finish sooner — provided the rest of the machine can keep up, and provided the chip does not overheat. Clock speed is not the whole story, which is why two 3 GHz processors can still feel very different. A pipeline, the cache hit rate, and the number of cores all change how much work those ticks actually finish.

A handy formula for working out how long a program takes to run is:

running time
  = instruction count × CPI
    × clock period

CPI is cycles per instruction: the average number of clock ticks needed to complete one instruction. A simple processor might have a CPI close to 1; a more complex instruction, or a cache miss, raises the average. A five-stage pipeline (fetch, decode, execute, memory, write-back) can have five instructions in flight at once, so after the pipeline has filled, a core can finish one instruction almost every clock even though each instruction still takes several stages. A cache miss, or a branch that was guessed wrong, stalls that overlap and the CPI rises. Worked example: 800 million instructions, CPI 1.5, clock 2 GHz (period 0.5 ns):

time = 800 000 000 × 1.5 × 0.5 ns
     = 600 000 000 ns
     = 0.6 s

Try it 1Running-time calculator

Change the clock speed (GHz), the average cycles per instruction and the instruction count (in millions). The calculator uses time = instructions × CPI × period, with period = 1 / frequency. The diagram shows a five-stage pipeline filling, and a bar for the running time (a 0.6 s program is a full bar).


Part 2: Cache memory

The processor is much faster than main RAM. To stop it waiting, a small, very fast memory called a cache sits on or beside the CPU (often SRAM; see Memory Types and Features). The cache holds copies of the values the CPU has used recently, and of nearby addresses (because programs tend to reuse data and to step through memory in order).

  • A cache hit means the value is already in the cache, so it can be delivered in a few cycles without touching main memory.
  • A cache miss means it is not there. The cache (or the CPU) must fetch the value from a slower level — a larger cache, or main RAM — which takes many more cycles and raises the effective CPI.

Real machines have several levels (L1, L2, L3): L1 is the smallest and fastest and is usually private to a core; L3 is larger, slower, and often shared. For CAPE, you should be able to define cache, hit and miss, and explain why a cache improves performance (it exploits the fact that recently used data is likely to be used again). The specimen Paper 01 has a short item on this idea. Think of the cache as a short cut: most of the time the CPU finds what it needs in the small, fast copy, and only occasionally has to walk out to RAM.

Try it 2A 4-line cache

Tap an address to request it. The diagram shows the path: a hit stays between the CPU and the cache (green); a miss has to go out to RAM (orange) and a line is filled. A full cache replaces lines in rotation. Try 1, 2, 1, 3, 2, 8, 1, 3 and watch the hit rate climb once the working values are in the cache.

Part 3: GPUs, parallel processing and multi-core chips

A single core, however fast its clock, does one instruction stream at a time (or a small number, if it is pipelined or superscalar). Several syllabus terms describe ways of doing more than one piece of work at once.

  • Parallel processing means carrying out more than one operation at the same time, rather than strictly one after another. It can happen inside a core, across cores, across a graphics chip, or across many computers (as in the supercomputers of Power Protection and Types of Computers).
  • A multi-core processor puts two or more complete CPUs (cores) on a single chip. Each core has its own ALU, control unit and registers, and can run its own stream of instructions. The cores usually share the higher-level cache and main memory. A four-core chip can, in the best case, run four threads at once; in practice the speed-up is less, because the threads often have to wait for each other or for memory. A program must be written (or a compiler must be able) to use more than one core, or the extra cores sit idle.
  • A GPU (graphics processing unit) is a chip, or a large block of a chip, with many relatively simple cores, designed to run the same kind of operation on a lot of data at once — originally the pixels of an image, but also the matrix arithmetic used in scientific computing and in machine learning. A GPU is not a general-purpose replacement for the CPU: it is very fast at data-parallel work, and less efficient at a single, heavily branching task. The CPU and the GPU often work together.

These ideas connect. Raising the clock speed of one core eventually hits a heat wall, so manufacturers added more cores and bigger caches, and offloaded regular, repetitive work to GPUs. When a question asks you to describe any one of these terms, give the short definition above and one sentence about why it improves (or, for cache misses and for poorly parallelised code, why it may not improve) performance.

Try it 3Cores, cache levels, a pipeline and a GPU

Tap a block on the chip. The four CPU cores each have a private L1 cache and share L3. A GPU sits beside them with many simple cores. Inside a CPU core, a pipeline overlaps instruction stages.

Part 4: Performance in C

This program repeats the worked example from Part 1. Frequency is in GHz, so 1.0 / freq is the period in nanoseconds.

#include <stdio.h>

/* Time = instructions * CPI * period.
   period = 1 / frequency.
   We work in nanoseconds: a 2 GHz
   clock has a 0.5 ns period. */
int main(void)
{
    double freq = 2.0;    /* GHz */
    double cpi = 1.5;
    int inst = 800000000;
    double period, time;

    period = 1.0 / freq;  /* ns  */
    time = inst * cpi * period;
    /* 800e6 * 1.5 * 0.5 = 6e8 ns */
    printf("Clock:   %.1f GHz\n", freq);
    printf("Period:  %.1f ns\n", period);
    printf("CPI:     %.1f\n", cpi);
    printf("Inst:    %d\n", inst);
    printf("Time:    %.0f ns\n", time);
    printf("         = %.3f s\n",
           time / 1000000000.0);
    return 0;
}

Output:

Clock:   2.0 GHz
Period:  0.5 ns
CPI:     1.5
Inst:    800000000
Time:    600000000 ns
         = 0.600 s

The second program is the 4-line cache of Try it 2, running the suggested trace 1, 2, 1, 3, 2, 8, 1, 3. The first time each new address appears is a miss; a later request for an address still in the cache is a hit. The last-resort replacement when the cache is full is deliberately crude (it always overwrites line 0) so the code stays short — Try it 2 uses a fairer rotation.

#include <stdio.h>

/* A tiny 4-line cache. Each line holds
   one address. A request that matches a
   stored address is a hit. */
int main(void)
{
    int cache[4] = {-1, -1, -1, -1};
    int req[8] = {1, 2, 1, 3,
                  2, 8, 1, 3};
    int i, j, hit, used = 0;
    int hits = 0;

    for (i = 0; i < 8; i++) {
        hit = 0;
        for (j = 0; j < used; j++)
            if (cache[j] == req[i])
                hit = 1;
        if (hit) {
            hits++;
            printf("%d  HIT\n", req[i]);
        } else {
            printf("%d  MISS\n", req[i]);
            if (used < 4) {
                cache[used] = req[i];
                used++;
            } else
                cache[0] = req[i];
        }
    }
    printf("hits %d of 8\n", hits);
    return 0;
}

Output:

1  MISS
2  MISS
1  HIT
3  MISS
2  HIT
8  MISS
1  HIT
3  HIT
hits 4 of 8

Try this: change the request list in cache.c so that the same four addresses repeat, and confirm that after the first four misses the rest are hits. Then, in the calculator, double the clock and double the CPI separately: which change has the bigger effect on the 0.6 s program, and why are they opposite?

Try it 4Performance drill

For clock questions, type a number (decimals such as 0.5 are fine). The other modes are multiple choice.

Summary

IdeaKey points
Clock speedTicks per second (Hz, MHz, GHz). Period = 1 / frequency. A 2 GHz clock has a 0.5 ns period.
Running timeInstruction count × CPI × clock period. Faster clocks, fewer instructions, or a lower CPI all shorten the time.
CacheA small, fast memory close to the CPU. Hit: the data is already there. Miss: it must be fetched from a slower level.
Multi-coreSeveral complete CPUs on one chip, able to run instruction streams at the same time. Software must be able to use them.
GPUMany simple cores, very good at the same operation on lots of data (graphics, some scientific work). Complements the CPU.
Parallel processingDoing more than one piece of work at the same time, at any of those levels.

Practice questions

1. A CPU runs at 4 GHz. What is its clock period in nanoseconds? How many ticks occur in 1 µs (1000 ns)?

Show answer

Period = 1/4 = 0.25 ns. In 1000 ns there are 1000 / 0.25 = 4000 ticks.

2. A program of 200 million instructions has a CPI of 2 and a 2 GHz clock. How long does it take?

Show answer

Period = 0.5 ns. Time = 200e6 × 2 × 0.5 ns = 200e6 ns = 0.2 s.

3. Explain the difference between a cache hit and a cache miss, and why a high hit rate improves performance.

Show answer

A hit means the data is already in the cache and is returned quickly. A miss means a slower level must be used, which takes many more cycles. A high hit rate keeps the average CPI down.

4. Why is a cache made smaller than main memory, and placed closer to the CPU?

Show answer

Smaller memories can be built from faster cells (often SRAM) and can sit on the same chip as the cores, so the access time is much shorter than a trip to DRAM.

5. Give one similarity and one difference between a multi-core CPU and a GPU.

Show answer

Similarity: both do parallel processing with several cores. Difference: a CPU core is a general-purpose processor good at varied, branching tasks; a GPU has many simpler cores aimed at the same operation on lots of data.

6. A friend says "a 4-core, 2 GHz chip is always twice as fast as a 1-core, 4 GHz chip." Give two reasons why that may be false.

Show answer

The 4-core chip has a slower clock, so a single thread may run slower. And a program that cannot be split into parallel threads will use only one of the four cores, wasting the rest. CPI and cache size also matter.

7. In the C cache trace, why is the third request (address 1) a hit, and the sixth (address 8) a miss?

Show answer

Address 1 was placed in the cache on the first (missed) request, and has not been replaced, so the third request hits. Address 8 has never been seen, so it misses and is brought in.

Homework

  1. Work out, on paper, the running time of 1 billion instructions at CPI 1 and 3 GHz, then at CPI 2 and 3 GHz, then at CPI 1 and 1.5 GHz. Check two of the three with Try it 1 (you may need to enter 1000 million). Then tap each block in Try it 3 and write one sentence for core, L3, pipeline and GPU.
  2. Using Try it 2, find a sequence of eight requests that gives (a) as many hits as you can, and (b) as many misses as you can, starting from an empty 4-line cache. Explain the two sequences.
  3. Change cycles.c so it reads frequency, CPI and instruction count with scanf and prints the time in seconds to three decimal places.
  4. On this site, look back at Memory Types and Features (cache in the memory hierarchy) and Power Protection and Types of Computers (supercomputers as parallel machines) and add a five-sentence summary to your notes, in your own words.

Mastery quiz: Processor Performance

This 10-question quiz is separate from the short Quick quiz at the end of the lesson. Score 8/10 or higher to earn this lesson’s badge. Your best score is saved in this browser on this device.

Mastery quiz: Processor Performance: Clock Speed, Cache, GPUs and Multi-Core

Your course badges: loading saved progress…

View badges

    No course badges earned yet. Score 8/10 in a lesson quiz to earn its badge.

    Saved in this browser on this device. Clearing browser data may remove your badges.

    Answer all 10 questions. Earn this lesson’s badge at 8/10 or higher. Read the explanations, revisit the Try it activities and retry as often as you need. These are self-study badges, not formal grades.

    1. A 2 GHz clock has a period of...
    2. Clock speed is best described as...
    3. In time = instructions × CPI × period, CPI stands for...
    4. A cache hit means...
    5. A cache miss usually...
    6. A multi-core processor is...
    7. A GPU is especially well suited to...
    8. Parallel processing means...
    9. 800 million instructions, CPI 1.5, clock 2 GHz. The running time is...
    10. In a five-stage pipeline, after the pipe has filled, a core can often finish...

    Exam tips

    Specimen Unit 1 Paper 01 (2021), Item 10. A short item on what is meant by clock speed. Answer in terms of the number of clock ticks per second (or the frequency of the processor clock), not in terms of "how fast the fan spins" or "the speed of the hard disk".

    Specimen Unit 1 Paper 01 (2021), Item 4. A short item on cache memory, including why it is used when data is retrieved. The useful idea is that a small, fast memory close to the CPU holds recently used values so that most requests do not have to wait for main RAM.

    Specimen Unit 1 Paper 01 (2021), Item 14 and the types-of-computer material in Power Protection and Types of Computers may ask you to recognise a supercomputer as a machine that uses large-scale parallel processing. Connect that idea to the multi-core and GPU descriptions in this lesson, at a smaller scale.

    General advice: always give a unit with a clock speed or a time; say "hit" or "miss" rather than just "found" or "not found"; and if a question asks you to describe a multi-core processor, mention independent cores on one chip and that they can run instructions at the same time. More worked answers are on the CS Solutions page.

    Previous: Instructions: Formats, Types and Instruction Sets. Next: Module 2, coming soon in this course. See also: Memory Types and Features and Power Protection and Types of Computers.

    Syllabus link: CAPE Computer Science (CXC A19/U2/21), Unit 1, Module 1: Computer Architecture. Specific Objective 5: describe the main characteristics of a processor (clock speed, cache memory, Graphics Processing Unit (GPU), parallel processing, and multi-core processors).

    Video search terms

    Search YouTube for: "CPU clock speed explained", "cache hit vs cache miss", "CPU vs GPU", "what is a multi-core processor".

    Try it 5Quick quiz

    Tap an answer. All eight questions are self-checks on this lesson.

    Updates

    2026/11/24

    - Rebuilt the lesson with fuller explanations, diagrams and new Try it simulations.

    2026/11/23

    - Removed the Print this lesson button.

    - Reworded some sentences so they speak directly to students.

    - Published.

    © 2026 Vedesh Kungebeharry. All rights reserved.

    Leave a Reply