Slide-2 (8086 Basics and Memory Banking)
Slide-2 (8086 Basics and Memory Banking)
Interfacing
EEE 315
Fahim Mahmud
Assistant Professor
Dept. of EEE
CUET
Class outline
2^10 = 1024 = 1K
2^20 = 1M
2^30 = 1G
2^40 = 1T
2^24 = 2^4*2^20 = 16*1M = 16M
2^35 = 2^5*2^30 = 32*1G = 32G
8 bit number: 00H (smallest), FFH(highest)
16 bit number: 0000H (smallest), FFFFH (highest)
Remembering the above will make your life easier in this subject.
Basic organization of computer
What does μP do?
It fetches instructions.
It decodes instructions.
It executes instructions.
System bus
Size of address bus determines the memory size that a μP can access.
1 bit address bus can uniquely identify 2 locations, 2 bit address bus can
uniquely identify 4 locations, n-bit address bus can uniquely identify 2^n
locations.
Each memory location carries 1 byte (8 bits).
So, n-bit address bus = 2^n byte memory.
8086 μP has 20 bit address bus. Hence, it can access 2^20 = 1MB memory.
80386 has 32 bit address bus. So, it has 2^32 = 4GB memory.
Larger memory, however, doesn’t mean higher speed.
Address bus is unidirectional, meaning only μP gives address.
Data bus
As the name suggests, data bus transfers data from and to the μP.
Hence, it’s a bidirectional bus.
Size of data bus determines the speed of μP.
8086 has 16 bit data bus. It means that it can read or write 16 bits (2 bytes)
in one instruction cycle.
Control bus
There are many types of control signals, two most important ones are read
and write signals.
RD’ and WR’ => bar/prime means they are active low signals.
M/IO’ => it tells whether it’s a memory based operation or a I/O based
operation.
Memory banking
Important: Lower bytes are stored in lower address, higher bytes are stored
in higher address.
1 memory location = 1 byte (8 bits)
8086 has 16 bit data bus, so it can carry 16 bits at a time.
But it can select/give only a single address and a single address/location
carries 1 byte. So, half of its data bus is being unused.
Solution?
Make each memory location bigger? Then for smaller instructions (smaller
bytes), remaining portion of a location will be wasted.
That’s where the concept of memory banking comes into play.
Memory banking
A A A A A A A A A A A A A A A A A A A A
19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
BHE A0 Operation
0 0 R/W 16-bit
0 1 R/W 8-bit from HB
1 0 R/W 8-bit from LB
1 1 Idle