An address register is a crucial component of a computer's memory system, designed to store and track the locations of data within system memory. It plays a vital role in the Von Neumann architecture, offering high efficiency and speed for handling data addresses and instruction execution.
Understanding Address Registers
Address registers were conceptualized by mathematician John von Neumann, who viewed data as a vector with both direction and magnitude. This led to the creation of two primary registers:
- Memory Address Register (MAR)
- Memory Data Register (MDR)
The MAR stores data locations, while the MDR holds the actual data. In modern computing, the MAR is a CPU register that stores:
- Memory locations for data retrieval
- Data addresses sent through the system bus
Address registers function differently based on instruction types:
- For reading: Data addresses in MAR are sent to MDR, then used by CPU
- For writing: CPU writes data from MDR to memory locations stored in MAR
The MAR typically interfaces with either the cache or Random Access Memory (RAM).
Types of Address Registers
- Destination Memory Address Register (DMAR)
- Source Memory Address Register (SMAR)
- Control Memory Address Register
- Control Data Register
Functions of Address Registers
Address registers primarily:
- Store addresses for data transfer to the CPU
- Hold addresses of current instructions to be fetched
- Store memory addresses for data movement
In a bus setting, the MAR acts as a simple register, outputting the target address when the control signal is high.
Base Address Register (BAR)
The Base Address Register is a pointer to a memory byte, specified by an offset. It serves two main purposes:
- Specifying required memory for device mapping
- Holding the base address after device enumeration
BARs are crucial in PCIe devices, allowing memory mapping and data exchange.
Address Registers in DMA
In Direct Memory Access (DMA), the address register holds the start address where data is to be copied. The DMA controller uses this information to manage data transfers without CPU intervention.
Address Register Size
Address register sizes typically range from 12 to 64 bits, depending on the type and memory size. Modern processors generally support:
- 8 bits
- 16 bits
- 24 bits
- 32 bits
- 64 bits
The size of the address register is often related to the computer's word size and addressable memory space.
Location of Address Registers
Address registers are located inside the CPU, specifically on the memory processing component. They control the region from which information is fetched.
Conclusion
Address registers are essential components of the CPU, containing addresses of chosen memory words. They facilitate efficient data retrieval and movement within the computer system, playing a crucial role in memory management and data processing.