Lecture 6
Lecture 6
Lecture 6
Basic interfacing concepts, and Memory interfacing
Basic Interfacing
Memory is made up of (registers). Each register consists of one storage location.
Each location consists of an address. The number of storage locations from few
hundreds to several mega or giga locations. The total number of memory storage is
called memory capacity and measured in Bytes. Each register consists of storage
element (FF, capacitor for semiconductor). A storage element is called cell. The data
could be read from or written to memory.
Read/write memories consist of an array of registers, in which each register has
unique address. The size of the memory is N x M as shown below where N is the
number of registers and M is the word length, in number of bits.
Page 1
Microprocessor System
Example:
If memory has 8192 memory locations, then it has 13 address lines. Table below
shows how the number of address lines are decided depending on the size of
memory.
Address lines
Draw the circuit diagram of an 8085 system, having a 4 KB EPROM and two 8 KB
RAM ICs. The starting address of the EPROM is 0000H and that of RAM is 8000H.
The address of the decoder circuits should be clearly shown.
Answer:
EPROM-4 KB (Address lines required is 12 A0 to A11)
RAM-I-8 KB (Address lines required is 13 A0 to A12)
RAM-II-8 KB (Address lines required is 13 A0 to A12)
Red Sea University Engineering Faculty
Page 2
Microprocessor System
Mapping of Addresses to Memory Ics
Address mapping
Address decoding
Red Sea University Engineering Faculty
Page 3
Microprocessor System
Memory interfacing
Microprocessor need to access memory quite frequently to read instructions and data
stored in memory; the interface circuit enables that access.
The interface process involves designing a circuit that will match the memory
requirements with the microprocessor signal. Memory has certain signal
requirements to read from and write into memory. Similarly Microprocessor initiates
the set of signals when it wants to read from and write into memory.
Page 4
Microprocessor System
Accessing memory can be summarized into the following three steps:
Select the chip.
Identify the memory register.
Enable the appropriate buffer.
And to translating this to microprocessor domain following steps are
required
The microprocessor places a 16-bit address on the address bus. Part of the
address bus will select the chip and the other part will go through the address
decoder to select the register.
The signals IO/M and RD combined indicate that a memory read operation is
in progress. The MEMR signal can be used to enable the RD line on the
memory chip.
Page 5
Microprocessor System
A memory chip select decoder is used to provide chip select signal for each memory
device (IC). This will decide the address range that is allotted for each memory IC.
74LS138 is a 3 to 8 decoder and it can be used for this purpose. In this example the
minimum memory block size is 4K. To access 1K locations 10 address lines must
be used (210 =1K = 1024 locations). So to access 4K locations (4 X 1K = 22 X 210 =
212) 12address lines (A0 A11) must be used. Since 8085 has 16 address lines the
decoding can be indicated as shown below.
Memory interfacing
Red Sea University Engineering Faculty
Page 6
Microprocessor System
Example:
Interface two 4K X 8 EPROMs and two 4K X 8 RAM chips with 8086. Select
suitable maps.
Solution
First we have to write the memory map from the problem given. It will reveal the
logic to be used for decoding circuit.
Since the first instruction is fetched from FFFF0h after the microprocessor is reset,
we will make that address to be present in EPROM and write the memory map as
follows. And, to avoid windowing let us keep the locations to be present in the RAM
as immediate addresses. Locations having addresses from FFFFFH to FE000H are
allocated to EPROM1 and 2.
Immediate address map FDFFFH to FD000H is allocated to RAM1 and 2. The line
which is differentiating EPROM from RAM if A13. Let us use it along with A0 and
BHE to identify odd and even banks.
Memory map
Since there is continuous address map, we can use a decoder to decode the chip
select signals. The inputs for the decoder would be a13, A0 and BHE.
Page 7
Microprocessor System
System Interface
Example:
Interface two chips of 16K X 8 EPROMs and two chips of 32 X 8 RAM chips to
8086 microprocessor. Select the starting address of EPROM suitably, but the RAM
address must start at 00000H.
Solution
First let us write the memory map. If you observe the memory map, it shows that the
address map is not contiguous. Hence we will use logic gates instead of decoder to
design decoding logic.
Memory map
Page 8
Microprocessor System
System interface
Example
It is required to interface two chips of 32K X 8 ROM and four chips of 32K X 8
RAM with 8086 according to following map.
ROM1 and 2: F0000H FFFFFH
RAM1 and 2: D0000H DFFFFH
RAM3 and 4: E0000H EFFFFH
Solution
Memory map
Page 9
Microprocessor System
System Interface
Page 10