05_CS3004
05_CS3004
[email protected]
8826165224
INTRODUCTION:
Memory is simply a device that can be used to store the information. Memory is an integral part of a
microprocessor system. In designing of computer, semiconductor memories are used as primary storage
of data and code. The fundamentals of memory are memory capacity, memory organization and
memory speed.
Memory Capacity: The number of bits that a semiconductor memory chip can store is called chip
capacity (bits or bytes)
Memory Organization:
o Each memory chip contains 2n locations where n is number of address pins on chip
o Each location contain y bits where y is number of data pins on the chip
o The entire chip will contain 2n* y bits
o For example memory organization of 4K x 4: 212 = 4096 location, each location holding 4
bits. So n=12 and y = 4
Memory Speed: It’s the Access time.
Each Memory device has at least one Chip Select (CS) or Chip Enable (CE) or Select (S) that enable the
memory device. This enables read and/or write operations.
Each memory device has at least one control pin. For ROMs an output enable (OE) or gate (G) is
present. The OE pin enables and disables a set of tri-state buffers. For RAMs a read/write (R/W) or
write enable (WE) or read enable (RE) are present.
MEMORY TYPES:
Every microprocessor-based system has a memory system, they are classified as below.
1
MEMORY DEVICE:
The generic pin configuration of memory devices is depicted below. Each memory device contains
Address pins (A0 to AN), Data pins which are bidirectional in read write memories, Selection pins and
Control pins.
Address pins:
All memory devices have address inputs.
They select a memory location within the memory device.
The number of address pins is related to the number of memory locations.
o Common sizes today are 1K to 256M locations.
o Therefore, between 10 and 28 address pins are present.
Address inputs are labeled from A0 to AN.
N is the total number of address pins minus 1.
Example: The 2K memory:
o It has 11 address lines.
o The labels are (A0 to A10).
o If the start address is 10000H so the end address is:
o 10000H + ((2*1024)10= 800H)=107FFH
Data Pins:
All memory devices have a set of data outputs or input/outputs.
They are used to enter the data for storage or extract the data for reading.
The data pins are typically bi-directional in read-write memories.
o The number of data pins is related to the size of the memory location.
o For example, an 8-bit wide (byte-wide) memory device has 8data pins.
o Catalog listing of 1K X 8 indicate a byte addressable 8Kbit memory with 10 address
pins.
Memory devices are defined by memory locations times bit per location.
Examples: 1Kx8, 16Kx1, 64Kx4.
2
Selection Pins:
Each memory device has at least one chip select(𝐶𝑆 ̅̅̅̅) or chip enable(𝐶𝐸
̅̅̅̅ ) or select(𝑆̅) pin that
enables the memory device.
o This enables read and/or write operations.
o If more than one are present, then all must be 0 in order to perform a read or write.
If they are active (logic 0), the memory device performs a read or write operation.
If they are inactive (logic 1), the memory is disabled and do not do any operation.
If more than one selection connection is present. All must be activated to read or write.
Control Pins:
Each memory device has at least one control pin
For ROMs, an Output Enable (𝑶𝑬 ̅̅̅̅) or Gate (𝑮
̅ ) is present.
The 𝑂𝐸pin enables and disables a set of tri-state buffers.
For RAMs, a read-write(R/𝑾 ̅̅̅) or write enable (𝑾𝑬 ̅̅̅̅) are present.
̅̅̅̅̅) and read enable (𝑶𝑬
For dual control pin devices, it must be hold true that both are not 0 at the same time.
3
(a) (b)
Fig 2: (a) is Logic diagram for RAM and (b) is Logic diagram for EPROM
4
ADDRESSING AND ADDRESS DECODING
Microprocessor system includes memory devices and I/O devices. It is important to note that
microprocessor can communicate (read/write) with only one device at a time, since the data, address
and control buses are common for all the devices. In order to communicate with memory or I/O devices,
it is necessary to decode the address from the microprocessor. Due to this each device (memory or I/O)
can be accessed independently. The following section describes common address decoding techniques.
Address Decoding:
Address decoding is the process of generating chip select (CS*) signals from the address bus for each
device in the system.
In general all the address lines are not used by the memory devices to select particular memory
location. The remaining lines are used to generate chip select logic.
The N most significant bits are used to generate the CS* signals for the different devices
The M least significant signals are passed to the devices as addresses to the different
memory cells or internal registers.
5
o Drawback is address of location is not fixed, so each location may have multiple
addresses.
When the 2K x 8 EPROM is used, address connections A10–A0 of the 8088 are connected to
address inputs A10–A0 of the EPROM.
The remaining nine address pins (A19–A11) are connected to the inputs of a NAND gate
decoder (see Figure 4).
The decoder selects the EPROM from one of the 2K-byte sections of the 1M-byte memory
system.
In this circuit, a single NAND gate decodes the memory address.
The output of the NAND gate is logic 0 whenever the 8088 address pins attached to its
inputs (A19–A11) are all logic 1s.
The active low, logic 0 output of the NAND gate decoder is connected to the ̅̅̅̅ 𝐶𝐸 input pin
that selects (enables) the EPROM.
Recall that whenever ̅̅̅̅ ̅̅̅̅ is also a
𝐶𝐸 is a logic 0, data will be read from the EPROM only if 𝑂𝐸
logic 0.
The ̅̅̅̅
𝑂𝐸 pin is activated by the 8088 ̅̅̅̅𝑅𝐷 signal or the ̅̅̅̅̅̅̅̅̅
𝑀𝑅𝐷𝐶 (memory read control) signal
of other family members.
Here, the 2K EPROM is decoded at memory address locations FF800H–FFFFFH.
Fig 4: A simple NAND gate decoder that selects a 2716 EPROM for memory location FF800H–FFFFFH.
6
Example: To determine the address range that a device is mapped into
A19 - A11 A10 – A0
To
Notice that the outputs of the decoder, illustrated in Figure 6 above , are connected to eight
different 2764 EPROM memory devices.
Here, the decoder selects eight 8Kbyte blocks of memory for a total memory capacity of 64K
bytes.
A three-input NAND gate is connected to address bits A19–A17.
When all three address inputs are high, the output of this NAND gate goes low and enables
input ̅̅̅̅̅̅
𝐺2𝐵 of the 74LS138.
Input G1 is connected directly to A16.
In other words, in order to enable this decoder, the first four address connections (A19–
A16) must all be high.
The address inputs C, B, and A connect to microprocessor address pins A15–A13.
These three address inputs determine which output pin goes low and which EPROM is
selected whenever the 8088 outputs a memory address within this range to the memory
system.
7
Fig 5: The 74LS138 3-to-8 line decoder and function table.
Fig 6: A circuit that uses eight 2764 PROMs for a 64K 8 section of memory in an 8088
microprocessor-based system. The addresses selected in this circuit are F0000H– FFFFFH.
8
Example:
A19 - A16 A15 – A13 (CBA)
OR
1111 0000 0000 0000 0000 (F0000H)
To
Above figure shows how to connect or interface external RAM(data memory) to 8051. Port 0 is
used as multiplexed data & address lines. Address lines are decoded using external latch & ALE
signal from 8051 to provide lower order (A7-A0) address lines.
̅̅̅̅ & 𝑊𝑅
Port 2 gives higher order address lines. 𝑅𝐷 ̅̅̅̅̅̅signals from 8051 selects the memory read &
memory write operations respectively.
̅̅̅̅& 𝑊𝑅
𝑅𝐷 ̅̅̅̅̅̅signals: generally P3.6 & P3.7 pins of port 3 are used to generate memory read and
memory write signals.
Remaining pins of port 3 i.e. P3.0-P3.5 can be used for other functions.
9
ROM (Program Memory) Interfacing
Example: Design a µController system using 8051.Interface the external RAM of size 16k x 8.
Solution: Given, Memory size: 16k that means we require 2n=16k :: n address lines
Here n=14 :: A0 to A13 address lines are required.
A14 and A15 are connected through OR gate to CS pin of external RAM.
when A14 and A15 both are low (logic ‘0’), external data memory(RAM) is selected.
Address Decoding (Memory Map)for 16k x 8 RAM.
vss
10