Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Basic Concepts

• A memory device can be viewed as a


single column table. Memory Address Memory
– Table index (row number) refers to Binary Hex Contents
the address of the memory. 00-0000-0000 000 10011001
– Table entries refer to the memory 00-0000-0001 001 00111000
contents or data.
00-0000-0010 002 11001001
– Each table entry is referred as a
memory location or as a word. 00-0000-0011 003 00111011
• Both the memory address and the
memory contents are binary numbers,
expressed in most cases in Hex format.
• The size of a memory device is 11-1111-1100 3FC 01101000
specified as the number of memory 11-1111-1101 3FD 10111001
locations X width or word size (in bits). 11-1111-1110 3FE 00110100
– For example a 1K X 8 memory 11-1111-1111 3FF 00011000
device has 1024 memory locations,
with a width of 8 bits.
1024 X 8 (or 1KX8) Memory

ACOE255 Microprocessors I - Frederick University 1


Address Lines

• A memory device or memory chip must have


three types of lines or connections: Address,
Data, and Control.
• Address Lines: The input lines that select a
Y00 Location 000
memory location within the memory device. Y01 Location 001
– Decoders are used, inside the memory chip, to Y02 Location 002
select a specific location A00 Y03 Location 003
A01
– The number of address pins on a memory chip
specifies the number of memory locations.
• If a memory chip has 13 address pins An-2
(A0..A12), then it has: An-1 YFC Location 0FC
213 = 23 X 210 = 8K locations. YFD Location 0FD
YFE Location 0FE
• If a memory chip has 4K locations, then it
YFF Location 0FF
should have N pins:
2N = 4K = 22 X 210 = 212  N=12 address
pins (A0..A11)

ACOE255 Microprocessors I - Frederick University 2


Data Lines
• Data Connections: All memory devices have a set of data output pins (for ROM
devices), or input/output pins (for RAM devices).
– Most RAM chips have common bi-directional I/O connections.
– Most memory devices have 1, 8 or 16 data lines.

Data Input Lines


(DI0..DIn-1)
k- address lines k- address lines
(A0..Am -1) 2m words (A0..Am -1) 2m words
k- address lines
(A0..Am -1) 2m words
Read/Write (R/W) n-bits per Output Enable (OE) n-bits per
Read (RD) n-bits per word word
Chip Select (CS) Chip Select (CS)
Write (WR) word
Chip Select (CS)
Data Output Lines
Data Input/Output (D0..Dn-1)
Data Output Lines Lines (D0..Dn-1)
(DO0..DOn-1) (2m X n) ROM with only O/P Data
(2m X n) RAM with common I/P
(2m X n) RAM with separate I/P lines
and O/P Data lines
and O/P Data lines

ACOE255 Microprocessors I - Frederick University 3


Control Lines
• Enable Connections:
– All memory devices have at least one Chip Select (CS) or Chip Enable (CE)
input, used to select or enable the memory device.
• If a device is not selected or enabled then no data can be read from, or
written into it.
• The CS or CE input is usually controlled by the microprocessor through the
higher address lines via an address decoding circuit.
• Control Connections:
– RAM chips have two control input signals that specify the type of memory
operation: the Read (RD) and the Write (WR) signals.
• Some RAM chips have a common Read/ Write (R/W) signal.
– ROM chips can perform only memory read operations, thus there is no need
for a Write (WR) signal.
• In most real ROM devices the Read signal is called the Output Enable
(OE) signal.

ACOE255 Microprocessors I - Frederick University 4


Memory Read Operations
• A memory read operation is carried out in the following steps:
– The processor loads on the Address bus the address of the memory location to be read (Step 1).
• Some of the address lines select the memory devices that owns the memory location
to be read (Step 1a), while the rest point to the required memory location within the
memory device.
– The processor activates the Read (RD) signal (Step 2).
• The selected memory device loads on the data bus the content of the memory
location specified by the address bus (Step 3).
– The processor reads the data from the data bus, and resets the RD signal (Step 4).

Clock T1 T2 T3

Address Bus Valid Address

Chip Enable

Read (RD)

Data Bus Invalid Data Valid Data


Step 1a
Step 2 Step 3 Step 4
Step 1

ACOE255 Microprocessors I - Frederick University 5


Memory Write Operations
• A memory write operation is carried out in the following steps:
– The processor loads on the Address bus the address of the memory location (Step 1).
• Some of the address lines select the memory devices that owns the memory location
to be written (Step 1a), while the rest point to the required memory location within
the memory device.
– The processor loads on the data bus the data to be written (Step 2).
– The processor activates the Write (WR) signal (Step 3).
• The data at the data bus is stored in the memory location specified by the address
bus (Step 4).
Clock T1 T2 T3

Address Bus Valid Address

Data Bus Valid Data

Chip Enable

Write (WR)
Step 2
Step 1
Step 4
Step 1a Step 3

ACOE255 Microprocessors I - Frederick University 6


