The Main Registers Of The Microcontroller

Mar 04, 2022

(1) Accumulator A Accumulator A is the most frequently used register in a microprocessor. It has a dual function in arithmetic and logical operations: before the operation, it is used to store an operand; after the operation, it is used to store the result of the sum, difference or logical operation. (2) Data register DR A data register is a temporary storage unit that sends (writes) or reads (read) data to memory and input/output devices through a data bus. It can hold an instruction being decoded, or a byte of data being sent to memory for storage, and so on. (3) Instruction register IR and instruction decoder ID Instructions include opcodes and operands. The instruction register is used to hold an instruction currently being executed. When an instruction is executed, it is first fetched from memory into the data register and then transferred to the instruction register. When the system executes a given instruction, the operation code must be decoded to determine the required operation, and the instruction decoder is responsible for this work. Among them, the output of the opcode field in the instruction register is the input of the instruction decoder. (4) Program counter PC The PC is used to determine the address of the next instruction to ensure that the program can be executed continuously, so it is often called the instruction address counter. Before the program starts to execute, the memory unit address of the first instruction of the program (that is, the first address of the program) must be sent to the PC, so that it always points to the address of the next instruction to be executed. (5) Address register AR The address register is used to save the address of the memory unit or I/O device to be accessed by the current CPU. Due to the speed difference between memory and CPU, address registers must be used to hold address information until the memory read/write operation is complete. Obviously, when the CPU stores data to the memory, the CPU fetches data from the memory, and the CPU reads the instructions from the memory, the address register and the data register are used. Similarly, if the address of the peripheral device is viewed as a memory address unit, then when the CPU and the peripheral device exchange information, the address register and the data register are also needed.

Request a quote