How Are RAM Memory Addresses Determined

memory

How are physical memory addresses actually determined or 'created'. What is the process where the byte blocks have a memory address assigned to it?

I understand that this is determined during boot up, before the BIOS is executed. But not exactly sure how or what the process is.

Best Answer

I think the other answer has confused you slightly, and again for low level questions like this I suggest you learn one of the 80s microcomputer or modern microcontroller architectures.

saying that the memory addresses are assigned during manufacture of the RAM chips

This is basically wrong. The chips themselves do not know about absolute addresses from the programmer's point of view.

The key you need to understand is a "multiplexer". Imagine that you have an 8-bit computer with 8-bit addresses, wired to a single RAM chip. Inside the chip, a multiplexer decodes the 8-bit address to one of 256 values, effectively turning on one of 256 wires. That connects a particular group of eight cells in the chip to the data bus, enabling the processor to read or write them.

So far so good. Now you decide the architecture needs more RAM. So you expand the address bus to 12 bits. But each RAM chip only accepts 8 address bits. So you need another multiplexer: this time you take the top 4 bits and decode them to one of 16 possible values, and use that signal to decide which of the 16 RAM chips in the computer to communicate.

Which address maps to which hardware is determined by the address decode logic, the multiplexer in the middle.

It is usual for CPUs to start executing from a fixed memory address, often near the "top" of the address space. Maybe our 12-address-bit CPU starts from 0xF00, for example. In that case it's useful to arrange the hardware around the CPU so that 0xF00 is mapped to a ROM. This is the concept of a "memory map".

how would the computer know the addresses, does it make a massive request during boot up, or what's going on?

There's usually a mix of techniques. The processor will blindly start at some address, so it's the responsibility of the motherboard to provide some code at that address, such as a PC BIOS. That code will then probably go off and scan the memory - DIMMs have a small ROM chip on a separate serial bus that describes how big they are and what speed they support.

On the other hand, smaller systems may have an entirely fixed memory layout chosen by the designer.

PCI cards may also be mapped into the memory space by the BIOS at boot time. This enables the processor to find the video RAM (often on a separate card) and start up the display.

Related Topic