Presentation is loading. Please wait.

Presentation is loading. Please wait.

MICROPROCESSOR MEMORY ORGANIZATION

Similar presentations


Presentation on theme: "MICROPROCESSOR MEMORY ORGANIZATION"— Presentation transcript:

1 MICROPROCESSOR MEMORY ORGANIZATION
Chapter 3 MICROPROCESSOR MEMORY ORGANIZATION

2 3.2.4 Main Memory Organization
Magnetic tapes disks I/O CPU Main memory Cache Auxiliary memory Typical RAM chip RAS CAS Read Write 10-bit address RD WR AD 10 1M X 8 RAM 8-bit data bus DRAM Organization DRAM is addressed via row and column addressing.

3 3.2.4 Main Memory Organization
DRAM Organization 1 -Mb DRAM requiring 20 address bits is addressed using 10 address lines and two control lines, RAS (row address strobe) and CAS (column address strobe). To provide a 20-bit address into the DRAM, a LOW is applied to RAS and 10 bits of the address are latched. The other 10 bits of the address are applied next and CAS is then held LOW. Column Decoder Memory Array A0…A 9 W ord Line Storage Cell Row Decoder RAS CAS

4 3.2.4 Main Memory Organization
The addressing capability of the DRAM can be increased by a factor of 4 by adding External logic is required to generate the RAS and CAS signals and to output the current address bits to the DRAM. 220 X 4 = X 22

5 3.2.4 Main Memory Organization
DRAM controller chips take care of the refreshing and timing requirements needed by DRAMs. DRAMs typically require a 4-ms refresh time, it sends a wait signal to the microprocessor if the microprocessor tries to access memory during a refresh cycle

6 3.2.5 Main Memory Array Design
Memory Array Design means: Interconnecting several memory chips. A microprocessor can address directly a maximum of 216 = 65,536 or 64K bytes of memory locations. M /IO › LOW : if the microprocessor executes an I/O instruction M /IO › HIGH: if the microprocessor executes a memory instruction.

7 3.2.5 Main Memory Array Design
Chip Select M/IO

8 3.2.5 Main Memory Array Design
To connect a microprocessor to ROM/RAM chips, two address-decoding techniques are commonly used: Linear decoding Full decoding. Typical ROM chip Chip select 1 Chip select 2 9-bit address CS1 CS2 AD 9 512 x 8 ROM 8-bit data bus

9 3.2.5 Main Memory Array Design
Linear decoding Suppose we have 4K SRAM chip array comprised of the four 1K SRAM chips This system can be expanded up to a total capacity of 6K using A14, and A15, as chip selects for two more 1K SRAM chips.

10 3.2.5 Main Memory Array Design
Linear decoding Advantage does not require decoding hardware. Linear decoding Disadvantage 1. Bus Conflict: two or more of lines A10-A13are low at the same time, more than one SRAM chip are selected. Solution: software must be written such that it never reads into or writes from any address in which more than one of bits A10-A13are low. 2. Memory Foldback : Wastes a large amount of address space. For example, whenever the address value is B800 or 3800, SRAM chip I is selected. Solution: use full decoded memory addressing.

11 3.2.5 Main Memory Array Design
Full Decoding. Using 3x8 decoder output selects one of the four IK SRAM chips, depending on the values of A12, A11, and A10 Decoder output enabled only when E3 = E2 = 0 and E l = 1

12 3.3.1 Memory Management Concepts
Access to a hard disk is Slow. Solution: use a large and fast locally accessed semiconductor memory SRAM. Unfortunately, the storage cost per bit for this solution is very high. A combination of both off-board disk (secondary memory) and on-board semiconductor main memory must be designed into a system. Gap grew 50% per year

13 3.3.1 Memory Management Concepts
Memory Management Unit (MMU): A device, located between the microprocessor and memory The address used by a programmer will be called a logical address/ Virtual address An address in main memory is called a physical address Control accesses, perform address mappings, and act as an interface between the logical (programmer’s memory) and physical memory

14 3.3.1 Memory Management Concepts
MMU address translation: The MMU can perform address translation in one of two ways: Substitution technique Addition an offset to each logical address to obtain the corresponding physical address

15 3.3.1 Memory Management Concepts
MMU address translation: Substitution technique is faster Offset method has the advantage of mapping a logical address to any physical address as determined by the offset value.

16 3.3.1 Memory Management Concepts
MMU address translation: Memory is usually divided into small manageable units: Page Segment. Combined Paging-Segmentation Paging divides the memory into equal sized pages Segmentation divides the memory into variable- sized segments. It is relatively easier to implement the address translation table if the logical and main memory spaces are divided into pages.

17 3.3.1 Memory Management Concepts
The Paging method The virtual memory system is managed by both hardware and software. The hardware included in MMU and memory management software in operating system to perform all functions including page replacement policies to provide efficient memory utilization.

18 The Paging method

19 3.3.1 Memory Management Concepts
The Segmentation method An MMU utilizes the Segment Selector to obtain a descriptor from a table in memory containing several descriptors. Global Descriptor Table (GDT): Contains The physical base address for a segment, The segment’s privilege level, Some control bits. Each program has: Local Descriptor Table (LDT) That holds descriptor for each segment used by the program

20 Each segment descriptor indexes into the program's local descriptor table (LDT). Each table entry is mapped to a linear address:

21 3.3.1 Memory Management Concepts
The Segmentation method When the MMU obtains a logical address from the microprocessor MMU determines whether the segment is already in physical memory. If it is, the MMU adds an offset component to the segment base component of the address obtained from the segment descriptor table to provide the physical address. MMU then generates the physical address on the address bus for selecting the memory.

22 3.3.1 Memory Management Concepts
The paged-segmentation method Each segment contains a number of pages. The logical address is divided into three components: segment, page, and word. A page component of n bits can provide up to 2n pages. A segment can be assigned with one or more pages up to maximum of 2n pages; therefore, a segment size depends on the number of pages assigned to it.

23 3.3.1 Memory Management Concepts
The Virtual memory: A technique that uses main memory as a “cache” for secondary storage. virtual address: An address generated by a user program is virtual address The key idea behind the virtual memory is to allow a user program to address more locations than those available in a physical memory. Two major motivations for virtual memory: to allow efficient and safe sharing of memory among multiple programs to remove the programming burdens of a small, limited amount of main memory. CPU and OS translate virtual addresses to physical addresses

24 Mapping Pages to Storage

25 Paging with virtual addressing Programs share main memory, each program gets a private virtual address space holding its frequently used code and data and this is protected from other programs.


Download ppt "MICROPROCESSOR MEMORY ORGANIZATION"

Similar presentations


Ads by Google