SlideShare a Scribd company logo
Lecture 9
Memory Accessible addresses
and their Examples
Iqra university
Revision,
8086 has a 20-bit address bus & thus can address
a maximum of 1MB (2^20) of memory
But 8086 has 16-bit registers which can hold only
16-bit addresses
Solution is to divide 1MB memory in 64KB
segments
(2^16)(total sixteen) as they can be accessed by
using 16-bit
addresses. However, only 4 segments are
accessible by
8086 at a time. These 4 segments are:
Code segment: Used for storing the
codes or instructions
Stack segment: Used as a stack
•
•
•
•
Data segment: Used for storing data
Extra segment: Used for storing in-excess data 2^20=1MB=1048576
2^16=65536= 64KB
1048576/65536=16
Memory Accessible
addresses
• Accessing to memory location there are four addresses that you all
have to understand
• Logical address
• Segment address
• Offset
• Physical address /Effective address
Memory Accessing Addresses
Logical Address
• Logical address is implemented practically by compiler through
different emulators or
• Logical Address is generated by CPU while a program is running.
• The logical address is virtual address as it does not exist physically,
therefore, it is also known as Virtual Address.
• Logical address = Segment Address : Offset
Contd.
Last byte 2FFFFH
Logical Address= 2222:0016
Segment address (Base Address of segment)
• segment address is a 4-digit hexadecimal address which points to the
start of a 64 kB chunk (a single segment )of data.
• Segment address relates to base address of a single memory
segments
• As memory is of 1MB= 2^20 bytes so segment address is of 20 bits as
00000 to FFFFFH
• Where, segment register are bit DS, CS, SS, ES
• Segment register hold only upper 16 bits that is 0000H to FFFFH
1
Code Segment
3
4
Data Segment
Extra Segment
7
8
9
10
11
12
13
14
15
Stack Segment
Memory
00000H
FFFFFH
1MB
Address
Range
StartingAddresses
ofSegments
1000 0H
4000 0H
0H5000
F000 0H
CSR
DSR
ESR
SSR
We can take any value
of starting address of a
segments but it must be
divisible by 16 and
lowest 4 bits (lowest
hex digit) must be 0
Segment registers
(CSR, DSR, SSR &
ESR) hold upper
16-bits
starting
of 20-bits
address
of segments
SEGMENT REGISTERS
Contd.
Last byte 2FFFFH
Segment Address
Logical Address= 2222:0016
Offset
• The offset is also a 4-digit hexadecimal address which defines the
displacement from the segment base pointer
• Offset address indicates displacement address that is address
required to move in 64KB memory segment.
• Offset is of 16 bits 0000H to FFFFH
Contd.
Last byte 2FFFFH
Segment Address
Logical Address= 2222:0016
All offsets are limited to 16-bits.
It means that the maximum size
possible for segment is 2^16= 65,535
bytes (64 KB).
The offset of the first location within the
segment is 0000 H.
The offset of the last location in
segment is FFFF H
Limitation of offset
address
Physical Address
• Physical Address identifies a physical location of required data in a
memory. The user never directly deals with the physical address but
can access by its corresponding logical address.
• Physical Address is calculated by adding segment address (appended
by 0H ) to the offset.
Physical Address (20 Bits)
Adder
Segment Register (16 bits) 0 0 0 0
Offset Value (16 bits)
Physical Address Generation in 8086
Actual address for memory
Upper 16bit of starting address of a segment
20-bits
16-bits
Points to a memory
location within a segment
Contd.
Last byte 2FFFFH
Segment Address
Logical Address= 2222:0016
Physical address
Question: How is a 20-bit address obtained if there are only
16- bit registers????????
The answer lies in the next few slides.
The 20-bit address of a byte is called its Physical
Address.
But, it is specified as a Logical Address.
Logical address is in the form of:
Segment address(Base Address) : Offset
Offset is the displacement of the memory location from
the starting location of the segment.
Important points to remember:
Address of a segment is of 20-bits,
however, within a segment a memory location can be
specified or accessed using a 16-bit address called offset
• Physical address is generated for accessing memory
locations. Where Physical address will be calculated by
adding segment address to offset.
If the data at any location has a logical
address specified as:
2222 H : 0016 H
Ques :What will be its
physical address????
Example
Contd. Logical Address 2222 H : 0016 H
• The number 0016 H is the offset.
• 2222 H is the value of DS.
To convert this 16-bit address into 20-bit, the BIU
(Bus interface unit )appends 0H to the LSBs of the
address.
After appending, the starting address of the Data
Segment becomes 22220H.
Then, it adds offset to it 22220+0016.
Solution:
Therefore Physical Address:
= 22220 H
+ 0016 H
22236 H
Contd.
Lecture 9 examples (1)
Where to look offset for
respective segment
Default Registers Assigned to store offset values for different
segments
Offset is derived from the combination of
pointer registers, index registers the
Instruction Pointer, and immediate values
(called displacement)
0000
+
Segment address
Offset
Memory address
Examples
CS
IP+
Instruction
(code)
address
5 0 0 0 0
F F E 0
5 F F E 0
SS
SP
+
Stac
k
add
r
ess
3 4 8 A 0
4 2 1 4
3 8 A B 4
1 2 3 4 0
0 0 2 2
1 2 3 6 2
DS
DI +
Data
addr
ess
Physical Address Calculation
1
Data
Segment
3
4
Code
Segment
Extra
Segment
7
8
9
10
11
12
13
14
15
Stack
Segment
Memory
00000H
FFFFFH
1MB
Address
Range
348A0H
+ 4214 H
38AB4 H
CS
IP
Physical Address
Start of Code Segment
(348A0H)
Code Byte at38AB4H
IP = 4214H
Example of Physical Address Generation for Code Segment
Memory
Segment Register
Offset
Physical Address
+ 0050
DS:
SI
05C0
0050
05C00H
05C50H
05C0 0
05C50H
Data is fetched with respect to the DS register which contains starting
or base address
The offset is in SI (default register for DS)
DS:EA
0H
0FFFFFH
Example of Physical Address Generation for Data Segment
Conclusions
• A 16-bit address bus addresses up to 64KB of memory from 0000h to FFFFh
• a 20-bit address bus addresses a total of 1 MB from 00000h to FFFFFh.
• The 80386/80486/Pentium processors have a 32-bit address bus and can address
from 00000000h to FFFFFFFFh.
• The 20-bit physical address is generated by:
• Adding 16-bit contents of a segment register with an 16-bit offset value
• Offset is stored in a corresponding default register (either in IP, BX, SI, DI, BP or SP. Different
segments have different default register for offset,
• BIU always appends 4 zeros automatically to the 16-bit address of a segment register (to make it
20-bit) because it knows the starting address of a segment always ends with 4 zeros
The contents of the following registers are:
CS = 111 H
DS = 3333 H
SS = 2526 H
IP = 1232 H
SP = 1100 H
DI = 0020 H
Calculate the corresponding physical addresses for
the address bytes in CS, DS and SS.
Examples to be solved on VLE
• Thank you for listening
• Queries will be answered on
VLE

More Related Content

PPTX
Memory Segmentation of 8086
PPTX
8086 Microprocessor
PPT
8086-instruction-set-ppt
PPT
80486 microprocessor
PPTX
Addressing modes of 8086
PPTX
Microprocessor 8086
PDF
Microprocessor 8086-lab-mannual
PPTX
Internal architecture-of-8086
Memory Segmentation of 8086
8086 Microprocessor
8086-instruction-set-ppt
80486 microprocessor
Addressing modes of 8086
Microprocessor 8086
Microprocessor 8086-lab-mannual
Internal architecture-of-8086

What's hot (20)

PPTX
Floating point representation
PPTX
Stacks & subroutines 1
DOCX
Flag register 8086 assignment
PPSX
Evolution Of Microprocessors
PDF
8086 Microprocessor
PPT
8086 micro processor
PPTX
Logical Instructions used in 8086 microprocessor
PPTX
Arm cortex-m4 programmer model
PPTX
PPTX
Evolution of microprocessors and 80486 Microprocessor.
PPTX
Presentation on 8086 Microprocessor
PDF
8086 microprocessor lab manual
PPT
PPTX
program status word
DOCX
Instruction set of 8086
PPTX
Stack Memory Organization of 8086 Microprocessor
PPTX
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
PPTX
Intel I3,I5,I7 Processor
PPT
Logic Micro Operation
Floating point representation
Stacks & subroutines 1
Flag register 8086 assignment
Evolution Of Microprocessors
8086 Microprocessor
8086 micro processor
Logical Instructions used in 8086 microprocessor
Arm cortex-m4 programmer model
Evolution of microprocessors and 80486 Microprocessor.
Presentation on 8086 Microprocessor
8086 microprocessor lab manual
program status word
Instruction set of 8086
Stack Memory Organization of 8086 Microprocessor
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
Intel I3,I5,I7 Processor
Logic Micro Operation
Ad

Similar to Lecture 9 examples (1) (20)

PDF
Memory and 20 bit physical address calculation.pdf
PPTX
Chapter 1 archietecture of 8086
PPTX
Lecture-3 (8086 Memory Address Space Partition).pptx
PPT
SAURABH MITRA-8086 MICROPROCESSOR
PDF
Memory segmentation-of-8086
PDF
8086 microprocessor and interfacing ppt about all thing pdf
PPTX
Memory sementation sem
PDF
Microprocessor.pdf
PPTX
Introduction of 8086 micro processor .
PPTX
Presentation on 8086 microprocessor
PDF
8086 Architecture, Pin diagram, Addressing modes (3).pdf
PPTX
UNIT-I MICROPROCESSOR PROGRAMMING AND STACK.pptx
PPTX
8086 microprocessor pptx JNTUH ece 3rd year
PPT
Unit 1
PDF
8086 instruction set (with simulator)
PPT
1326 Introduction To 8086 Microprocessor
PPTX
4-ADDRESSING_MODES_E logic circuits.pptx
PPT
PDF
physical_address segmentation.pdf
PPT
8086 ppt.ppt full understanding of micro
Memory and 20 bit physical address calculation.pdf
Chapter 1 archietecture of 8086
Lecture-3 (8086 Memory Address Space Partition).pptx
SAURABH MITRA-8086 MICROPROCESSOR
Memory segmentation-of-8086
8086 microprocessor and interfacing ppt about all thing pdf
Memory sementation sem
Microprocessor.pdf
Introduction of 8086 micro processor .
Presentation on 8086 microprocessor
8086 Architecture, Pin diagram, Addressing modes (3).pdf
UNIT-I MICROPROCESSOR PROGRAMMING AND STACK.pptx
8086 microprocessor pptx JNTUH ece 3rd year
Unit 1
8086 instruction set (with simulator)
1326 Introduction To 8086 Microprocessor
4-ADDRESSING_MODES_E logic circuits.pptx
physical_address segmentation.pdf
8086 ppt.ppt full understanding of micro
Ad

More from talhashahid40 (8)

DOCX
Talha 11009 call_quiz_addressing_modes
PPTX
Only floating point lecture 7 (1)
PPTX
Lecture 11
PPTX
Lecture 10
PPTX
Lect 8 updated (1)
PPTX
Coal (1)
PPT
Chapter 7
PPTX
Chapter 3 caal (1)
Talha 11009 call_quiz_addressing_modes
Only floating point lecture 7 (1)
Lecture 11
Lecture 10
Lect 8 updated (1)
Coal (1)
Chapter 7
Chapter 3 caal (1)

Recently uploaded (20)

PPTX
INTRODUCTION TO EVS | Concept of sustainability
PPTX
TOTAL hIP ARTHROPLASTY Presentation.pptx
PPTX
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
PPTX
Classification Systems_TAXONOMY_SCIENCE8.pptx
PPTX
ECG_Course_Presentation د.محمد صقران ppt
PPTX
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
PDF
Placing the Near-Earth Object Impact Probability in Context
PDF
Unveiling a 36 billion solar mass black hole at the centre of the Cosmic Hors...
PPTX
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
DOCX
Viruses (History, structure and composition, classification, Bacteriophage Re...
PPTX
GEN. BIO 1 - CELL TYPES & CELL MODIFICATIONS
PPTX
BIOMOLECULES PPT........................
PPTX
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
PPTX
2. Earth - The Living Planet Module 2ELS
PDF
bbec55_b34400a7914c42429908233dbd381773.pdf
PDF
AlphaEarth Foundations and the Satellite Embedding dataset
PDF
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
PPTX
Derivatives of integument scales, beaks, horns,.pptx
PPTX
microscope-Lecturecjchchchchcuvuvhc.pptx
INTRODUCTION TO EVS | Concept of sustainability
TOTAL hIP ARTHROPLASTY Presentation.pptx
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
Classification Systems_TAXONOMY_SCIENCE8.pptx
ECG_Course_Presentation د.محمد صقران ppt
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
7. General Toxicologyfor clinical phrmacy.pptx
Placing the Near-Earth Object Impact Probability in Context
Unveiling a 36 billion solar mass black hole at the centre of the Cosmic Hors...
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
Viruses (History, structure and composition, classification, Bacteriophage Re...
GEN. BIO 1 - CELL TYPES & CELL MODIFICATIONS
BIOMOLECULES PPT........................
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
2. Earth - The Living Planet Module 2ELS
bbec55_b34400a7914c42429908233dbd381773.pdf
AlphaEarth Foundations and the Satellite Embedding dataset
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
Derivatives of integument scales, beaks, horns,.pptx
microscope-Lecturecjchchchchcuvuvhc.pptx

Lecture 9 examples (1)

  • 1. Lecture 9 Memory Accessible addresses and their Examples Iqra university
  • 2. Revision, 8086 has a 20-bit address bus & thus can address a maximum of 1MB (2^20) of memory But 8086 has 16-bit registers which can hold only 16-bit addresses Solution is to divide 1MB memory in 64KB segments (2^16)(total sixteen) as they can be accessed by using 16-bit addresses. However, only 4 segments are accessible by 8086 at a time. These 4 segments are: Code segment: Used for storing the codes or instructions Stack segment: Used as a stack • • • • Data segment: Used for storing data Extra segment: Used for storing in-excess data 2^20=1MB=1048576 2^16=65536= 64KB 1048576/65536=16
  • 4. • Accessing to memory location there are four addresses that you all have to understand • Logical address • Segment address • Offset • Physical address /Effective address Memory Accessing Addresses
  • 5. Logical Address • Logical address is implemented practically by compiler through different emulators or • Logical Address is generated by CPU while a program is running. • The logical address is virtual address as it does not exist physically, therefore, it is also known as Virtual Address. • Logical address = Segment Address : Offset
  • 6. Contd. Last byte 2FFFFH Logical Address= 2222:0016
  • 7. Segment address (Base Address of segment) • segment address is a 4-digit hexadecimal address which points to the start of a 64 kB chunk (a single segment )of data. • Segment address relates to base address of a single memory segments • As memory is of 1MB= 2^20 bytes so segment address is of 20 bits as 00000 to FFFFFH • Where, segment register are bit DS, CS, SS, ES • Segment register hold only upper 16 bits that is 0000H to FFFFH
  • 8. 1 Code Segment 3 4 Data Segment Extra Segment 7 8 9 10 11 12 13 14 15 Stack Segment Memory 00000H FFFFFH 1MB Address Range StartingAddresses ofSegments 1000 0H 4000 0H 0H5000 F000 0H CSR DSR ESR SSR We can take any value of starting address of a segments but it must be divisible by 16 and lowest 4 bits (lowest hex digit) must be 0 Segment registers (CSR, DSR, SSR & ESR) hold upper 16-bits starting of 20-bits address of segments SEGMENT REGISTERS
  • 9. Contd. Last byte 2FFFFH Segment Address Logical Address= 2222:0016
  • 10. Offset • The offset is also a 4-digit hexadecimal address which defines the displacement from the segment base pointer • Offset address indicates displacement address that is address required to move in 64KB memory segment. • Offset is of 16 bits 0000H to FFFFH
  • 11. Contd. Last byte 2FFFFH Segment Address Logical Address= 2222:0016
  • 12. All offsets are limited to 16-bits. It means that the maximum size possible for segment is 2^16= 65,535 bytes (64 KB). The offset of the first location within the segment is 0000 H. The offset of the last location in segment is FFFF H Limitation of offset address
  • 13. Physical Address • Physical Address identifies a physical location of required data in a memory. The user never directly deals with the physical address but can access by its corresponding logical address. • Physical Address is calculated by adding segment address (appended by 0H ) to the offset.
  • 14. Physical Address (20 Bits) Adder Segment Register (16 bits) 0 0 0 0 Offset Value (16 bits) Physical Address Generation in 8086 Actual address for memory Upper 16bit of starting address of a segment 20-bits 16-bits Points to a memory location within a segment
  • 15. Contd. Last byte 2FFFFH Segment Address Logical Address= 2222:0016 Physical address
  • 16. Question: How is a 20-bit address obtained if there are only 16- bit registers???????? The answer lies in the next few slides. The 20-bit address of a byte is called its Physical Address. But, it is specified as a Logical Address. Logical address is in the form of: Segment address(Base Address) : Offset Offset is the displacement of the memory location from the starting location of the segment.
  • 17. Important points to remember: Address of a segment is of 20-bits, however, within a segment a memory location can be specified or accessed using a 16-bit address called offset • Physical address is generated for accessing memory locations. Where Physical address will be calculated by adding segment address to offset.
  • 18. If the data at any location has a logical address specified as: 2222 H : 0016 H Ques :What will be its physical address???? Example
  • 19. Contd. Logical Address 2222 H : 0016 H
  • 20. • The number 0016 H is the offset. • 2222 H is the value of DS. To convert this 16-bit address into 20-bit, the BIU (Bus interface unit )appends 0H to the LSBs of the address. After appending, the starting address of the Data Segment becomes 22220H. Then, it adds offset to it 22220+0016. Solution:
  • 21. Therefore Physical Address: = 22220 H + 0016 H 22236 H Contd.
  • 23. Where to look offset for respective segment Default Registers Assigned to store offset values for different segments
  • 24. Offset is derived from the combination of pointer registers, index registers the Instruction Pointer, and immediate values (called displacement) 0000 + Segment address Offset Memory address Examples CS IP+ Instruction (code) address 5 0 0 0 0 F F E 0 5 F F E 0 SS SP + Stac k add r ess 3 4 8 A 0 4 2 1 4 3 8 A B 4 1 2 3 4 0 0 0 2 2 1 2 3 6 2 DS DI + Data addr ess Physical Address Calculation
  • 25. 1 Data Segment 3 4 Code Segment Extra Segment 7 8 9 10 11 12 13 14 15 Stack Segment Memory 00000H FFFFFH 1MB Address Range 348A0H + 4214 H 38AB4 H CS IP Physical Address Start of Code Segment (348A0H) Code Byte at38AB4H IP = 4214H Example of Physical Address Generation for Code Segment
  • 26. Memory Segment Register Offset Physical Address + 0050 DS: SI 05C0 0050 05C00H 05C50H 05C0 0 05C50H Data is fetched with respect to the DS register which contains starting or base address The offset is in SI (default register for DS) DS:EA 0H 0FFFFFH Example of Physical Address Generation for Data Segment
  • 27. Conclusions • A 16-bit address bus addresses up to 64KB of memory from 0000h to FFFFh • a 20-bit address bus addresses a total of 1 MB from 00000h to FFFFFh. • The 80386/80486/Pentium processors have a 32-bit address bus and can address from 00000000h to FFFFFFFFh. • The 20-bit physical address is generated by: • Adding 16-bit contents of a segment register with an 16-bit offset value • Offset is stored in a corresponding default register (either in IP, BX, SI, DI, BP or SP. Different segments have different default register for offset, • BIU always appends 4 zeros automatically to the 16-bit address of a segment register (to make it 20-bit) because it knows the starting address of a segment always ends with 4 zeros
  • 28. The contents of the following registers are: CS = 111 H DS = 3333 H SS = 2526 H IP = 1232 H SP = 1100 H DI = 0020 H Calculate the corresponding physical addresses for the address bytes in CS, DS and SS. Examples to be solved on VLE
  • 29. • Thank you for listening • Queries will be answered on VLE