Chapter Five
Chapter Five
CHAPTER FIVE
MEMORY
Overview
Memory refers to the processes that are used to acquire, store, retain and later retrieve information.
There are three major processes involved in memory: encoding, storage and retrieval.
In order to form new memories, information must be changed into a usable form, which occurs through
the process known as encoding. Once information has been successfully encoded, it must be stored in
memory for later use. Much of this stored memory lies outside of our awareness most of the time,
except when we actually need to use it. The retrieval process allows us to bring stored memories into
conscious awareness.
The goal of this chapter is to help you become literate in Memory. In becoming computer literate about
Memory, you will be able to know about the importance of memory, types of memory, how to use the
memory and be able to use them to accomplish tasks every day.
Learning Objectives
Memory
Characteristics of Storage
Storage Hierarchy
Memory Limitations
Page- 73
Chapter Five Memory
Introduction
The term memory identifies data storage that comes in the form of chips, and the word storage is used
for memory that exists on tapes or disks. Moreover, the term memory is usually used as shorthand for
physical memory, which refers to the actual chips capable of holding data. Some computers also use
virtual memory, which expands physical memory onto a hard disk.
Every computer comes with a certain amount of physical memory, usually referred to as main memory
or RAM. You can think of main memory as an array of boxes, each of which can hold a single byte of
information. A computer that has 1 megabyte of memory, therefore, can hold about 1 million bytes (or
characters) of information.
Computer - Memory
A memory is just like a human brain. It is used to store data and instructions. Computer memory is the
storage space in computer where data is to be processed and instructions required for processing are
stored. The memory is divided into large number of small parts called cells. Each location or cell has a
unique address which varies from zero to memory size minus one. For example if computer has 64k
words, then this memory unit has 64 * 1024=65536 memory locations. The address of these locations
varies from 0 to 65535.
Memory Cells
Primary computer memory is made up of memory cells, where each memory cell contains exactly one
number. Thus, a memory cell can be thought of as box into which a single number can be placed. The
number contained in a memory cell can be changed over time. When a new number is stored into a
memory cell, the old number contained in the memory cell is lost forever. At any time, the computer
may peer into a memory cell to read the current contents of the memory cell. The computer may read
the contents of a memory cell as many times as it wants, without disturbing it.
Characteristics of Storage
Storage technologies at all levels of the storage hierarchy can be differentiated by evaluating certain
core characteristics as well as measuring characteristics specific to a particular implementation. These
core characteristics are volatility, mutability, accessibility, and addressability. For any particular
implementation of any storage technology, the characteristics worth measuring are capacity and
performance.
1. Volatility
Non-volatile memory
Will retain the stored information even if it is not constantly supplied with electric power. It is
suitable for long-term storage of information.
Volatile memory
Requires constant power to maintain the stored information. The fastest memory technologies
of today are volatile ones (not a universal rule). Since primary storage is required to be very
fast, it predominantly uses volatile memory.
Dynamic random-access memory
A form of volatile memory which also requires the stored information to be periodically re-
read and re-written, or refreshed, otherwise it would vanish.
Static random-access memory
Page- 74
Chapter Five Memory
A form of volatile memory similar to DRAM with the exception that it never needs to be
refreshed as long as power is applied.
2. Mutability
Read/write storage or mutable storage
Allows information to be overwritten at any time. A computer without some amount of
read/write storage for primary storage purposes would be useless for many tasks. Modern
computers typically use read/write storage also for secondary storage.
Read only storage
Retains the information stored at the time of manufacture, and write once storage (Write Once
Read Many) allows the information to be written only once at some point after manufacture.
These are called immutable storage. Immutable storage is used for tertiary and off-line
storage. Examples include CD-ROM and CD-R.
Slow write, fast read storage
Read/write storage which allows information to be overwritten multiple times, but with the
write operation being much slower than the read operation. Examples include CD-RW and
flash memory.
3. Accessibility
Random access
Any location in storage can be accessed at any moment in approximately the same amount of
time. Such characteristic is well suited for primary and secondary storage.
Sequential access
The accessing of pieces of information will be in a serial order, one after the other; therefore
the time to access a particular piece of information depends upon which piece of information
was last accessed. Such characteristic is typical of off-line storage.
4. Addressability
Location-addressable
Each individually accessible unit of information in storage is selected with its numerical
memory address. In modern computers, location-addressable storage usually limits to primary
storage, accessed internally by computer programs, since location-addressability is very
efficient, but burdensome for humans.
File addressable
Information is divided into files of variable length, and a particular file is selected with human-
readable directory and file names. The underlying device is still location-addressable, but the
operating system of a computer provides the file system abstraction to make the operation
more understandable. In modern computers, secondary, tertiary and off-line storage use file
systems.
Content-addressable
Each individually accessible unit of information is selected based on the basis of (part of) the
contents stored there. Content-addressable storage can be implemented using software
(computer program) or hardware (computer device), with hardware being faster but more
Page- 75
Chapter Five Memory
expensive option. Hardware content addressable memory is often used in a computer's CPU
cache.
5. Capacity
Raw capacity
The total amount of stored information that a storage device or medium can hold. It is
expressed as a quantity of bits or bytes (e.g. 10.4 megabytes).
Memory storage density
The compactness of stored information. It is the storage capacity of a medium divided with a
unit of length, area or volume (e.g. 1.2 megabytes per square inch).
6. Performance
Latency
The time it takes to access a particular location in storage. The relevant unit of measurement is
typically nanosecond for primary storage, millisecond for secondary storage, and second for
tertiary storage. It may make sense to separate read latency and write latency, and in case of
sequential access storage, minimum, maximum and average latency.
Throughput
The rate at which information can be read from or written to the storage. In computer data
storage, throughput is usually expressed in terms of megabytes per second or MB/s, though bit
rate may also be used. As with latency, read rate and write rate may need to be differentiated.
Also accessing media sequentially, as opposed to randomly, typically yields maximum
throughput.
7. Energy use
Storage devices that reduce fan usage, automatically shut-down during inactivity, and low
power hard drives can reduce energy consumption 90 percent.
2.5 inch hard disk drives often consume less power than larger ones. Low capacity solid-state
drives have no moving parts and consume less power than hard disks. Also, memory may use
more power than hard disks.
Memory Types
Page- 76
Chapter Five Memory
The memory components of a computer system can be divided into following main groups:
1. Main Memory ( Primary Memory)
2. Secondary Memory (Auxiliary Memory)
3. Internal Processor Memory.
Main Memory: It is characterized by the fact that locations in memory can be directly
accessed by the CPU instructions set. This is used for program and data storage during
computer operation.
Secondary Memory: It is much larger in size but much slower than main memory and is used
for storing system programs and large data files which are continually not required by CPU.
Internal Processor Memory: This usually comprises a small set of high speed registers used
as working for temporary storage of instructions and data.
Fig 5.1: Various forms of storage, divided according to their distance from the central processing unit.
RAM
Page- 77
Chapter Five Memory
RAM (random-access memory): RAM (Random Access Memory) is the internal memory of the CPU
for storing data, program and program result. It is read/write memory which stores data until the
machine is working. As soon as the machine is switched off, data is erased.
Access time in RAM is independent of the address that is, each storage location inside the memory is as
easy to reach as other locations and takes the same amount of time. Data in the RAM can be accessed
randomly but it is very expensive.
RAM is volatile, i.e. data stored in it is lost when we switch off the computer or if there is a power
failure. Hence a backup uninterruptible power system(UPS) is often used with computers. RAM is
small, both in terms of its physical size and in the amount of data it can hold.
RAM is of two types
Static RAM (SRAM)
Dynamic RAM (DRAM)
ROM
ROM (read-only memory): Computers almost always contain a small amount of read-only memory
that holds instructions
for starting up the
computer. Unlike
RAM, ROM cannot
be written to.
Read-only memory (ROM) is a class of storage medium used in computers and other electronic
devices. Data stored in ROM cannot be modified, or can be modified only slowly or with difficulty, so
it is mainly used to distribute firmware (software that is very closely tied to specific hardware, and
unlikely to need frequent updates).
Other types of non-volatile memory such as erasable programmable read only memory (EPROM) and
electrically erasable programmable read-only memory (EEPROM or Flash ROM) are sometimes
referred to, in an abbreviated way, as "read-only memory" (ROM), but this is actually a misnomer
because these types of memory can be erased and re-programmed multiple times. When used in this less
precise way, "ROM" indicates a non-volatile memory which serves functions typically provided by
mask ROM, such as storage of program code and nonvolatile data.
Page- 78
Chapter Five Memory
PROM (programmable read-only memory): A PROM is a memory chip on which you can store a
program. But once the PROM has been used, you cannot wipe it clean and use it to store something
else. Like ROMs, PROMs are non-volatile.
EPROM (erasable programmable read-only memory): An EPROM is a special type of PROM that
can be erased by exposing it to ultraviolet light.
Secondary Memory
This type of memory is also known as external memory or non-volatile. It is slower than main memory.
These are used for storing data/Information permanently. CPU directly does not access these memories
instead they are accessed via input-output routines. Contents of secondary memories are first transferred
to main memory, and then CPU can access it. For example : disk, CD-ROM, DVD etc.
Page- 79
Chapter Five Memory
Punched Tape
Punched tape or paper tape is a largely obsolete form of data storage, consisting of a long strip of
paper in which holes are punched to store data. It was widely used during much of the twentieth century
for tele printer communication, and later as a storage medium for minicomputers and CNC machine
tools.
Punched card
A punched card, punch card, IBM card, or Hollerith card is a piece of stiff paper that contains digital
information represented by the presence or absence of holes in predefined positions. Now an obsolete
recording medium, punched cards were widely used throughout the 19th century for controlling textile
looms and in the late 19th and early 20th century for operating fairground organs and related
instruments. They were used through the 20th century in unit record machines for input, processing, and
data storage. Early digital computers used punched cards, often prepared using keypunch machines, as
the primary medium for input of both computer programs and data. Some voting machines use punched
cards.
Magnetic Storage
Magnetic storage uses different patterns of magnetization on a magnetically coated surface to store
information. Magnetic storage is non-volatile. The information is accessed using one or more read/write
heads which may contain one or more recording transducers. A read/write head only covers a part of the
surface so that the head or medium or both must be moved relative to another in order to access data. In
modern computers, magnetic storage will take these forms:
Magnetic disk
o Floppy disk, used for off-line storage
o Hard disk drive, used for secondary storage
Page- 80
Chapter Five Memory
Magnetic tape data storage, used for tertiary and off-line storage
In early computers, magnetic storage was also used for primary storage in a form of magnetic drum, or
core memory, core rope memory, thin-film memory, twistor memory or bubble memory. Also unlike
today, magnetic tape was often used for secondary storage.
Optical Storage
Optical storage, the typical optical disc, stores information in deformities on the surface of a circular
disc and reads this information by illuminating the surface with a laser diode and observing the
reflection. Optical disc storage is non-volatile. The deformities may be permanent (read only media),
formed once (write once media) or reversible (recordable or read/write media). The following forms are
currently in common use:
CD, CD-ROM, DVD, BD-ROM: Read only storage, used for mass distribution of digital
information (music, video, computer programs)
CD-R, DVD-R, DVD+R, BD-R: Write once storage, used for tertiary and off-line storage
CD-RW, DVD-RW, DVD+RW, DVD-RAM, BD-RE: Slow write, fast read storage, used for
tertiary and off-line storage
Ultra Density Optical or UDO is similar in capacity to BD-R or BD-RE and is slow write, fast
read storage used for tertiary and off-line storage.
Hard Disk
Hard disk is a magnetic disk on
which you can store computer
data. The term hard is used to
distinguish it from a soft, or
floppy, disk. Hard disks hold
more data and are faster than
floppy disks. A hard disk, for
example, can store anywhere
from 10 to more than 100
gigabytes, whereas most floppies
have a maximum storage
capacity of 1.4 megabytes.
A single hard disk usually
consists of several platters. Each
platter requires two read/write
heads, one for each side. All the
read/write heads are attached to a single access arm so that they cannot move independently. Each
platter has the same number of tracks, and a track location that cuts across all platters is called a
cylinder. For example, a typical 84 megabyte hard disk for a PC might have two platters (four sides)
and 1,053 cylinders. Nearly every desktop computer and server in use today contains one or more hard-
disk drives. Every mainframe and supercomputer is normally connected to hundreds of them.
Page- 81
Chapter Five Memory
Flash memory
Flash memory is a non-volatile computer storage chip that can be electrically erased and
reprogrammed. It was developed from EEPROM (electrically erasable programmable read-only
memory) and must be erased in fairly large blocks before these can be rewritten with new data. The
high density NAND type must also be programmed and read in (smaller) blocks, or pages, while the
NOR type allows a single machine word (byte) to be written and/or read independently.
Page- 82
Chapter Five Memory
Core memory has a destructive read operation, while MOS memory has a non destructive read
operation. This enhances the speed of MOS memory.
MOS memory s volatile, whereas core memory is non-volatile.
Core memory is available only in large blocks whereas MOS memory is available in wide
variety of sizes up to 64 K bits.
Core memory has limited range of cycle and access time and faster than core memory.
Cache Memory
Cache memory is a very high speed semiconductor memory which can speed up CPU. It acts as a buffer
between the CPU and main memory. It is used to hold those parts of data and program which are most
frequently used by CPU. The parts of data and programs are transferred from disk to cache memory by
operating system, from where CPU can access them.
Advantages
The advantages of cache memory are as follows:
Cache memory is faster than main memory.
It consumes less access time as compared to main memory.
It stores the program that can be executed within a short period of time.
It stores data for temporary use.
Disadvantages
The disadvantages of cache memory are as follows:
Cache memory has limited capacity.
It is very expensive.
Main Memory
Cache Memory
Processor
Virtual Memory
Virtual memory is a technique that allows the execution of processes which are not completely
available in memory. The main visible advantage of this scheme is that programs can be larger than
physical memory. Virtual memory is the separation of user logical memory from physical memory.
This separation allows an extremely large virtual memory to be provided for programmers when only a
smaller physical memory is available. Following are the situations, when entire program is not required
to be loaded fully in main memory.
User written error handling routines are used only when an error occured in the data or
computation.
Certain options and features of a program may be used rarely.
Many tables are assigned a fixed amount of address space even though only a small amount of
the table is actually used.
The ability to execute a program that is only partially in memory would counter many benefits.
Less number of I/O would be needed to load or swap each user program into memory.
A program would no longer be constrained by the amount of physical memory that is
available.
Each user program could take less physical memory more programs could be run the same
time, with a corresponding increase in CPU utilization and throughput.
Page- 84
Chapter Five Memory
Page- 85
Chapter Five Memory
Memory hierarchy
Decreasing cost/bit
Increasing capacity
Increasing access time
Decreasing frequency of access of the memory by the processor
Locality of reference
Page- 86
Chapter Five Memory
Memory Limitations
It turns out that memory cells have a restriction on how big of a number they can store. While
historically the number size limitations have varied from computer to computer, most current computers
use a memory cell whose contents are limited to a number between 0 and 255. It is not important what
the exact memory cell limit is; what is important is that you understand that large numbers do not fit in
a single cell. When a number is too large to fit in a single cell, it is stored in a number of consecutive
memory cells.
Exercise
1. Define Memory.
2. What are Characteristics of Storage?
3. What are the needs for Memory?
4. Describe about Memory Types
5. Define Volatile & Non Volatile, Destructive and Non-destructive Memory.
6. Define Hard Disk.
7. What are the features of a Hard Disk?
8. Comparison of Primary & Secondary Storage.
9. Write short note on Storage Hierarchy. Draw the block diagram of Memory Hierarchy.
10. Describe Cache Memory & Virtual Memory.
11. Draw Bits and Bytes Conversion Table.
12. Write the differences between RAM & ROM.
13. Write the limitations of Memory.
Page- 87