CPU
CPU = brains of the computer. primary component that carries out most of processing and computing tasks.
It is a microchip typically mounted on the motherboard and connected to other components like memory, storage devices & input/output devices.
Very important. It can greatly effect overall speed/efficiency of the system.
Functions of the CPU
Responsible for executing instructions stored in the memory
Performing arithmetic and logical operations
Controlling input/output operations
Parts of the CPU
ALU
CU
Cache
Buses
Registers
Storage Unit
Bus - set of wires/pathways that allows CPU to connect to other components
Clock - provides timing signal that syncs activities of other components
Cache - small amount of high-speed memory. used to store frequently accessed data and instructions so the CPU can access them more quickly.
Control Unit - Responsible for fetching instructions from memory and executing them by coordinating other components’ activities.
ALU (Arithmetic Logic Unit) - Performs arithmetic and logical operations e.g. add, subtract, comparisons etc.
Registers - temp. storage areas that hold data and instructions the CPU is currently processing.

How a computer works

Fetch, execute cycle

Used by all CPUs regardless of specific design or architecture.
Allows the CPU to execute instructions in a systematic and efficient manner, ensuring programs are executed correctly and in the same order.
Fetch
CPU receives instructions from memory.
address of instruction is determined by program counter (PC) register, which keeps track of memory address of the next instruction to be executed.
Execute
CPU decodes instruction
performs appropriate operation. (may involve accessing data from memory/registers, performing arithmetic operations in the ALU, or issuing commands to other parts of the computer.
Program Counter
Once instruction is completed, PC is updated to point to the next instruction in the memory, and cycle starts again with fetch Continues until program is finished or CPU is halted

Memory Address Register (MAR)
MAR = register in a CPU that holds memory address of data the CPU needs to access/modify in memory
Von-Neumann Architecture

Consists of CPU, memory, in/output devices, and a bus that connects them.
In this architecture, CPU executes a list of instructions that are stored in memory.
Instructions are:
fetched from memory
decoded
then executed.
Harvard Architecture


Von-Neumann vs. Harvard Architecture