CPU stands for Central Processing Unit, and controls all applications and programs running on the computer it is essentially the brains of the computer.
The CPU is the most important hardware component in a computer. It has two main functions:
The primary purpose of a CPU (Central Processing Unit) is to execute instructions that are stored in memory. These instructions make up a program, and the CPU is responsible for fetching, decoding, and executing them in order to perform the desired computation or operation.
The CPU also acts as the "brain" of a computer, controlling and coordinating the activities and interactions of all the other components in the system, such as memory, storage, and input/output devices. It uses a combination of internal registers, buses, and control logic to manage and direct the flow of data and instructions throughout the system.
The central processing unit (CPU) consists of 6 main componets parts:
Arithmetic Logic Unit (ALU): This is the component of the CPU that performs mathematical and logical operations, such as addition, subtraction, comparison, and bitwise operations.
Control Unit (CU): This component fetches instructions from memory, decodes them to determine the operation to be performed, and controls the flow of data and instructions throughout the system.
Registers: These are small, high-speed storage locations within the CPU that hold data and instructions that are currently being processed. They are used to temporarily store data and intermediate results during computation.
Cache: A small, high-speed memory used by the CPU to store recently accessed data and instructions. This can help to speed up processing by reducing the number of times the CPU needs to access main memory.
Buses: These are communication pathways that connect the CPU to other components in the system, such as memory and input/output devices. They are used to transfer data and instructions between the CPU and these other components.
Clock: A timing circuit that generates a regular pulse used to synchronize the operations of the CPU and other components in the system.
All components work together to allow processing and system control.
What do each of the components do in more detail?
The Arithmetic Logic Unit (ALU) is a component of the CPU that performs mathematical and logical operations. It is responsible for executing the instructions that make up a program, such as arithmetic operations (e.g., addition, subtraction, multiplication, and division) and logical operations (e.g., AND, OR, NOT, and XOR).
The Control Unit (CU) is a component of the CPU that manages the flow of instructions and data throughout the system. It is responsible for fetching instructions from memory, decoding them to determine the operation to be performed, and controlling the execution of those instructions.
Registers are small, high-speed storage locations within the CPU that hold data and instructions that are currently being processed. They are used to temporarily store data and intermediate results during computation.
There are 4 main registers:
program counter - holds the memory address of the next instruction to be executed
memory address register (MAR) - holds the memory address of the current instruction, and then the data that it uses, so that these can be fetched from memory
memory data register (MDR) - holds the actual instruction, and then the data that has been fetched from memory
accumulator (ACC) - holds the result of an instruction before it is transferred to memory
Cache is a small, high-speed memory that is located within the CPU, used to temporarily store frequently accessed data and instructions. It is used to speed up the performance of the CPU by reducing the number of times it needs to access main memory.
In a CPU, buses are groups of wires or pathways that are used to transfer data and instructions between different components of the CPU and between the CPU and other components of the computer, such as memory and peripheral devices. One of the most known types of buses is a USB (universal serial bus), there is a good chance there one plugged into your computer right now.
The clock in a CPU is an electronic circuit that generates a steady stream of pulses, called clock cycles, that are used to synchronize the different components of the CPU.
The fetch-decode-execute cycle is the basic operation cycle of a computer's central processing unit (CPU). It is the process that the CPU uses to execute instructions stored in memory. The cycle is composed of the following 7 steps:
The memory address held in the program counter is copied into the MAR.
The address in the program counter is then incremented (increased) by one. The program counter now holds the address of the next instruction to be fetched.
The processor sends a signal along the address bus to the memory address held in the MAR.
The instruction/data held in that memory address is sent along the data bus to the MDR.
Results of processing are stored in the Accumulator.
The cycle then returns to step one.
Art style for this page - Photo Realism