Module Review
1.1.1 Architecture of the CPU
A Computer System
- A computer system consists of hardwareThe physical components of a computer, such as the CPU, memory, and input/output devices. and softwareThe programs and operating systems that run on a computer to perform specific tasks. working together to process data and perform tasks.
- It follows a basic process: input, processing, and output.
- Input devicesDevices such as keyboards, mice, or controllers that send data into a computer., such as keyboards and mice, receive data.
- The CPU processes data using programmed instructions.
- The processed data is sent to an output deviceA device such as a monitor or speaker that displays or transmits processed data to the user., such as a monitor or speaker.
The Purpose of the CPU
- The Central Processing Unit (CPU) executes instructions and performs arithmetic and logical operations on data.
- It operates using the fetch-execute cycle.
- The CPU controls all other parts of the computer.
The Fetch-Execute Cycle
- The fetch-execute cycle is how the CPU processes instructions.
- FetchThe stage where the CPU retrieves an instruction from memory.: The CPU retrieves the next instructionA command that tells the CPU what operation to perform. from memoryA unified system that stores both data and program instructions in the same location. using the Program Counter (PC)A register that holds the memory address of the next instruction to be fetched..
- DecodeThe stage where the CPU interprets the instruction using the Control Unit (CU).: The Control Unit (CU)The CPU component responsible for managing and coordinating the fetch-execute cycle. It directs data flow within the CPU. decodes the instruction to determine what it must do.
- ExecuteThe stage where the CPU carries out the operation specified by the instruction.: The CPU performs the required operation using data from registersSmall, high-speed storage units within the CPU that temporarily hold data during processing. or memory.
- StoreThe stage where the CPU saves the result of the execution back into memory or registers.: If necessary, the results are saved back into memory or registers.
Common CPU Components and Their Functions
- The Arithmetic Logic Unit (ALU)The CPU component that performs arithmetic (e.g., addition, subtraction) and logical operations (e.g., AND, OR). performs arithmetic operations such as addition and subtraction.
- The ALU also performs logical operations such as AND and OR.
- The Control Unit (CU) manages and coordinates the fetch-execute cycle.
- The CU retrieves instructions from memory using the Program Counter (PC).
- The CU controls the flow of data and signals between CPU components.
- Cache is a small, high-speed memory within the CPU that stores frequently used data and instructions.
- Cache improves system performance by reducing the need to access slower RAM.
- Registers are high-speed storage units inside the CPU used for temporary data storage.
- The Memory Address Register (MAR)A register that holds the memory address of the data or instruction being fetched or stored. stores the address of the next data or instruction to be accessed.
- The Memory Data Register (MDR)A register that holds the actual data or instruction that has been fetched from or is being written into memory. holds the actual data or instruction fetched from or written to memory.
- The Program Counter (PC) keeps track of the address of the next instruction to be executed.
- The AccumulatorA register that stores intermediate results of arithmetic and logical operations. stores intermediate results from ALU operations.
Von Neumann Architecture
- The Von Neumann architecture describes the structure of modern computer systems.
- It was designed by John von Neumann.
- The Central Processing Unit (CPU) executes instructions and processes data.
- Memory (RAM) stores both data and program instructions in the same memory space.
- Input and Output (I/O) devices allow interaction with the computer.
- The busA communication pathway that transfers data and instructions between the CPU, memory, and input/output devices. system transfers data and instructions between the CPU, memory, and I/O devices.
- The Von Neumann architecture defines how the CPU interacts with memory, buses, and I/O devices.
1.1.2 CPU Performance
Clock Speed
- Measured in Hertz (Hz), clock speed represents the number of cycles a CPU can execute per second.
- Each cycle is a basic unit of work performed by the CPU.
- A higher clock speed allows the CPU to perform more cycles in a given time, leading to faster processing.
Effects of Clock Speed on Performance
- Single-Core Performance: Higher clock speeds improve the performance of single-core tasks by executing instructions faster.
- Multi-Core Performance: In multi-core tasks, each core benefits from a higher clock speed, leading to improved overall performance.
- Heat and Power Consumption: Increasing clock speeds results in higher power consumption and heat generation, requiring advanced cooling solutions.
- Limitations: Further increases in clock speed face physical challenges such as heat dissipation and power constraints.
Cache Size
- Cache is a small, high-speed memory on the CPU that acts as a buffer between the CPU and RAM.
- Cache memory is much faster than RAM, allowing quicker access to frequently used data.
Effects of Cache Size on Performance
- Data Access Speed: A larger cache allows the CPU to store frequently accessed data, reducing delays and improving performance.
- Cache Hit Rate: A higher cache hit rate means the CPU can retrieve data from cache instead of slower main memory, enhancing efficiency.
- Cache Levels: CPUs have multiple cache levels (L1, L2, L3), with smaller, faster caches storing the most critical data.
- Cost and Complexity: Larger caches increase CPU manufacturing costs and complexity.
Number of Cores
- The number of cores in a CPU determines how many tasks can be processed simultaneously.
- Each core can execute its own set of instructions, enabling parallel processing.
Effects of Number of Cores on Performance
- Parallelism: More cores improve performance in multi-threaded applications by allowing tasks to run simultaneously.
- Single-Core Performance: Some applications rely more on single-core performance, where higher clock speeds may be preferable.
- Core Management: The operating system must efficiently distribute tasks among cores to maximise performance.
- Power Consumption: CPUs with more cores generally consume more power, especially under heavy workloads.
Combining Characteristics
- Balancing Clock Speed and Cores: A mix of high clock speeds and multiple cores provides strong performance for both single-core and multi-core tasks.
- Cache and Multi-Core Processing: A larger cache enhances multi-core efficiency by reducing data access bottlenecks.
- Workload Dependency: Different workloads benefit from different CPU characteristics, such as clock speed, cache size, or core count.
1.1.3 Embedded Systems
Embedded Systems
- An embedded system is a dedicated computing system integrated into a larger device to perform specific tasks.
- Unlike general-purpose computers, embedded systems are designed for efficiency and specific applications.
- They are often hidden from users, enabling seamless control, monitoring, and optimisation of device operations.
Functions of Embedded Systems
- Real-Time Control: Responds to external events within strict time constraints, such as anti-lock braking systems in cars.
- Device Management: Manages device operations to enhance functionality and user experience.
- Data Processing: Processes data locally to reduce external communication and improve security.
- Sensing and Feedback: Uses sensors to monitor conditions and take appropriate action based on the data received.
Characteristics of Embedded Systems
- Specific Functionality: Designed to perform a particular task with no unnecessary features.
- Real-Time Operation: Must respond quickly to inputs, such as airbag deployment in cars.
- Resource Constraints: Operates with limited processing power, memory, and energy.
- Integration: Embedded seamlessly into devices for smooth functionality.
- Reliability: Designed for long-term stability, particularly in safety-critical applications.
- Power Efficiency: Optimised for low energy consumption, extending battery life or reducing energy use.
Examples of Embedded Systems
- Microcontrollers: Compact computing units with a CPU, memory, and peripherals, used in automation and hobby projects.
- Automotive Control Systems: Found in modern vehicles for engine control, braking, stability, airbags, and infotainment.
- Home Automation Systems: Control lighting, heating, security, and smart appliances for convenience and energy efficiency.
- Medical Devices: Used in pacemakers, insulin pumps, and defibrillators, requiring high reliability and accuracy.
- Consumer Electronics: Present in smartphones, smart TVs, gaming consoles, and digital cameras for enhanced functionality.
- Industrial Automation: Used in manufacturing processes, including Programmable Logic Controllers (PLCs) and SCADA systems.
