Inside a CPU is a group of different microchips that collectively work together to serve the functionality of a CPU.
To interact with other devices on the system, the CPU contains input and output lanes which are physically connected (via ‘busses’ on the circuit board) to those devices.
I/O can include keyboards, mice, monitors, speakers.
Registers are data storages that lie in the CPU. They have a fixed size (as specified by the CPU architecture).
Compared to other memory devices (i.e. RAM, SSDs, HDDs, etc…) - the CPU’s access to its registers is very fast.
The CPU uses registers to perform all of its state-related operations.
The function and purpose of General Purpose registers are dictated by the software and code being executed.
When data from the RAM / other storage devices are requested, they are eventually loaded into these registers to be processed.
Programs will generally interact with these registers the most.
i.e. Intel x86 Architecture: 8, 16, 32 bit registers
Location registers contain various addressed required by the CPU to perform instructions.
A CPU would contain a status register - that holds various attributes/flags about the CPU’s current state. These are used by future instructions
30-30
=> zero flag
= 1
30-15
=> zero flag
= 0
30-50
=> sign flag
= 1
Each different flag is (usually) 1-bit long, and such a 32-bit status register can hold 32 different flags.
Control registers dictate the deep internal operation of how the CPU uses its registers, resources and other devices in the system