Unit 06
Unit 06
1.2. Introduction
Computer
Auxiliary mass
storage (tape,
disk, MBM)
Memory terminology. Memory Word : A group of bits (cells) in a memory that represents
instructions or data of some type. For example, a register consisting of
eight FFs can be considered to be a memory that is storing an 8-bit word.
Byte : A special term used for a group of 8-bits. A byte always consists
of 8-bits. Word sizes can be expressed in byte as well as in bits. For
example, a word size of 8-bits is also a word of one byte; a word size of
16-bits is two bytes word, and so on.
134
Memory Organization
Problem 1
Each word is 8 bits (one byte). The total number of bits is therefore 4096
X 8 = 32,768 bits
Problem 2
Solution
Density : Another term for capacity. When we say that one memory
5M X 8 memory stores device has a greater density than another, we mean that memory of
more bits.
greater densities it can store more bits in the same amount of space. It is
more dense.
Write operation. Write Operation : The operation whereby a new word is placed into a
particular memory location. It is also referred to as store
135
Digital Systems and Computer Organization
Addresses
000 Word 0
001 Word 1
010 Word 2
011 Word 3
100 Word 4
101 Word 5
110 Word 6
111 Word 7
136
Memory Organization
1.4. Exercise
a) Explain the difference between the read (fetch) and write (store)
operations.
b) Explain the difference between RWM and ROM.
137
Digital Systems and Computer Organization
138
Memory Organization
Data Inputs
I3 I2 I1 I0
A4
A3 Read/Write command
R/W
Address
A2
32 x 4
Inputs Memory enable
Memory M.E.
A1
A0
O3 O 2 O1 O0
Data Outputs
0 1 1 0 00000 0 1 1 0
1 0 0 1 00001 1 0 0 1
1 1 1 1 00010 1 1 1 1
0 1 0 0 00011 0 1 0 0
0 0 0 1 00100 0 0 0 1
0 0 0 0 00101 0 0 0 0
• •
• •
• •
1 1 0 1 11101 1 1 0 1
1 1 0 1 11110 1 1 0 1
0 1 1 1 11111 0 1 1 1
139
Digital Systems and Computer Organization
Problem 3
Problem 3 Describe the conditions at each input and output when the contents of
address location 00100 are to be read.
Solution
Problem 4
Describe the conditions at each input and output when the data word
1110 is to be written into address location 01101.
Solution
Problem 5
Solution
140
Memory Organization
shown in Fig. 6.4 the address lines or address bus, data lines or data bus,
and the control lines or control bus. Each of these buses consists of
several lines (note how they are represented by a single line with a
slash), and the number of lines in each bus will vary from one computer
to the next. The three buses play a necessary part in allowing the CPU to
write data into memory and to read data from memory.
Fig. 6.4 depicts a simple diagram in which the connection between CPU
and two memory ICs are shown. Address is send only from CPU to
memory. It is represented by an arrow from address bus to memory.
Similarly, an arrow from control bus to memory represents that control
signals are provided from CPU to memory. An arrow from data bus to
memory and another arrow from memory to data bus indicate that data
can be transmitted from CPU to memory and from memory to CPU.
Interaction between CPU Interaction between CPU and memory can be identified by two
and memory can be operations.
identified by two operations.
Write operation.
Write operation.
Read operation.
Read operation.
Write operation
1. The CPU supplies the binary address of the memory location where
the data are to be stored. It places this address on the address bus
lines.
2. The CPU places the data to be stored on the data bus.
3. The CPU activates the appropriate control signal lines for the
memory write operation.
4. The memory ICs decode the binary address to determine which
location is being selected for the store operation.
5. The data on the data bus are transferred to the selected memory
location.
141
Digital Systems and Computer Organization
Read Operation
To transfer a byte of data from the memory to the CPU, a read operation
must be performed. This address from address buffer is put onto the
address bus.
Once the address code is on the bus, the CPU sends a read signal to the
memory. At the memory, the address bits are decoded and the desired
The read signal causes the memory location is selected. The read signal causes the contents of the
contents of the selected
selected address to be put on the data bus. The data byte is then loaded
address to be put on the
data bus.
into the data buffer. This completes read operation. Whenever the CPU
wants to read data from a specific memory location, the following steps
must occur :
1. The CPU supplies the binary address of the memory location from
which data are to be retrieved. It places this address of the address
bus lines.
2. The CPU activates the appropriate control signal for read operation .
Address bus
• •
Control bus
Fig. 6.4 : Three groups of lines (buses) connect the internal memory ICs
to the CPU.
CPU, memory and other devices communicate with each other through
Bus is the lines through
bus. Bus is the lines through which data, address and control signals
which data, address and
control signals transmit transmit from one device to another. Bus are classified into three
from one device to categories according to the information passes through it.
another.
Address Bus
Data Bus
Control Bus.
142
Memory Organization
Data Bus : This is a bi-directional bus that carries data between the CPU
and the memory ICs.
Data Bus
Control Bus Control Bus : This bus carries control signals from the CPU to
other devices. When CPU instructs some devices to perform some
actions, the instruction or orders are provided by some control signals.
For example, CPU activate memory by providing 0 (zero) at CS control
line and provide order for read operation by sending 1 at R/W control
line. So, control bus transmits signals for controlling purposes.
2.3. Exercise
a) How many address inputs, data inputs, and data outputs are
required for a 16K X 12 memory?
b) What is the function of the R/W input?
c) What is the function of the MEMORY ENABLE input?
a) Name the three groups of lines that connect the CPU and
internal memory.
b) Outline the steps that take place when the CPU reads from
memory.
c) Outline the steps that occur when the CPU writes to memory.
143
Digital Systems and Computer Organization
ROMs are used to store data and information that are not to change be
during the normal operation of a system. A major use for ROMs is the
storage of programs in microcomputers. Since all ROMs are nonvolatile,
these programs are not lost when electrical power is turned off. When
the microcomputer is turned on, it can immediately begin executing the
program stored in ROM. ROMs are also used for program and data
storage in microprocessor controlled equipment such as electronic cash
registers, appliances, and security systems.
144
Memory Organization
The user can selectively blow any of these fuse links to produce the
desired stored memory data. Typically, data is programmed or "burned"
into an address location by : applying the address to the address inputs,
placing the desired data at the data pins, and then applying a high-
voltage pulse (10-30 V) to a special programming link, on the IC. This
causes a large current to flow through each selected fuse link, burning it
open and permanently storing a logic 0 in that cell. Once all address
locations have been programmed in this manner, the data are
permanently stored in the PROM and can be read over and over again by
accessing the appropriate address. The data will not change when power
is removed from the PROM chip, because nothing will cause an open
fuse link to become closed again.
The process of programming a PROM and verifying that the stored data
are correct is done automatically by a special apparatus called a PROM
programmer.
145
Digital Systems and Computer Organization
The storage cells in an EPROM are MOS transistors. In its normal state,
each transistor is off and each cell stores a logic 1. A transistor can be
turned on by the application of a high-voltage programming pulse. This
keeps the transistor on permanently even when power is removed from
the device, and the cell is now storing a logic 0.
146
Memory Organization
ERPOMs are nonvolatile, offer fast access times (typically 120 ns), and
have high density and low cost ber bit. EEPROMs are nonvolatile, offer
fast read access, and allow rapid in-circuit erasure and reprogramming of
individual bytes. They are from lower density and much higher cost than
EPROMs.
Flash memories are so-called because of their rapid erase and write
Flash memories are so- times. Cells on the chip are erased simultaneously; this bulk erase
called because of their process typically requires hundreds of milliseconds. Some newer flash
rapid erase and write memories offer a sector erase mode, where specific sectors of the
times.
memory array can be erased at one time.
The term ROM can be used to include EPROMs, EEPROMs, and flash
memory, because during normal operation the stored contents of these
ROMs are taken to include devices are not changed. So ROMs are taken to include all
all semiconductor semiconductor nonvolatile memory devices, and they are used in
nonvolatile memory applications where nonvolatile storage of information, data, or program
devices codes is needed, and where the stored data rarely or never change. Here
are some of the most common application areas.
3.4.1. Firmware
A relatively small Many microcomputers and most larger computers do not have their
program, called a operating system programs stored in ROM. Instead, these programs are
bootstrap program, is stored in external mass memory, usually magnetic disk. A relatively
stored in ROM.
small program, called a bootstrap program, is stored in ROM. When the
147
Digital Systems and Computer Organization
computer is powered on, it will execute the instructions that are in this
bootstrap program. These instructions typically cause the CPU to bood
the system programs from mass storage (disk) into its main internal
memory. A that point the computer is ready to respond to the user
commands. This startup process is often called "booting up the system".
ROMs are often used to store tables of data that do not change. Some
examples are the trigonometric tables (i.e., sine, cosine, etc.) and code-
conversion tables.
3.5. Exercise
148
Memory Organization
A typical block diagram for a ROM is shown in Fig. 6.5. It has three sets
of signals : address inputs, control inputs(s), and data outputs. This
ROM is storing
D7
A3 D6
D5
Address A2 16 x 8 D4
Data
Inputs D3
ROM outputs
A1 D2
D1
A0 D0
CS (Chip Select)
Control Input
(a)
Address Data Address Data
Word A3 A2 A1 A0 D7 D6 D5 D4 D3 D2 D1 D0 Word A3 A2 A1 A0 D7-D0
0 0 0 0 0 1 1 0 1 1 1 1 0 0 0 DE
1 0 0 0 1 0 0 1 1 1 0 1 0 1 1 3A
2 0 0 1 0 1 0 0 0 0 1 0 1 2 2 85
3 0 0 1 1 1 0 1 0 1 1 1 1 3 3 AF
4 0 1 0 0 0 0 0 1 1 0 0 1 4 4 19
5 0 1 0 1 0 1 1 1 1 0 1 1 5 5 7B
6 0 1 1 0 0 0 0 0 0 0 0 0 6 6 00
7 0 1 1 1 1 1 1 0 1 1 0 1 7 7 ED
8 1 0 0 0 0 0 1 1 1 1 0 0 8 8 3C
9 1 0 0 1 1 1 1 1 1 1 1 1 9 9 FF
10 1 0 1 0 1 0 1 1 1 0 0 0 10 A B8
Typical block diagram for 11 1 0 1 1 1 1 0 0 0 1 1 1 11 B C7
a ROM. 12 1 1 0 0 0 0 1 0 0 1 1 1 12 C 27
13 1 1 0 1 0 1 1 0 1 0 1 0 13 D 6A
14 1 1 1 0 1 1 0 1 0 0 1 0 14 E D2
15 1 1 1 1 0 1 0 1 1 0 1 1 15 F 5B
(b) (C)
Fig. 6.5 : (a) Typical ROM block symbol; (b) table showing binary data
at each address location; (c) same table in hex.
149
Digital Systems and Computer Organization
The control input CS stands for chip select. This is essentially an enable
input that enables or disables the ROM outputs. Therefore it must be in
the LOW state to enable the ROM data to appear at the data outputs.
The Read Operation : Sixteen different data words are stored at the 16
The Read Operation different address locations. For example, the data word stored at location
0011 is 10101111. Of course, the data are stored in binary inside the
ROM, but very often we use hexadecimal notation to efficiently show
the programmed data.
Register Array : The register array stores the data that have been
programmed into the ROM. Each register contains a number of memory
cells equal to the word size. We can specify the position of each register
as being in a specific row and specific column.
The data outputs of each register are corrected to an internal data bus
that runs through the entire circuit. Each register has enable inputs.
Output Buffers : The register that is enabled by the address inputs will
place its data on the data bus. These data feed into the output buffers,
which will pass the data to the external data outputs, provided that CS is
LOW.
Problem
Problem Describe the internal architecture of a ROM that stores 4K bytes and
uses a square register array.
150
Memory Organization
Solution
4.4. Exercise
151
Digital Systems and Computer Organization
152
Memory Organization
A5A4A3A2A1A0 = 011010
Read Operation : The address code picks out pinks register in the
memory chip for reading or writing. In order to read the contents of the
selected register, the READ/ WRITE (R/W)* input must be a 1. In
addition, the CHIP SELECT (CS) input must be activated (a 0 in this
case). The combination of R/W = 1 and CS = 0 enables the output
buffers so that the contents of the selected register will appear at the four
data output. R/W = 1 also disables the input buffers so that the data
inputs do not affect the memory during a read operation.
Write Operation : To write a new 4-bit word into the selected register
Read Operation requires R/W = 0 and CS = 0. This combination enables the input
Write Operation buffers so that the 4-bit word applied to the data inputs will be loaded
Chip Select into the selected register. The R/W = 0 also disables the output buffers,
which are tristate, so that the data outputs are in their Hi-Z state during a
write operation. The write operation, of course, destroys the word that
was previously stored at that address.
Chip Select : Most memory chips have one or more CS inputs which are
used to enable the entire chip or disable it completely. In the disabled
mode all data inputs and data outputs are disabled (Hi-Z) so that neither
a read nor a write operation can take place. In this mode the contents of
the memory are unaffected. The reason for having CS inputs will
become clear when we combine memory chips to obtain larger
memories. These inputs CHIP ENABLE (CE). When the CS or CE
inputs are in their active state, the memory chip is said to be selected;
otherwise it is said to be deselected. Many memory ICs are designed to
consume much lover power when they are deselected. In large memory
systems, for a given memory operation, one or more memory chips will
be selected while all others are deselected.
Common Input/ Output Pins : The data input and data output
functions uses common input/ output pins. The R/W input controls the
function of these I/O pins. During a read operation, the I/O pins act as
data outputs which reproduce the contents of the selected address
location. During a write operation, the I/O pins act as data inputs to
which the data to be written are applied.
153
Digital Systems and Computer Organization
5.4. Exercise
154
Memory Organization
155
Digital Systems and Computer Organization
VDD
Q3 Q4
Q1
Q2
NMOS Cell
The main advantages of static RAM are that these are non-destructive,
simple to operate, need no refreshing and can be operated at higher
speed. However, such cells need large dc power and more support circuit
for decoding and control. This leads to larger area resulting in reduced
packing density. Use of dynamic memory cells, have played a crucial
role to increase the packaging density of memory chips.
156
Memory Organization
S4
Data in
S1 S2 S3
Data out
Sense
amplifier
VREF
Dynamic RAMs are fabricated using MOS technology and are noted for
their high capacity, low power requirement, and moderate operating
speed. Unlike static RAMs, which store information in FFs, dynamic
RAMs store 1’s and 0’s as charges on a small MOS capacitor. Because
of the tendency for these charges to leak off after a period of time,
dynamic RAMs require periodic recharging of the memory cells; this is
called refreshing the dynamic RAM. In modern DRAM chips, each
memory cell must be refreshed typically every, 2, 4, or 8 ms, or its data
will be lost.
For applications where speed and reduced complexity are critical than
cost, space, and power considerations, static RAMs are still the best.
They are generally faster than dynamic RAMs and require no refresh
operation. They are simpler to design with, but they cannot compete with
the higher capacity and lower power requirement of dynamic RAMs.
Because of their simple cell structure, DRAMs typically have four times
the density of SRAMs. This allows four times as much memory capacity
to be placed on a single board. The cost per bit of dynamic RAM storage
is typically one-fifth to one-fourth that of static RAMs. Power
requirements of a dynamic RAM, typically one-sixth to one-half those of
a static RAM.
157
Digital Systems and Computer Organization
6.4. Exercise
158
Memory Organization
combine memory ICs to form memory modules with larger word size
and capacity.
Suppose we need a memory that can store sixteen 8-bit words and all we
have are RAM chips which are arranged as 16 4 chips to produce the
desired memory.
Since each chip can store sixteen 4-bit words and we want to store
sixteen 8-bit words we are using each chip to store half of each word. In
other words, RAM-0 stores the four higher-order bits of each of the 16
words, and RAM-1 stores the four lower-order bits of each of the 16
words. A full 8-bit word is available at the RAM outputs connected to
the data bus.
AB 3
AB 2
Address
AB 1
Bus
AB 0
R/W
CS
A3 A2 A 1 A0 A3 A2 A 1 A0
R/W R/W
RAM 0 RAM 1
16 X 4 16 X 4
CS CS
I/O 3 I/O 2 I/O 1 I/O 0 I/O 3 I/O 2 I/O 1 I/O 0
DB7
DB6
DB5
DB4 Data
DB3 Bus
DB2
DB1
DB0
159
Digital Systems and Computer Organization
Once the address is selected, we can read or write at this address under
control of the common R/W and CS line. To read, R/W must be high and
CS must be low. This causes the RAM I/O lines at act as outputs.
RAM-0 places its selected 4-bit word on the upper four data bus lines
and RAM-1 places its selected 4-bit word on the lower four data bus
lines. The data bus then contains the full selected 8-bit word.
To write, R/W = 0 and CS = 0 causes the RAM I/O lines to act as inputs.
The 8-bit word to be written is places on the data bus. The higher 4 bits
will be written into the selected location of RAM-0 and the lower 4 bits
will be written into RAM-1.
The combination of the two RAM chips acts like a single 16 8 memory
chip. We would refer to this combination as a 16 8 memory module.
The same basic idea for expanding word size will work for many
different situations.
Suppose we need a memory that can store thirty-two 4-bit words and all
we have are the 16 4 chips. By combining two 16 4 chips we can
By combining two 16 4 produce the desired memory.
chips we can produce the
desired memory.
Each RAM is used to store sixteen 4-bit words. The data four I/O pins of
each RAM are connected to a common four-line data bus. Only one of
the RAM chips can be selected at one time. This is ensured by driving
the respective CS inputs from different logic signals.
160
Memory Organization
AB 4
AB 3
Address
AB 2
Bus
AB 1
AB 0
R/W
A3 A2 A 1 A0 A3 A2 A 1 A0
CS CS
RAM 0 RAM 1
16 X 4 16 X 4
R/W R/W
When AB4 = 0, the CS of RAM-0 enables this chip for read or write.
Then, any address location in RAM-0 can be accessed by AB3 through
AB0. The latter four address lines can range from 0000 to 1111 select the
desired location. Thus, the range of addresses representing locations in
RAM-0 is
When AB4 = 0, the CS of RAM-1 is high, so that its I/O lines are
disabled (Hi-Z) and cannot communicate (give or take data) with the
data bus.
When AB4 = 1, the roles of RAM-0 and RAM-1 are reversed. RAM-1 is
now enabled and the lines AB3 to AB0 select one of its locations. Thus,
the range of addresses location in RAM-1 is
Problem
161
Digital Systems and Computer Organization
Solution
For PROM chips are required, with each one storing 2K of the 8K
words. Since 8K = 8 1024 = 8192 = 213, thirteen address lines are
needed.
7.4. Exercise
162
Memory Organization
8.2. Memory
Let us assume that houses are given four-digit decimal numbers, which
will enable us to number ten thousand houses from 0000 to 9999. Since
it is cumbersome to direct someone to house with large numbers, the
numbering scheme can be devised with the concept of a row or block.
Each block will have a hundred houses to be numbered with the last two
163
Digital Systems and Computer Organization
digits from 00 to 99. Similarly, the blocks are also identified by the first
two decimal digits. For example, a house with the number 0247 is house
number 47 in block 2. With this scheme, all the houses in block 0 will be
identified from 0000 to 0099, in block 20 from 2000 to 2099, and in
block 99 from 9900 to 9999. This numbering scheme with four decimal
digits is capable of giving addresses to ten thousand houses form 0000 to
9999 (100 blocks of 100 houses each). A new area under development
may have only two blocks completed - block 0 and block 20 - the house
on these blocks can have addresses 0000 to 0099 and 2000 to 2099, even
if other blocks are still empty. Let us also assume that all houses are
identical, and have eight rooms.
164
Memory Organization
165
Digital Systems and Computer Organization
8.7. Exercise
166