Breaking

Wednesday, August 1, 2018

Types of Register


Types of Register



Register are categorized into two types according to their purpose and function.
  • Special purpose Register
  • General Purpose Register 

General Purpose Register

The type of register that hold data and addresses is called general purpose  register.
General purpose register are used to arithmetic (+,-,*,/) and logic (<,>,=) operations.
Typically theses register are 8-32 bit registers.
 Following are the commonly used purpose registers

1. Accumulator (AX) 
2. Data Register (DX)
3. Base Register (BX)
4. Counter Register (CX)

Accumulator (AX)


Accumulator is general purpose register and is used by CPU (Central processing unit) for performing arithmetic and logic operations and to hold the result of those operations. The accumulator is initially set to zero, and then each number in turn is added to the value in the accumulator. It consists of  two 8-bit register (AH and AL) which can be combined together and used as a one 16-bit register.

Base Register (BX)

The base register can perform arithmetic and data movement and it has some special addressing abilities. Base Register can hold a memory address that points to another variable.  It usually    contains a data pointer.  It consists of two 8-bit register (BH and BL) which can be combined    together and used as a one 16-bit register.

Counter Register (CX)

The counter register acts as a counter for repeating or looping instructions. The instructions given are automatically repeated and will decrement the value of counter register and quits when it is equal to 0. It consists of two 8-bit registers (CH and CL) which can be combined and used as 16-bit register counter register.

Data Register

Data register has a special role in multiply and divide operations. It works like a buffer and holds anything that is copied from the memory ready for the processor to use it. It also consists of two        8-bit register (DH and DL) and can register can used as port number.

Special Purpose Registers

These register hold the state of a program. They include program counter, instructions register, memory address register and memory buffer registers. These are used by control the operations        of Central processing unit and by the operating system programs to control the executions of the programs.

Following are the special purpose registers.
1. Instruction Register (IR)
2. Memory Address Register (MAR)
3. Memory Buffer Register (MBR)
4.  Program Counter (PC)

Instruction Register (IR)

Instruction register is a part of control unit, which stores the instructions currently being executed. Each instruction to be executed is loaded into the instruction register. It is also known as current instruction register (CIR) because it holds the current instruction being executed.

Memory Address Register (MAR)

Memory Address Register holds the memory address, the memory address from which data will be provided to the Central processing unit or will have the address to which data will be send and then stored. It basically holds the memory location of data that needs to be accessed. When reading from memory, the data addressed by MAR is fed into the MDR (memory data register) and then is used by the Central processing unit. When writing to memory, the CPU writes data from Data register to the memory location whose address is stored in Memory Address Register. So, in both data is to be read or stored.


Memory Buffer Register (MBR)

The Memory Buffer Register actually holds the contents of the memory which are to be moved from memory to other components or from components to the memory. In order to store a word it must be transferred to Memory Buffer Register and then allowing the processor and memory units to act  independently.

Program Counter (PC)


Program Counter is also known as instruction Pointer. It is a register in a computer processor          that contains the address (Location) of the instruction being executed at the current time.  As          each instruction gets fetched, the program counter increases its stored value by 1.  After 
each instruction is fetched, the program counter points to the next instruction in the sequence.



No comments:

Post a Comment