Flat memory model

Flat memory model

In computer systems design, a flat memory model refers to a linear addressing paradigm, such that the CPU can directly (and sequentially) address all of the available memory locations, without having to resort to any sort of bank switching or memory segmentation or paging schemes.

Memory management and logical-to-physical address translation can still be implemented "on top of" a flat memory model in order to facilitate the operating system's functionality, resource protection, multi-tasking or to increase the memory capacity beyond the limits imposed by the processor's physical address space, but the key feature of a flat memory model, is that the entire memory space is linear, sequential and contiguous from address zero to MaxBytes-1.

Memory management is therefore possible, optional. It is neither necessary, nor dictated by the CPU architecture:

*In a simple controller, or in a "single tasking" embedded application, where memory management is not needed nor desirable, the flat memory model is the most appropriate, because it provides the simplest interface from the programmer's point of view, with direct access to all memory locations and minimum design complexity.

*In a general purpose computer system, which requires multi-tasking, resource allocation and protection, the flat memory system must be augmented by some memory management scheme, which is typically implemented through a combination of dedicated hardware (inside or outside the CPU) and software built into the operating system. The flat memory model (at the physical addressing level) still provides the greatest flexibility for implementing this type of memory management.

The vast majority of processor architectures do implement a flat memory design, including all early 8-bit processors, the Motorola 68K series ... etc. The original Intel 8086 was an exception to this rule which implemented a segmented memory model, because it provided an easy form of memory management with flexible page boundaries for early operating systems such as DOS.

Most modern memory models fall into one of three categories:

* Flat memory model:
** Simple interface for programmers, clean design.
** Greatest flexibility
** Minimum hardware and CPU real estate for simple controller applications
** Maximum execution speed
** Not suitable for general computing or multi-tasking operating systems, unless enhanced with additional memory management hardware/software, but this is almost always the case in modern CISC processors, which implement advanced memory management and protection technology over a flat memory model.

* Paged memory model:
** Suitable for multitasking, general operating system design, resource protection and allocation.
** Suitable for virtual memory implementation.
** More CPU real estate, somewhat lower speed
** More complex to program
** Rigid page boundaries, not always the most memory efficient.

* Segmented memory model:
** Similar to paged memory, but paging is achieved by the implicit addition of two relatively shifted registers: segment:offset
** Variable page boundaries, more efficient and flexible than the paged memory model
** Quite complex and awkward from a programmer's point of view
** More difficult for compilers.
** Pages can overlap / poor resource protection and isolation
** Many to one address translation correspondence: Many segment:offset combinations resolve to the same physical address
** Greater chance of programming errors
** Implemented in original Intel 8086, 8088, 80186, 80286 and supported by 80386 and all subsequent x86 machines through to present day Pentium and Core 2 processors. This memory model has remained ever since in the x86 machines, which now provide multi-mode operation and rarely operate in the compatible segmented mode anyway.

Within the x86 architectures, when operating in the real (compatible) mode, physical address is computed as:

Address = 16*segment + offset

(i.e. The 16-bit segment register is shifted left by 4 bits and added to a 16-bit offset, resulting in a 20 bit address)

Finally, there seems to be some confusion regarding the relationship between a flat memory model and Von Neumann vs Harvard architectures.

A Von Neumann architecture specifies that instructions and data are both stored within the same memory and transferred over the same bus. This type of architecture is the most space efficient, because any memory not used by the program is available for data and vice versa. This type of architecture is most often used in general computing.

A Harvard architecture, on the other hand, separates instructions and data into two separate memories which are typically accessed over two separate buses. The benefit is an increase in system performance because data (for the present instruction) and code (for the future instruction) can be fetched at the same time. Also, in a Harvard architecture, the instruction and data buses can have different speeds and geometries. The drawback is that Harvard architectures force the designer to make assumptions about the ratio of instruction vs data memory, and this memory cannot be re-allocated at run time. The system is therefore unavoidably more wasteful. This type of architecture is most often used in Digital Signal Processing, Real Time Control and ultra-high speed RISC applications, where performance is of the maximum importance and everything else is secondary.

The point is that neither of the above architectures makes any claims whether the memory addressing model is flat, segmented, paged or otherwise.

ee also

* Memory model (computing)
* address space


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Memory model — may refer to: Psychology Atkinson–Shiffrin memory model Baddeley s model of working memory Memory prediction model Informatics In computer software, a memory model describes how threads interact through memory, or what assumptions the compiler… …   Wikipedia

  • C memory model — Memory models in the C programming language are a way to specify assumptions that the compiler should make when generating code for segmented memory or paged memory platforms.For example, on the 16 bit x86 platform, six memory models exist. They… …   Wikipedia

  • Intel Memory Model — The Intel x86 cpu has six memory models which control how the segment registers are used and the default size of pointers. Contents 1 Memory segmentation 2 Pointer sizes 3 Memory models 4 …   Wikipedia

  • Memory architecture — describes the methods used to implement electronic computer data storage in a manner that is a combination of the fastest, most reliable, most durable, and least expensive way to store and retrieve information. Depending on the specific… …   Wikipedia

  • Memory management unit — This 68451 MMU could be used with the Motorola 68010 A memory management unit (MMU), sometimes called paged memory management unit (PMMU), is a computer hardware component responsible for handling accesses to memory requested by the CPU. Its… …   Wikipedia

  • X86 memory segmentation — refers to the implementation of memory segmentation on the x86 architecture. Memory is divided into portions that may be addressed by a single index register without changing a 16 bit segment selector. In real mode or V86 mode, a segment is… …   Wikipedia

  • Out of memory — in Linux 2.6.32 Out of memory (OOM) is a state of computer operation (often undesired) where no additional memory can be allocated for use by programs or the operating system. Such a system will be unable to load any additional programs and since …   Wikipedia

  • MEMORY — holocaust literature in european languages historiography of the holocaust holocaust studies Documentation, Education, and Resource Centers memorials and monuments museums film survivor testimonies Holocaust Literature in European Languages The… …   Encyclopedia of Judaism

  • Entity–attribute–value model — (EAV) is a data model to describe entities where the number of attributes (properties, parameters) that can be used to describe them is potentially vast, but the number that will actually apply to a given entity is relatively modest. In… …   Wikipedia

  • Entity-attribute-value model — (EAV), also known as object attribute value model and open schema is a data model that is used in circumstances where the number of attributes (properties, parameters) that can be used to describe a thing (an entity or object ) is potentially… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”