Home »
Computer Science Organization
Types of Register in Computer Organization
By Prerana Jain, on July 05, 2018
This is a part of the central processing unit, reside inside the CPU. The information from main memory is brought to CPU and keeps the information in register due to space and cost constraints, there is the limited number of registers in a CPU.
1. User-visible register
The user-visible registers are those which enables the machine or assembly language programmer to minimize the main memory references by the operating system.
i. General purpose register
- It can be assigned to a variety of functions by the programmer.
- Sometimes their use within the instruction set is orthogonal (right angle )to the operations.
- The general purpose register can contain the operand for any opcode.
- This provides true general purpose register use.
- However, there are restrictions.
- For example, there may be dedicated register for floating point and stack operations.
- In some cases, general purpose register can be used for addressing functions (e.g register indirect, displacement).
ii. Data register
It is used only to hold data and cannot be employed in the calculation of an operand address.
iii. Address register
They may be somewhat general purpose or they may be devoted to a particular addressing mode.
Examples include the following,
- Segment pointers: In a machine with segmented addressing a segment register to hold the address of the base of the segment.
- Index register: These are used for indexed addressing and maybe auto indexed.
- Stack pointer: There is some user-visible stack addressing registers which basically points to the top of the stack. This allows implicit addressing that is pushed, pop and other stack instruction need not contain an explicit stack operand.
- Condition code: Condition codes are Partially visible to the user holds conditions(also referred to as flag). Condition codes are what types of bits which is set by the processor hardware as the result of operations. For example, arithmetic operations may produce a positive, negative zero, or overflow result.
2. Control and status register
The control register is used by the control units to control the operations of the processor and the status register are used to check the status of the register.
Most of the machine these registers are not visible to the users. But some of the registers are visible to machine instructions which are executed in a control operating system mode.
Four registers are essential to instructions execution,
- Program Counter (PC): It is a type of register that contains the address of an instruction to be fetched.
- Instruction register (IR): It is a type of register that contains the instruction most recently fetched.
- Memory address register (MAR): It is a type of register that contains the address of a location in memory.
- Memory buffer register (MBR): It is a type of register that contains a word of data to be written to memory or the word most recently read.
Reference: Introduction to CPU