Lesson 3. CPU
Lesson Objective
- Understand the purpose of the CPU.
- Identify the core components of the CPU.
- Explain how Von Neumann Architecture works.
- Explain how main memory is used during the fetch-execute cycle.
- Identify factors that affect the speed of a CPU and select.
- Recommend appropriate hardware for different situations.
Lesson Notes
Central Processing Unit?
The central processing unit (CPU), also known as the main processor, is a vital component within a compute. The CPU executes instructions from computer programs, performing tasks such as:
- Arithmetic operations: Handling mathematical calculations.
- Logic operations: Evaluating conditions and making decisions.
- Control tasks: Managing program flow and coordinating input/output (I/O) operations.
CPU Components
The central processing unit (CPU), often referred to as the "brain" of a computer, comprises several essential components that work together to execute instructions and manage system operations. Here is a list of the key components:
- Control Unit (CU): Responsible for managing instructions.
- Performs three main functions. The processor works by using the "Fetch Decode Execute Cycle".:
- Fetch: Retrieves instructions from memory.
- Decode: Interprets the instructions.
- Execute: Carries out the instructions.
- Repeat
- The CU issues control signals to other hardware components. It also ensures coordinated operations within the CPU.
- Arithmetic Logic Unit (ALU): Performs arithmetic and logical operations:
- Arithmetic: Handles mathematical calculations (addition, subtraction, multiplication, division).
- Logical: Evaluates conditions (e.g., comparisons) and makes decisions.
- Registers: Small, high-speed memory locations within the CPU. Used to store data needed during processing:
- Program counter: Holds the address of the next instruction to be executed.
- Memory address register (MAR): Stores memory addresses.
- Memory data register (MDR): Holds data fetched from memory.
- Current instruction register (CIR): Stores the currently decoded instruction.
- Accumulator (ACC): Temporarily stores intermediate results.
- Cache: High-speed, small amount of random access memory (RAM) built directly into the processor. It temporarily holds frequently used data and instructions. The cache improves overall system performance by reducing memory access time.
- Buses: Wires on the motherboard through which data travels between different parts of the computer. Types of buses include:
- Data bus: Transfers data between CPU and memory.
- Address bus: Carries memory addresses.
- Control bus: Carries control signals.
- Clock: Sends out regular pulses (clock cycles). It synchronizes the timing of various hardware components. It also determines the CPU's processing speed.
Von Neumann Architecture
Von Neumann architecture serves as the foundation for most of the computers we use today. The architecture is named after the mathematician John von Neumann, who designed the specification for the first programmable computer in 1954.
In Von Neumann architecture, both data and software instructions are stored in computer memory (RAM). This is referred to as The Stored Program Concept, which is a design that allows programs themselves to be stored in memory, not just data.
Memory Management
The CPU (central processing unit) retrieves data from various memory components within the computer system. It continues making requests until it finds the necessary data. Most of the data the CPU requires is stored in RAM (random access memory). The closer this data is to the CPU, the faster it can process it. This is why factors like cache size and registers play a crucial role in system performance.
Factors that affect the Speed
The speed of a CPU (central processing unit) can be influenced by several factors:
- Clock Speed:
- The CPU's clock speed, measured in hertz, determines how many fetch-decode-execute cycles it can perform per second.
- Higher clock speeds allow more instructions to be processed in a given time.
- Overclocking can increase clock speed but may cause long-term damage due to increased heat production.
- Cache Size:
- Cache is a small, high-speed memory built directly within the processor.
- It temporarily holds frequently used data and instructions.
- Larger cache sizes reduce the time the processor waits for instructions to be fetched.
- Number of Cores:
- Each processing unit within a CPU is called a core.
- Multiple cores allow parallel execution of instructions.
- Dual-core or quad-core processors provide superior processing power.