Upload
jeffery-lyons
View
216
Download
2
Embed Size (px)
Citation preview
1/2002 JNM 1
With 20 bits, 1,048,576 different combinations are available. Each memory location is assigned a different combination. Each memory location is 1-byte wide. Therefore, the memory space of the 8086 consists of 1,048,576 bytes or 524,288 16-bit words.
The 8086 has a 20-bit Address Bus
1/2002 JNM 2
Problem
• The 8086 has a 20-bit address bus. Therefore, it can access 1,048,576 bytes of memory. How many bits and how many HEX digits are required to access 1M memory?
• 2N = 1M (where N is in bits)
• N = 20 bits = 20/4 = 5 HEX digits
1/2002 JNM 3
Positional Notation (Hex Digits)
1/2002 JNM 4
Problem Continued
• But each register is only 16 bits (4 HEX digits) wide. How are all of the locations accessed?
• Segmented Memory – all of memory is divided into 64-kByte segments. (4 HEX digits (16 bits) can access 64k different locations)– 216 64k
1/2002 JNM 5
Within the 1 MB of memory, the 8086 defines 4 64KB memory blocks.
Segmented Memory
7FFFF
The segment registers point to location 0 of each segment. (The base address)
DS: E000 CS: B300
SS: 7000 ES: 5D27
1/2002 JNM 6
Segment Register Defaults
1/2002 JNM 7
Segments/ Segmentation
• Segments are variable-sized areas of memory used by a program containing either code or data.
• Segmentation provides a way to isolate memory segments from each other. This permits multiple programs to run simultaneously without interfering with each other.
• A segment selector is a 16-bit value stored in a segment register.
• A logical address is a combination of a segment selector and an offset(16-bit for 8086).
1/2002 JNM 8
Logical Addresses
• Later in the course, we will get into translation of logical addresses to linear addresses (using descriptor tables and paging).
• For now, using a virtual-8086 mode, we can determine the “physical address” by adding the offset to the base. Remember with 8086 mode, there is only 1MB of memory.
1/2002 JNM 9
Determining the Physical Address from a Logical Address
• Shift the segment value left 4 bits (add a zero to the right), then add the offset
• 3D7F:023C 3DA2Ch
1/2002 JNM 10
Real-Mode Addessing
• In real mode addressing, the lowest 640K of memory is used by both the operating system and application programs.
• Video memory and hardware controllers have reserved memory locations.
• C0000h-FFFFFh are reserved for system ROM.• IVT (Interrupt Vector Table) is at first 1024 bytes
of memory (00000-03FFFh)
1/2002 JNM 11
Memory Map for an 80x86 computer running MS-DOS
1/2002 JNM 12
Memory Banks
• Even though the 8086 has a 16-bit data bus, it is byte addressable.
• Memory is divided into two 8-bit banks
BE0 BE1
Even Addresses Odd Addresses
1/2002 JNM 13
Memory Chip Organization
• Remember that memory chips are usually defined as a k x n device (k=#locations, n=number of cells per location)– Examples
• 16 x 1 (16M bits)
• 4M x 4 (4M nibbles)
• 2M x 8 ( 2M bytes)
• 1M x 16 (16 M words)
• SRAM and ROM are typically arranged x8 (byte wide)