Memory address 568018 219942042 2008-06-17T15:39:27Z Faalagorn 4907692 /* Word size versus address size */ as of 2008 +wikEd blanks & empty lines fix In [[computer science]], a '''memory address''' is an identifier for a [[computer memory|memory]] location, at which a [[computer program]] or a hardware device can store a piece of data for later retrieval. By common example, this identifier could be a [[binary numeral system|binary]] [[number]] from a [[finite]] monotonically ordered sequence. In modern ''byte-addressable'' computers, each address identifies a single [[byte]] of storage; data too large to be stored in a single byte may reside in multiple bytes occupying a sequence of consecutive addresses. Some microprocessors were designed to be ''[[Word (computer science)|word]]-addressable'', so that the addressable storage unit was larger than a byte. Examples include the [[Texas Instruments TMS9900]] and the [[National Semiconductor]] [[IMP-16]], both of which used 16 bit words. In [[computer program]], an '''absolute address''', also called '''explicit address''' or '''specific address''', is a memory address that uniquely identifies a location in memory.{{Fact|date=November 2007}} This is opposed to a '''relative address''', that is not unique and specifies a location only in relation to some other location (the ''[[base address]]''). ==Contents of a memory location== Each memory location, in both [[ROM]] and [[RAM]] memory, holds a generic [[Binary numeral system|binary number]] ''of some sort''. How it is interpreted, its type, and meaning, and usage, only depends on the context of the [[instruction (computer science)|instruction]]s which retrieve and manipulate it. Each such coded item has a unique physical position which is described by another unique binary number, the address of that single word, much like each house on a street has a unique number. A [[pointer]] is an address itself stored, as data, in some other memory location. The interesting concept about items stored in memory: not only they can be interpreted as [[data]]&mdash;text data, binary numeric data, and so forth&mdash;but also as ''instructions'' themselves, in a uniform manner. This uniformity was introduced with [[von Neumann architecture]] and is prevalent in computers since the 1950s. Instructions in a storage address are contextually interpreted as command words to the system's main processing unit, and data is retrieved by such instructions placed in an internal and isolated memory structure called a [[storage register]], where the subsequent instruction can manipulate it in conjunction with data retrieved into other internal memory locations (or '''internal addresses'''). Registers are the memory addresses within the part of the central processing unit known as the [[arithmetic logic unit]] (ALU), which responds to binary instructions (machine code) fetched into instruction registers selecting combinatorial logic determining which [[computer register|data register]]s should be added, subtracted, circulated (shifted), and so forth at the low [[machine language]] level of binary manipulation of data. === Word size versus address size === A word size is characteristic to a given [[computer architecture]]. It denotes the number of bits that a CPU can process at one time. Historically it has been sized in multiples of four and eight bits (''nibbles'' and ''bytes'', respectively), so sizes of 4, 8, 12, 16, 24, 32, 48, 64, and larger came into vogue with technological advances. Very often, when referring to the ''word size'' of a modern computer, one is also describing the size of address space on that computer. For instance, a computer said to be "[[32-bit]]" also usually allows 32-bit memory addresses; a byte-addressable 32-bit computer can address <math>2^{32} = 4,294,967,296</math> bytes of memory, or 4 [[gibibyte]]s (GiB). This seems logical and useful, as it allows one address to be efficiently stored in one word. However, this is not always the case. Computers often have memory addresses larger or smaller than their word size. For instance, almost all [[8-bit]] processors, such as [[MOS Technology 6502|6502]], supported 16-bit addresses, or else they would have been limited to a mere 256 [[byte]] capacity. Similarly, the [[16-bit]] [[Intel 8086]] supported 20-bit addressing, allowing it to access 1 [[MiB]] rather than 64 [[KiB]]s of memory. Also popular [[Pentium]] processors since introduction of [[Physical Address Extensions]] (PAE) support 36-bit physical addresses,<!-- as opposed to virtual: see below --> while generally having only a 32-bit word. A modern byte-addressable [[64-bit]] computer&mdash;with proper OS support&mdash;has the capability of addressing <math>2^{64}</math> bytes (or 16 [[exbibyte]]s) which [[as of 2008]] is considered practically unlimited, being far more than the total amount of RAM ever manufactured. <!-- Transistor invented 60 years ago; 2^64 bytes * 8 bits / 60 years / 365 days / 24 hours / 3600 seconds = 78 trillion transistors per second nonstop, assuming all transistors ever fabricated went into RAM. I think that's unlikely. --[[User:P3d0|P3d0]] 04:41, Nov 25, 2004 (UTC) --> ==Virtual memory versus physical memory== {{main|Virtual memory}} Virtual memory is a mapping of real memory to [[page tables]]. The purpose of virtual memory is to abstract memory allocation, allowing the physical space to be allocated as is best for the hardware (that is, usually in non-contiguous blocks), and to still be seen as contiguous from a program perspective. Virtual memory is supported by some operating systems (for example, Windows but not DOS) in conjunction with the hardware. It is possible to think of virtual memory as a filter, or an alternate set of memory addresses (that are mapped to real address) that allow programs (and by extension, programmers) to read from memory as quickly as possible without requiring that memory to be specifically ordered. Programs use these contiguous [[virtual address]]es, rather than real, and often fragmented, [[physical address]]es, to store instructions and data. When the program is actually executed, the virtual addresses are translated on the fly into real memory addresses. ''[[Logical address]]'' is a synonym of ''virtual address''. Virtual memory also allows enlarging the [[address space]], the set of addresses a program can utilize and thus allows computers to make use of secondary storage that looks, to programs, like main memory. For example, virtual address space might contain twice as many addresses as main memory with the extra addresses mapped to hard disk space in the form of a [[swap file]] (also known as [[page file]]). It copies them back (called [[swapping]]) into main memory as soon as they are needed. These movements are performed in the background and in a way invisible for programs. ==See also== * [[Addressing mode]] * [[Base address]] ** [[Offset (computer science)]], also known as a ''displacement'' * [[Computer engineering]] * [[Computer science]] * [[Endianness]] * [[Physical address]] * [[Virtual memory]] ** [[Virtual address]], also known as [[logical address]] ** [[Page table]] ** [[Memory management unit]] (MMU) [[Category:Computer memory]] [[ar:عنوان مادي]] [[ca:Adreça de memòria]] [[cs:Adresa (programování)]] [[de:Speicheradresse]] [[el:Διεύθυνση μνήμης]] [[es:Dirección de memoria]] [[fr:Adressage mémoire]] [[it:Indirizzo di memoria]] [[nl:Geheugenadres]] [[ja:メモリアドレス]] [[pl:Adres bezwzględny]] [[pt:Endereço (memória)]] [[sv:Minnesadress]]