RAM Cells
Static RAM (SRAM): Dynamic RAM (DRAM):
• The basic element of a static RAM cell is the • DRAM stores data in the form of electric
D-Latch. charges in capacitors.
• Data remains stored in the cell until it is • Charges leak out, thus need to refresh
intentionally modified. data every few ms.
• SRAM is fast (Access time: 1ns). • DRAM is slow (Access time: 60ns).
• SRAM needs more space on the • DRAM needs less space on the
semiconductor chip than DRAM. semiconductor chip than SRAM.
– SRAM more expensive than DRAM – DRAM less expensive than SRAM
– SRAM needs more space than DRAM – DRAM needs less space than SRAM
• SRAM consumes power only when accessed. • DRAM needs to be refreshed
• SRAM is used as a Cache • DRAM is used as the main memory
Bit Select

Bit Select
Data In D Q Data Out
Data In Data Out

Write En
RAM Cell DRAM Cell

ACOE255 Microprocessors I - Frederick University 7


Semiconductor Memory Expansion
• The size of memory devices is usually less than the memory requirements of a computer system.
• In all computers, more than one memory devices are combined together to form the main
memory of the system.
• Any computer must have at least one ROM chip and one RAM chip.
• Word size memory expansion:
– Most memory devices have a word size (number of data lines) of 8 or 16 bits.
– The word size of today’s microprocessors is 32 bits (80386, 80486) or 64 bits
(Pentium)
• Address size memory expansion:
– The size of common memory chips is usually less or in the order of 256M-byte.
– Most personal computers have more than 2 Gbytes of RAM.
– Workstations and other high throughput computers have more than 4Gbytes of RAM.

ACOE255 Microprocessors I - Frederick University 8


Memory Expansion on Motherboards

Memory Expansion Memory Expansion


Using 4 SIMMs on using 4 Memory
the Motherboard Chips on a SIMM
Motherboard

Slot 3 Slot 4
SIMM

Slot 1 Slot 2
SIMM SIMM

Processor

ACOE255 Microprocessors I - Frederick University 9


Memory Address Size Expansion

• More than one memory devices can be used to expand the number of memory
locations on the system.
• To expand the word size do the following:
– Determine the number of memory chips required, by dividing the required
memory size with the size of the memory devices to be used.
– Connect the data lines of each memory chip in parallel on the data lines of
the processor.
– Connect the address lines of each memory chip in parallel with the low
address lines of the processor.
– Connect the CS lines of each memory device with the high address lines of
the processor through an address decoding circuit..
– Connect together all WR and all RD lines of each memory device.

ACOE255 Microprocessors I - Frederick University 10


Address Size Expansion: (32X4 RAM module using 8X4 RAM chips)

D0
D1
D2
D3
RAM1 D3 D0 RAM2 D3 D0 RAM3 D3 D0 RAM4 D3 D0
0 0 0 0
1 1 1 1
2 2 2 2
A0 3 A0 3 A0 3 A0 3
A1 4 A1 4 A1 4 A1 4
A2 5 A2 5 A2 5 A2 5
6 6 6 6
7 7 7 7
RD WR CS RD WR CS RD WR CS RD WR CS
RD
WR
A0
A1
A2
A3 A Y0
A4 B Y1
A5 Y2
CS
A6 Y3
Address 2X4 DEC.
Selection

ACOE255 Microprocessors I - Frederick University 11


Example: (32X4 RAM module using 8X4 RAM chips - Assume an 8-address line processor)

D3 D3 D0 D3 D0 D3 D0 D3 D0
8x4 RAM 1 8x4 RAM 2 8x4 RAM 3 8x4 RAM 4
A0 A0 A0 A0
D0
A2 A2 A2 A2

RD WR CS RD WR CS RD WR CS RD WR CS

RD
WR

A0

2X4 DEC.
A2
A3 A Y0
A4 B Y1
A5 Y2
A6 CS Y3
A7

ACOE255 Microprocessors I - Frederick University 12


Design Example:
Design an 8KX8 RAM module using 2KX8 RAM chips. The module should be connected on
an 8-bit processor with a 16-bit address bus, and occupy the address range starting from the
address A000. Show the circuit .

• Number of memory devices needed = 8K/2K


=4
• Decoder needed = 2X4
• Number of address lines on each 2KX8
memory chip = 11
2m = 2K = 21 x 210 = 211  (A0..A10)
• Decoder needed = 2X4
 2 address lines are needed for the decoder.
 (A11..A12)
• Number of address lines needed for the
address selection circuit
= 16 - 11 - 2 = 3  (A13, A14 A15)

ACOE255 Microprocessors I - Frederick University 13


Circuit Diagram

D7
D0 D7 D0 D7 D0 D7 D0 D7

2Kx8 RAM 2Kx8 RAM 2Kx8 RAM 2Kx8 RAM

D0 A0 A0 A0 A0

A10 A10 A10 A10

RD WR CS RD WR CS RD WR CS RD WR CS

RD
WR

A0
2X4 DEC.
A11
A Y0
A12
B Y1
A13
Y2
A14
CS Y3
A15 A15

ACOE255 Microprocessors I - Frederick University 14

You might also like