SlideShare a Scribd company logo
1 of 29
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.
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

What's hot

Architecture of 8086
Architecture of 8086Architecture of 8086
Architecture of 8086
Nikhil Kumar
 
03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final
03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final
03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final
Gopi Krishnamurthy
 

What's hot (20)

Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086
 
Amiga Cracktro Programming
Amiga Cracktro ProgrammingAmiga Cracktro Programming
Amiga Cracktro Programming
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
x86 architecture
x86 architecturex86 architecture
x86 architecture
 
PCIe Gen 3.0 Presentation @ 4th FPGA Camp
PCIe Gen 3.0 Presentation @ 4th FPGA CampPCIe Gen 3.0 Presentation @ 4th FPGA Camp
PCIe Gen 3.0 Presentation @ 4th FPGA Camp
 
Microprocessor - Intel Pentium Series
Microprocessor - Intel Pentium SeriesMicroprocessor - Intel Pentium Series
Microprocessor - Intel Pentium Series
 
8086_architecture.ppt
8086_architecture.ppt8086_architecture.ppt
8086_architecture.ppt
 
Pcie basic
Pcie basicPcie basic
Pcie basic
 
SATA Protocol
SATA ProtocolSATA Protocol
SATA Protocol
 
AMBA AHB 5
AMBA AHB 5AMBA AHB 5
AMBA AHB 5
 
AMBA BUS.pptx
AMBA BUS.pptxAMBA BUS.pptx
AMBA BUS.pptx
 
8086 Microprocessor
8086  Microprocessor8086  Microprocessor
8086 Microprocessor
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
 
Architecture of 8086
Architecture of 8086Architecture of 8086
Architecture of 8086
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
M6800
M6800M6800
M6800
 
Ambha axi
Ambha axiAmbha axi
Ambha axi
 
03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final
03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final
03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final
 
Memory segmentation-of-8086
Memory segmentation-of-8086Memory segmentation-of-8086
Memory segmentation-of-8086
 
Register & flags
Register & flagsRegister & flags
Register & flags
 

Similar to Lecture 9 examples (1)

Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptxLecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
VikasMahor3
 
Microprocessor if deptt- 17th september 2021 (2)
Microprocessor if deptt- 17th september 2021 (2)Microprocessor if deptt- 17th september 2021 (2)
Microprocessor if deptt- 17th september 2021 (2)
AISSMS
 
Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor  Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor
Mustapha Fatty
 

Similar to Lecture 9 examples (1) (20)

Chapter 1 archietecture of 8086
Chapter 1 archietecture of 8086Chapter 1 archietecture of 8086
Chapter 1 archietecture of 8086
 
SAURABH MITRA-8086 MICROPROCESSOR
SAURABH MITRA-8086 MICROPROCESSORSAURABH MITRA-8086 MICROPROCESSOR
SAURABH MITRA-8086 MICROPROCESSOR
 
Memory sementation sem
Memory sementation semMemory sementation sem
Memory sementation sem
 
Microprocessor.pdf
Microprocessor.pdfMicroprocessor.pdf
Microprocessor.pdf
 
Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Introduction of 8086 micro processor .
Introduction of 8086 micro processor .
 
Presentation on 8086 microprocessor
Presentation on 8086 microprocessorPresentation on 8086 microprocessor
Presentation on 8086 microprocessor
 
8086 microprocessor pptx JNTUH ece 3rd year
8086 microprocessor pptx JNTUH ece 3rd year8086 microprocessor pptx JNTUH ece 3rd year
8086 microprocessor pptx JNTUH ece 3rd year
 
Unit 1
Unit 1Unit 1
Unit 1
 
8086 instruction set (with simulator)
8086 instruction set (with simulator)8086 instruction set (with simulator)
8086 instruction set (with simulator)
 
1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessor1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessor
 
physical_address segmentation.pdf
physical_address segmentation.pdfphysical_address segmentation.pdf
physical_address segmentation.pdf
 
8086
80868086
8086
 
8086
80868086
8086
 
Lect 8 updated (1)
Lect 8 updated (1)Lect 8 updated (1)
Lect 8 updated (1)
 
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptxLecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
 
Presentation on 8086 Microprocessor
Presentation  on   8086 MicroprocessorPresentation  on   8086 Microprocessor
Presentation on 8086 Microprocessor
 
8086 architecture
8086 architecture8086 architecture
8086 architecture
 
introduction to Architecture of 8086 and it's application
introduction to Architecture of 8086 and it's applicationintroduction to Architecture of 8086 and it's application
introduction to Architecture of 8086 and it's application
 
Microprocessor if deptt- 17th september 2021 (2)
Microprocessor if deptt- 17th september 2021 (2)Microprocessor if deptt- 17th september 2021 (2)
Microprocessor if deptt- 17th september 2021 (2)
 
Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor  Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor
 

More from talhashahid40 (7)

Talha 11009 call_quiz_addressing_modes
Talha 11009 call_quiz_addressing_modesTalha 11009 call_quiz_addressing_modes
Talha 11009 call_quiz_addressing_modes
 
Only floating point lecture 7 (1)
Only floating point lecture 7 (1)Only floating point lecture 7 (1)
Only floating point lecture 7 (1)
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Coal (1)
Coal (1)Coal (1)
Coal (1)
 
Chapter 7
Chapter 7Chapter 7
Chapter 7
 
Chapter 3 caal (1)
Chapter 3 caal (1)Chapter 3 caal (1)
Chapter 3 caal (1)
 

Recently uploaded

Introduction,importance and scope of horticulture.pptx
Introduction,importance and scope of horticulture.pptxIntroduction,importance and scope of horticulture.pptx
Introduction,importance and scope of horticulture.pptx
Bhagirath Gogikar
 
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
PirithiRaju
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
Sérgio Sacani
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Sérgio Sacani
 
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
levieagacer
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
Areesha Ahmad
 

Recently uploaded (20)

Introduction,importance and scope of horticulture.pptx
Introduction,importance and scope of horticulture.pptxIntroduction,importance and scope of horticulture.pptx
Introduction,importance and scope of horticulture.pptx
 
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
 
GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)
 
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts ServiceJustdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 
pumpkin fruit fly, water melon fruit fly, cucumber fruit fly
pumpkin fruit fly, water melon fruit fly, cucumber fruit flypumpkin fruit fly, water melon fruit fly, cucumber fruit fly
pumpkin fruit fly, water melon fruit fly, cucumber fruit fly
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
 
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
 
GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)
 
Unit5-Cloud.pptx for lpu course cse121 o
Unit5-Cloud.pptx for lpu course cse121 oUnit5-Cloud.pptx for lpu course cse121 o
Unit5-Cloud.pptx for lpu course cse121 o
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
 
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptxPSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
 
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
 
STS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATION
STS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATIONSTS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATION
STS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATION
 
module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learning
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdf
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)
 

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.
  • 22.
  • 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