Professional Documents
Culture Documents
Interfacing
Ch2_lec4_ Memory Interface
Kassahun Tamir 1
Memory Devices
Common types of memory
Kassahun Tamir 2
Memory Devices
Consist of:
Control Input(R/W)
Kassahun Tamir 3
Memory Addressing
The semiconductor memories are organized as two
dimensional arrays of memory locations.
For example, 4K x 8 or 4K byte memory contains 4096
locations, where each location contains 8-bit data and
only one of the 4096 locations can be selected at a
time.
To address a memory location out of N memory
locations, it is required at least n bits address, i. e. n
address lines where n = Log2N.
Kassahun Tamir 4
Memory Addressing
The 8086 is a 16-bit microprocessor; it can transfer 16-
bit data. So in addition to byte, word (16-bit) has to be
stored in the memory.
This is stored by using two consecutive memory
locations, one for least significant byte and the other for
most significant byte.
The address of word is the address of least significant
byte.
To access two memory location, the entire memory is
divided into two memory banks:
bank0 and bank1. Kassahun Tamir 5
Memory Addressing
Kassahun Tamir 6
Address Pin Connection
Select a memory location within the memory device
Common memory devices have between 1K (1024) to
1G (1,073,741,824)
A 1K (2^10) memory needs 10 address pins
Hex representation of 1K is 400
For a starting address of 1000 the end address will be
13FF
Kassahun Tamir 7
Data Pin Connection
Points at which data are entered for storage or
extracted for Reading
Kassahun Tamir 8
Selection Pin Connection
Kassahun Tamir 9
Control Pin Connection
ROM usually have one control input
Output enable RD(OE) or gate (G) (it is a read only memory, so
it has only one pin to enable)
Kassahun Tamir 10
Address Decoding
NAND gate decoder (74LS133)
Kassahun Tamir 11
Address Decoding
One of the most common, although not only, integrated
circuit decoders found in many microprocessor based
system is the 74LS138 3-to-8 line decoder.
Kassahun Tamir 12
RAM or EPROM Block
Kassahun Tamir 13
8086 and 74LS138 Block
Kassahun Tamir 14
Example
Design an 8086 based system with the following
specifications.
64 Kbytes EPROM
64 Kbytes RAM
Kassahun Tamir 15
Example
The 8086 is a 16 bit microprocessor. It can access 16
bit data simultaneously.
For interfacing memory module to 8086 CPU, it is
necessary to have odd and even memory banks.
This can be achieved by using two 32 Kbyte EPROMs
and two 32 Kbyte RAMs, one for odd bank another
for even bank.
As 32 Kbyte RAM and EPROM need 15 address lines,
A1 to A15 lines are used. A0 and BHE are used to
even and odd memory banks respectively.
Kassahun Tamir 16
Example (Address Line Mapping)
Kassahun Tamir 17
Example (Put Together)
Kassahun Tamir 18
Example (74LS138 as a Control
8086 Processor Pins
Signal
74LS138 O/P
Decoder)
Explanation
Signals
M/IO RD WR
0 0 1 I/0 Read
0 1 0 I/O Write
1 0 1 Memory Read
1 1 0 Memory Write
1 1 1 No OperationKassahun Tamir
Both read and write signals aren’t set 19
Example (74LS138 as a Chip
Selection Decoder)
Inputs Output
A19 A18 A17 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
Kassahun Tamir 21