FTC disclaimer: This post contains affiliate links and I will be compensated if you make a purchase after clicking on my link.
Registers are temporary storage area in the CPU that accept, quickly store, and transfer data and instruction that can be used and processed by the CPU immediately.
A computer register is also known as Immediate access to memory stores or Internal memory.
Currently, the modern CPU architectures hold two types of registers – Internal registers and User-accessible registers.
Internal registers are only accessed within the processor while the User-accessible registers are easily accessible from outside of processors.
Before moving on, let’s understand what the functionality of the computer register is.
The function of the register in the computer
The function of the computer register is to process the data entered by the user. It will go through below three steps:
Fetch – The fetch functionality is performed by fetching data and instruction from the main memory, which was input from the user.
Decode – The decode functionality work is to interpret the data and instruction between the user and the CPU.
Execute – The last step is to execute the operation, in which it gives a signal to the CPU to process the instruction and data provided by the user.
What are the main types of registers in computer
The computer register has the following two parts.
- Internal registers
- User-accessible registers
Internal registers, also known as internal memory, are a type of computer register that works to perform inside the processors, and its functionality cannot be accessed externally.
The internal register either work in pairs or as a single unit. Its work is to control the instruction or data and execute them so that CPU can further process it.
Moreover, the internal register storage time is hugely temporary. It cannot hold the data for more than a millisecond.
There are mainly three types of internal register:
Instruction Register (IR)
Instruction Register holds instruction that is fetched from the main memory. The size of the instruction it can have is 16 bit.
The control unit will take instruction from the Instruction Register and send it to the CPU, which will further decode and execute the instruction.
Memory Data Registers (MDR)
Memory Data Registers, also called Memory Buffer Register (MBR), can hold the contents of data or instruction that are coming from the main memory or going to the main memory. It is also a two-way register.
The contents of instruction holding from the main memory are transferred to the Instruction Register (IR) for further processing. On the other hand, the content of data holding from the main memory is transfer to the accumulator.
Memory Address Registrars (MAR)
Memory Address Registers (MAR) holds the address of the memory, which can be later fetched by the CPU to store some data in the memory or to read the data from memory.
User accessible registers
User accessible registers can store more data or instruction compared to internal registers.
The following are the types of User-Accessible registers.
Data Registers (DR)
A data register is used in a microcomputer to temporarily hold the data that are used by the processor to execute an instruction. Then data are transmitted to or from the peripheral device.
It holds the data size of 16 bits.
Accumulator Registers (AR)
Accumulator Registers store data that are fetched by the control unit from the main memory. The data transfer for further operation during the arithmetic and logical operation of ALU (Arithmetic and Logic Unit).
Once the process of data is successful, it is transferred to the main memory through the Memory Buffer Register (MBR).
Accumulator Register holds the data size of 16 bits.
Address Registers (AR)
It stores the address of the main memory that holds the instruction or data.
It can either hold the exact absolute address or the offset value.
Program Counter (PC)
Program Counter, also known as Instruction Pointer Register, store the address of the next instruction, which is to be fetched for execution.
It maintains the right sequence of instruction and also the flow of instruction to be executed.
General Purpose Register (GPR)
General Purpose Register (GPR), also known as the Integrated register, holds both address and data during ongoing operation.
Floating-Point Registers (FPR)
The Floating-point registers are used as temporary storage for floating-point numbers.
Vector registers store the location of data that are being executed and processed under a one-dimensional array instruction.
The constant registers can hold read-only data types such as pie, zero, and one.
The status registers hold the values in a true or false format that later help in the decision of execution of the statement.
Computer registers are temporary storage of data, which means the storage of data is volatile.
It helps in retrieving the data or instructions quickly and enhances the program execution speed.
Moreover, it is also easily accessible to CPU, Memory, and other components of computers.