Professional Documents
Culture Documents
Microprocessor Systems and Interfacing (Eee342)
Microprocessor Systems and Interfacing (Eee342)
INTERFACING (EEE342)
RECAP
Scope of the Course
Evolution of Microprocessor
2
REPRESENTING DATA IN A COMPUTER
5
EXAMPLE
Given the following memory contents
6
SOLUTION
Word at 0x200D = 0x2C96 Lo Hi
Address is not divisible by 2 unaligned 0x200C 40 96 2C 00
Double word at 0x2012 = 0x2301ABCD 0x2010 55 12 CD AB
Address is not divisible by 4 unaligned 0x2014 01 23 88 99
Remember, hexadecimal is base 16—0x12 = 1810
0x16A794
(16A794)16
16A794h
7
MEMORY ORGANIZATION AND ADDRESSING
A Computer memory is considered as a matrix of bits: A linear array of
addressable storage cells that are similar to registers
Each row has a length typically equivalent to the word size of the machine
8
MEMORY ORGANIZATION AND ADDRESSING
A Computer memory is considered as a matrix of bits: A linear array of
addressable storage cells that are similar to registers
Each row has a length typically equivalent to the word size of the machine
9
WORD ADDRESSABLE AND BYTE ADDRESSABLE
Two types of memories are available:
Byte addressable: Each byte has its own address (each memory row contain 8 bits only)
Word addressable: Each word has a unique address (each memory row contains one word that can
be larger than 8 bits)
able ble
Word size is processor-dependent
a
e ss 0 16 bits on x86e ss 32 bits on MIPS
dr dr
Ad :
Ad 0
d yt e
or i B :
W j j+1 j+2 j+3
j i
i+1
4096 word j+4 i+1 j+4 j+5 j+6 j+7
i+2
4096 word j+8 i+2 j+8 j+9 j+10 j+11
1MB
on such systems :
Real :
0000 0000 0000 0000 0000
Mode :
Emulator O S :
heD 0 0 0 0 0 H
t
n 13
Ru
REAL MODE
Irrespective of the Processor, if it resets/power-on, it begins the operation
in Real mode, which is to load the Operating system
No memory protection
No multi-tasking
1MB
No processor privileged levels
14
PROTECTED MODE
Protected mode is the normal operating mode for a 32 bit systems.
An older 32 bit system can access up to 232 amount of memory or 4
Gbytes
• New processors got extension or the physical
address extensions (PAE) that allows up to 64 GB
of RAM, But only 4 GB at a time
GB
• Protected mode allows
464MB
• Multi-tasking
• Memory protection
• Processor privileged levels
15
8086/8088 MICROPROCESSOR
16
DATA ORGANIZATION
17
DATA ORGANIZATION
A double word corresponds to four consecutive bytes of data stored in
memory.
18
DATA ORGANIZATION
What is the data word shown in figure (b)? Express the result in
hexadecimal form. Is it stored at an even – or odd – addressed word
boundary? Is it an aligned or misaligned word of data?
Solution:
111111012 = FD16 = FDH
101010102 = AA16 = AAH
Together the two bytes give the word
1111 1101 1010 10102 = FDAA2 = FDAAH
Example:
Segment base address = 3B4C16 = 0011 1011 0100 11002 20
DATA ORGANIZATION
How should the pointer with segment base address equal to A00016 and
offset address 55FF16 be stored at an even-address boundary starting at
0000816? Is the double word aligned or misaligned?
Solution:
Storage of the two-word pointer requires four consecutive byte
locations in memory, starting at address 0000816
The least-significant byte of the offset is stored at address 0000816
and is shown as FF16 in the figure.
The most significant byte of the offset, 5516, is stored at address
0000916
These two bytes are followed by the least significant byte of the
segment base address, 0016, at address 0000A16
Its most significant byte, A016, at address 0000B16
Since the double word is stored in memory starting at address 21
DATA TYPES
22
DATA TYPES
23
DATA TYPES
Example:
A signed word integer equals FEFF16. What decimal number does it represent?
Solution:
FEFF16 = 11111110111111112
The most significant bit is 1, the number is negative and is in 2’s complement
form
Converting to its binary equivalent by subtracting 1 from the least significant bit
Then complement all bits given:
FEFF16 = -00000001000000012 = -257
24