HARDWARE AND OPERATION | DIFFERENCES BETWEEN CPU AND GPU
A1.1.3 Explain the differences between the CPU and the GPU. (HL only)
- Differences in their design philosophies, usage scenarios
- Differences in their core architecture, processing power, memory access, power efficiency
- CPUs and GPUs working together: task division, data sharing, coordinating execution
SECTION 1 | DIFFERENCES IN THEIR PHILOSOPHIES
Design Philosophy
The CPU is designed to be a general-purpose processor.
- It typically contains a small number of powerful, complex cores.
- Each core is optimised for low latency, meaning it can quickly respond to individual instructions.
- CPUs include advanced control logic to handle branching, decision-making, and a wide variety of instruction types.
This design allows CPUs to efficiently execute sequential tasks and manage overall system control.
In contrast, the GPU is designed for specialised, high-throughput processing.
- It contains hundreds or thousands of simpler cores.
- Each core is optimised to perform arithmetic operations rather than complex control.
- GPUs prioritise throughput over latency, allowing many operations to be completed simultaneously.
Usage Scenarios
Due to these design differences, CPUs and GPUs are used for different types of tasks.
CPUs are best suited for:
- Running operating systems.
- Executing general-purpose programs.
- Handling tasks that involve frequent branching or complex logic.
GPUs are best suited for:
- Graphics rendering and image processing.
- Machine learning and artificial intelligence workloads.
- Large-scale simulations and data-parallel computations.
Tasks that involve applying the same operation to large data sets benefit significantly from GPU processing.
Parallelism vs Control
- A CPU focuses on control and flexibility, enabling it to handle many different tasks efficiently.
- A GPU focuses on parallelism, enabling it to process large volumes of similar data at the same time.
As a result, GPUs often act as co-processors, handling specific workloads while the CPU manages overall system operation.
Summary of Key Differences
- CPUs have fewer, more powerful cores; GPUs have many simpler cores.
- CPUs are optimised for low latency and control; GPUs are optimised for high throughput.
- CPUs handle general-purpose and sequential tasks; GPUs handle parallel and repetitive tasks.
CPUs and GPUs differ fundamentally in their design philosophies and usage scenarios. Understanding these differences explains why modern computer systems often use both processors together to achieve efficient and high-performance computing.
SECTION 2 | DIFFERENCE IN CORE ARCHITECTURE, POWER, MEMORY ACCESS AND EFFICIENCY
Typical pattern: CPU performance rises steadily; GPU throughput grows faster due to massive parallelism and specialization.
Core Architecture
The CPU has a small number of complex, powerful cores.
- Each core is designed to handle a wide variety of instructions.
- CPU cores include sophisticated control logic to manage branching, decision-making, and interrupts.
- This architecture supports flexible, sequential processing.
The GPU, in contrast, has a very large number of simpler cores.
- GPU cores are designed primarily for arithmetic operations.
- They execute the same instruction across many data values simultaneously.
- Control logic is minimal compared to a CPU, allowing more space for processing units.
Processing Power
Processing power differs in how it is applied rather than in raw capability.
- A CPU provides high performance for individual tasks and instructions, making it effective for workloads that require fast response times.
- A GPU provides extremely high overall processing capability by executing many operations in parallel.
As a result, a GPU may outperform a CPU on tasks such as graphics rendering or matrix calculations, even if each individual GPU core is less powerful than a CPU core.
Memory Access
Memory access patterns also differ between CPUs and GPUs.
- CPUs use complex cache hierarchies to minimise memory access time and support fast access to frequently used data.
- CPUs are optimised for low-latency access to small amounts of data.
GPUs are designed for high-bandwidth memory access.
- They can move large volumes of data efficiently between memory and processing cores.
- This is effective when many cores need to access different data elements at the same time.
However, GPUs are less efficient when memory access is irregular or unpredictable.
Power Efficiency
- Power efficiency reflects how much useful work is performed per unit of energy.
- CPUs consume more power per core because of their complex design and advanced control logic.
GPUs achieve high power efficiency for suitable tasks by performing many simple operations in parallel.
For data-parallel workloads, a GPU can perform more calculations per unit of energy than a CPU, making it more energy-efficient for tasks such as AI training or large simulations.
Overall Comparison
- CPUs prioritise flexibility, control, and low-latency execution.
- GPUs prioritise parallelism, high throughput, and efficient handling of large data sets.
- Differences in architecture, processing power, memory access, and power efficiency determine which processor is best suited to a given task.
CPUs and GPUs are designed with different internal structures and performance goals. These differences explain why modern systems combine both processors to balance control, efficiency, and high-performance computation.
Which option best describes a key difference between a CPU and a GPU in terms of architecture and typical performance?
SECTION 2 | CPUs AND GPUs WORKING TOGETHER
Task Division
The CPU and GPU are assigned different roles based on their design characteristics.
- The CPU handles tasks that require control, decision-making, and sequential processing.
- Managing the operating system and application logic
- Handling branching, interrupts, and user input
The GPU handles tasks that involve large-scale parallel computation.
- Graphics rendering
- Machine learning calculations
- Processing large data sets with repeated operations
By dividing tasks in this way, each processor performs the work it is best suited for, improving overall system efficiency.
Data Sharing
To work together effectively, CPUs and GPUs must exchange data.
- The CPU prepares data and instructions and transfers them to the GPU.
- The GPU processes the data in parallel.
- Results are sent back to the CPU for further processing or decision-making.
Data is typically transferred through system memory or dedicated high-speed links. Efficient data sharing is important because excessive data transfer can reduce performance gains from GPU acceleration.
Coordinating Execution
Execution must be carefully coordinated to ensure correct program behaviour.
- The CPU initiates GPU tasks and determines when they should start.
- The GPU executes assigned workloads independently once launched.
- The CPU may continue with other tasks while the GPU is processing, or it may wait for results depending on the program.
This coordination allows overlapping execution, where both processors work at the same time, maximising hardware utilisation.
Benefits of CPU–GPU Cooperation
- Improved performance through parallelism and specialisation
- Better use of hardware resources
- Faster completion of complex tasks such as simulations, AI workloads, and graphics rendering
CPUs and GPUs work together in modern systems through effective task division, efficient data sharing, and coordinated execution. This cooperative approach enables computers to handle complex and demanding workloads more efficiently than using either processor alone.
Which statement best explains how CPUs and GPUs work together in a modern computer system?
Graphics Processing Unit (GPU) | A specialised processor designed to perform large numbers of calculations in parallel, originally developed for graphics rendering and now widely used for data-parallel and computationally intensive tasks.
Core | An individual processing unit within a CPU or GPU capable of executing instructions. CPUs typically have a small number of powerful cores, while GPUs have many simpler cores.
Core Architecture | The internal design and organisation of processing cores, including how instructions are executed and how resources are allocated.
Parallel Processing | A processing method in which multiple calculations are carried out simultaneously across many processing units.
Sequential Processing | A processing method in which instructions are executed one after another in a fixed order, typically associated with CPU workloads.
Throughput | The amount of work completed by a processor over a given period of time. GPUs are optimised for high throughput.
Latency | The time taken to complete a single operation or instruction. CPUs are optimised for low latency.
Memory Bandwidth | The rate at which data can be transferred between memory and a processor. GPUs are designed to support high memory bandwidth.
Cache | Small, high-speed memory located close to the CPU cores, used to reduce the time required to access frequently used data.
Power Efficiency | The amount of useful computational work performed per unit of energy consumed. GPUs can be more power-efficient for parallel workloads.
Offloading | The process of transferring specific tasks from the CPU to the GPU to improve performance and efficiency.
Heterogeneous Computing | A computing approach in which different types of processors, such as CPUs and GPUs, work together to perform tasks efficiently.
Task Division | The allocation of different parts of a workload to different processors based on their strengths.
Data Sharing | The process by which the CPU and GPU exchange data during execution.
Coordinated Execution |The management of timing and control so that the CPU and GPU operate together correctly and efficiently.
2: Describe how the core architecture of a CPU differs from that of a GPU.
3: Explain why a CPU is better suited to tasks involving complex decision-making and branching.
4: Explain why a GPU is more effective than a CPU for highly parallel tasks.
5: Compare the processing power of CPUs and GPUs in terms of latency and throughput.
6: Explain how memory access differs between CPUs and GPUs.
7: Describe how power efficiency differs between CPUs and GPUs for parallel workloads.
8: Explain what is meant by task offloading from a CPU to a GPU.
9: Describe how CPUs and GPUs share data and coordinate execution in a modern computer system.
10: Using an example, explain why a system that combines a CPU and a GPU can outperform a system that uses only a CPU.
Sample Answers – A1.1.3 CPU vs GPU
1. Design philosophy
A CPU is designed as a general-purpose processor that can perform a wide range of tasks efficiently, including control and decision-making. A GPU is designed for high-throughput processing, using many cores to perform large numbers of similar calculations in parallel.
2. Core architecture
CPUs typically have a small number of complex, powerful cores with advanced control logic and large caches. GPUs typically have many simpler cores designed to carry out arithmetic operations in parallel, with less emphasis on complex control.
3. Branching and decision-making
CPUs handle branching efficiently because they are optimised for sequential execution and include control logic to manage interrupts, conditional statements, and frequent changes in instruction flow. GPUs are less efficient for heavy branching because parallel execution is most efficient when many operations follow the same instruction pattern.
4. Parallel tasks
GPUs are effective for highly parallel tasks because they can run the same operation on many data items simultaneously across many cores. This suits workloads such as graphics rendering, image processing, and matrix calculations used in machine learning.
5. Latency vs throughput
CPU performance is often characterised by low latency, meaning it can complete individual tasks quickly. GPU performance is characterised by high throughput, meaning it can complete a large total number of operations per unit time by parallel execution.
6. Memory access
CPUs use cache hierarchies to reduce memory access time and support fast access to small working data sets. GPUs are designed for high memory bandwidth, enabling large volumes of data to be moved efficiently for parallel processing, but they are less efficient when memory access is irregular or unpredictable.
7. Power efficiency
GPUs can be more power-efficient for data-parallel tasks because they perform many simple operations in parallel, producing high work output per unit of energy. CPUs use more power per core due to complex control logic and are more efficient for sequential and control-heavy tasks.
8. Offloading
Offloading is the transfer of suitable tasks from the CPU to the GPU to improve performance. The CPU typically handles program control and dispatches parallel work to the GPU, which processes it and returns results to the CPU.
9. Data sharing and coordination
The CPU prepares input data and transfers it to the GPU, which processes the workload and sends results back. Coordination ensures tasks start at the correct time and that the CPU either waits for results or continues other work until the GPU completes its processing.
10. Combined system example
In a machine learning application, the CPU can manage the program logic and data preparation while the GPU performs large matrix calculations in parallel. Using both processors improves performance because each handles the tasks it is designed for, reducing total execution time compared to using only a CPU.
☐ 1.1.1 FUNCTIONS OF THE CPU
☐ 1.1.2 ROLE OF THE GPU
➩ 1.1.3 CPU VS GPU
☐ 1.1.4 PURPOSE AND TYPES OF PRIMARY MEMORY
☐ 1.1.5 FETCH, DECODE AND EXECUTE CYCLE
☐ 1.1.6 PIPELINING IN MULTICORE ARCHITECTURES
☐ 1.1.7 SECONDARY MEMORY STORAGE
☐ 1.1.8 CONCEPTS OF DATA COMPRESSION
☐ 1.1.9 CLOUD COMPUTING
A1.2 DATA REPRESENTATION AND COMPUTER LOGIC
☐ 1.2.1 REPRESENTING DATA
☐ 1.2.2 HOW BINARY IS USED TO STORE DATA
☐ 1.2.3 LOGIC GATES
☐ 1.2.4 TRUTH TABLES, CIRCUITS, EXPRESSIONS AND K MAPS
☐ 1.2.5 LOGIC CIRCUIT DIAGRAMS - COMING SOON
A1.3 OPERATING SYSTEMS AND CONTROL SYSTEMS
☐ 1.3.1 ROLE OF OPERATING SYSTEMS
☐ 1.3.2 FUNCTIONS OF OPERATING SYSTEMS
☐ 1.3.3 APPROACHES TO SCHEDULING
☐ 1.3.4 INTERUPT HANDLING
☐ 1.3.5 MULTITASKING
☐ 1.3.6 CONTROL SYSTEM COMPONENTS
☐ 1.3.7 CONTROL SYSTEM APPLICATIONS