Professional Documents
Culture Documents
CSC 321 M&AL Lec4
CSC 321 M&AL Lec4
Microprocessor and
Assembly Language
Lecture-4
Muhammad Naveed Shaikh
Department of Electrical and Computer Engineering
COMSATS University Islamabad, Abbottabad Campus
naveedshaikh@cuiatd.edu.pk
CSC321-Microprocessors & Assembly Language
Memory Organization
• A bank of 1M byte locations, each having its own unique address
(0000016-FFFFF16).
• 220 = 1 MB = 1 Mega Bytes (for 8086 microprocessors)
• Memory lies outside the processor (External Memory )
• However, it is accessible to processor.
• Memory is used to store both
• Program (Code)
• Data
Memory Organization
• 8086 microprocessor can access 16 bits at once (per clock cycle)
• Data Bus is 16-bit wide
Memory
• However, each location can hold only 8-bits
Address(( Contents
• Thus, two locations are accessed simultaneously HEX) (HEX)
MPU
// //
072EE 1 BYTE
Memory Organization
• 8086 microprocessor can access 16 bits at once (per clock cycle)
• Data Bus is 16-bit wide
• However, each location can hold only 8-bits of information
• Thus, two locations are accessed simultaneously
• Two bytes information means 1 Word ( 2 Bytes)
• Little Endian
• Low address byte is least significant byte
• Higher address byte is most significant byte
Note: Recall the difference between Little Endian and Big Endian
Muhammad Naveed Shaikh 4
Department of Electrical and Computer Engineering, CUI, Abbottabad Campus
CSC321-Microprocessors & Assembly Language
Memory Organization
Practice Example (LITTLE ENDIAN)
Memory
• Address location 07207H, 07208H
• Lower address is 07207H
Address (HEX) Content (Hex)
• Higher address is 07208H
• Least Significant byte is 4B H
07208 72
• Most Significant byte is 72 H
• 16-bit Word will be 724B H 07207 4B
Memory Organization
• Even address boundary
• Odd Address Boundary
Memory Organization
Even address boundary
• If least significant bit of address is 0
• Word stored at an even-address boundary
• It corresponds to two consecutive bytes
• Least Significant Byte (LSB) is located at an even address
• Data is called Aligned Data
Memory Organization
Odd Address Boundary
• If least significant bit of address is 1
• Word stored at an odd-address boundary
• It corresponds to two consecutive bytes
• Least Significant Byte (LSB) is located at an odd address
• Data is called Miss-Aligned Data
Memory Organization
Practice Problem
• Identify the given words as
• Aligned or Miss Aligned wrods
Memory Organization
Double word
• 4 bytes of data or two words
• Example is pointer which is two word–address element
• to access either data or code in memory
• Double word is another data format
• that can be processed by 8086/ 8088 Microprocessor .
• It corresponds to 4 consecutive bytes stored in memory.
Memory Organization
Practice Problem
• Identify the given double-words as
• Aligned or Miss Aligned double wrods