Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Processor Registers and Types Explained: How are Registers Different from the Cache and Main Memory?

Modern computers include different kinds of Memory. The main memory or RAM, the cache and then the registers. The CPU registers are the easiest accessible memory location and sit on the top of the memory hierarchy. They are much smaller than local memory and are used to store and execute machine instructions, memory addresses, and certain other values. Data is loaded from the main memory to the registers (via the CPU cache) after which it undergoes various arithmetic operations. The manipulated data is then written back to the memory via the CPU cache.

Processor Registers: Intro and Function

The size of a register usually depends on the CPU type. A 64-bit processor will have 64-bit registers as it deals with 64-bit instructions. There are, however, other smaller registers too called half registers for executing shorter instructions.

Other than providing the CPU with a platform to execute machine instructions at a steady pace, the registers also improve the latency in repetitious tasks (just like the cache memory). By storing the memory addresses of frequently accessed data, the performance can be significantly improved.

Physical vs Logical Registers

Modern processors tend to have multiple physical registers associated with every physical register. Programmers and designers interface with the logical registers while their physical counterparts are manipulated indirectly. This helps avoid false data dependencies that may arise from the repeated use of the same register by successive instructions which in turn improves instruction-level parallelism. It also allows speculative execution and branch prediction.

What is Intel Optane: Optane Memory vs RAM? What’s the Difference?

Importance of CPU Cache: Difference Between L1, L2 & L3 Caches

Types of CPU Registers

Modern processors have several different kinds of registers, the main ones being data registers, address registers, general-purpose registers, and special-purpose registers.

General Purpose Registers (GPRs): General purpose registers are a unified kind of register. The can hold memory addresses, data values as well as floating-point values. They are generally used by most modern CPUs as well as GPUs due to their flexibility.

Special Purpose Registers (SPRs): Special-purpose registers are generally used to store the program state. They usually consist of the program counter and the status register. Modern architectures usually combine the two into one register.

Accumulator: The accumulator stores integer values that may be required by the ALU for the execution of a particular instruction. The accumulator is a General Purpose Register.

Memory Address Registers: The address registers hold the memory addresses of the next address to be executed to the CPU. They are stored in the address register by the Progam Counter. The accumulator is a Special Purpose Register.

Program counter: The program counter is a kind of SPR. It exists in the Control Unit of the CPU and holds the memory address of the next instruction to be executed. It handles the job of putting the instructions back in order and keeps a track of the number of the executed instructions. The accumulator is a Special Purpose Register.

Memory Data Registers: After the Program Counter enters the memory address into the MAR, the processor fetches the required instructions and data from the memory (via the cache) and a temporary copy is stored in the data register. The accumulator is a Special Purpose Register.

The data registers store data in the form of numeric values such as integers and sometimes, floating-point values. Many architectures have separate registers for FP values. In primitive designs, the data register is also called the accumulator.

Current Instruction Register: The CIR holds a copy of the instruction currently in the MIR. It is split into two parts. One is decoded into micro-ops by the CPU decoder and the other is the memory address of the required data needed for their execution. The accumulator is a Special Purpose Register.

The post Processor Registers and Types Explained: How are Registers Different from the Cache and Main Memory? appeared first on Hardware Times.



This post first appeared on , please read the originial post: here

Share the post

Processor Registers and Types Explained: How are Registers Different from the Cache and Main Memory?

×

Subscribe to

Get updates delivered right to your inbox!

Thank you for your subscription

×