0% found this document useful (0 votes)
2 views15 pages

Mod 4-Computer Memory

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 15

COMPUTER MEMORY

I. INTRODUCTION
The computer’s memory stores data, instructions required during the processing of
data, and output results. Storage may be required for a limited period of time,
instantly, or, for an extended period of time. Different types of memories, each having
its own unique features, are available for use in a computer. The cache memory,
registers, and RAM are fast memories and store the data and instructions temporarily
during the processing of data and instructions. The secondary memory like magnetic
disks and optical disks has large storage capacities and store the data and instructions
permanently, but are slow memory devices.
The memories are organized in the computer in a manner to achieve high levels of
performance at the minimum cost. In this lecture, we discuss different types of
memories, their characteristics and their use in the computer.

II. MEMORY REPRESENTATION


The computer memory stores different kinds of data like input data, output data,
intermediate results, etc., and the instructions. Binary digit or bit is the basic unit of
memory. A bit is a single binary digit, i.e., 0 or 1. A bit is the smallest unit of
representation of data in a computer. However, the data is handled by the computer as
a combination of bits. A group of 8 bits form a byte.
One byte is the smallest unit of data that is handled by the computer.
One byte (8 bit) can store 28 = 256 different combinations of bits, and thus can be used
to represent 256 different symbols. In a byte, the different combinations of bits fall in
the range 00000000 to 11111111. A group of bytes can be further combined to form a
word. A word can be a group of 2, 4 or 8 bytes.
1 bit = 0 or 1
1 Byte (B) = 8 bits
1 Kilobyte (KB) = 210 = 1024 bytes
1 Megabyte (MB) = 220 = 1024KB
1 Gigabyte (GB) = 230 = 1024 MB = 1024 *1024 KB
1 Terabyte (TB) = 240= 1024 GB = 1024 * 1024 *1024 KB
III.CHARACTERISTICS OF MEMORIES
 Volatility
o Volatile {RAM}
o Non-volatile {ROM, Flash memory}
 Mutability
o Read/Write {RAM, HDD, SSD, RAM, Cache, Registers…}
o Read Only {Optical ROM (CD/DVD…), Semiconductor ROM}
 Accessibility
o Random Access {RAM, Cache}
o Direct Access {HDD, Optical Disks}
o Sequential Access {Magnetic Tapes}

IV. MEMORY HIERARCHY


The memory is characterized on the basis of two key factors: capacity and access time.
 Capacity is the amount of information (in bits) that a memory can store.
 Access time is the time interval between the read/ write request and the
availability of data. The lesser the access time, the faster is the speed of memory.
Ideally, we want the memory with fastest speed and largest capacity. However, the cost
of fast memory is very high. The computer uses a hierarchy of memory that is
organized in a manner to enable the fastest speed and largest capacity of memory.
The hierarchy of the different memory types is shown in Figure 4.2.

Figure 4.2 Memory hierarchy


The Internal Memory and External Memory are the two broad categories of memory
used in the computer. The Internal Memory consists of the CPU registers, cache
memory and primary memory. The internal memory is used by the CPU to perform the
computing tasks. The External Memory is also called the secondary memory. The
secondary memory is used to store the large amount of data and the software.
2
In general, referring to the computer memory usually means the internal memory.
 Internal Memory
The key features of internal memory are:
1. Limited storage capacity.
2. Temporary storage.
3. Fast access.
4. High cost.
Registers, cache memory, and primary memory constitute the internal memory. The
primary memory is further of two kinds: RAM and ROM. Registers are the fastest and
the most expensive among all the memory types. The registers are located inside the
CPU, and are directly accessible by the CPU. The speed of registers is between 1-2 ns
(nanosecond). The sum of the size of registers is about 200B. Cache memory is next in
the hierarchy and is placed between the CPU and the main memory. The speed of cache
is between 2-10 ns. The cache size varies between 32 KB to 4MB. Any program or data
that has to be executed must be brought into RAM from the secondary memory.
Primary memory is relatively slower than the cache memory. The speed of RAM is
around 60ns. The RAM size varies from 512KB to 64GB(and even more )
 Secondary Memory
The key features of secondary memory storage devices are:
1. Very high storage capacity.
2. Permanent storage (non-volatile), unless erased by user.
3. Relatively slower access.
4. Stores data and instructions that are not currently being used by CPU but may be
required later for processing.
5. Cheapest among all memory.
To get the fastest speed of memory with largest capacity and least cost, the fast memory
is located close to the processor. The secondary memory, which is not as fast, is used to
store information permanently, and is placed farthest from the processor.
With respect to CPU, the memory is organized as follows:
 Registers are placed inside the CPU (small capacity, high cost, very high speed)
 Cache memory is placed next in the hierarchy (inside and outside the CPU)
 Primary memory is placed next in the hierarchy
 Secondary memory is the farthest from CPU (large capacity, low cost, low speed)
The speed of memories is dependent on the kind of technology used for the memory.
The registers, cache memory and primary memory are semiconductor memories. They
do not have any moving parts and are fast memories. The secondary memory is
magnetic or optical memory has moving parts and has slow speed.

3
V. CPU REGISTERS
Registers are very high-speed storage areas located inside the CPU. After CPU gets the
data and instructions from the cache or RAM, the data and instructions are moved to the
registers for processing. Registers are manipulated directly by the control unit of CPU
during instruction execution. That is why registers are often referred to as the CPU’s
working memory. Since CPU uses registers for the processing of data, the number of
registers in a CPU and the size of each register affect the power and speed of a CPU.
The more the number of registers (ten to hundreds) and bigger the size of each register
(8 bits to 64 bits), the better it is.

VI. CACHE MEMORY


Cache memory is placed in between the CPU and the RAM. Cache memory is a fast
memory, faster than the RAM. When the CPU needs an instruction or data during
processing, it first looks in the cache. If the information is present in the cache, it is
called a cache hit, and the data or instruction is retrieved from the cache. If the
information is not present in cache, then it is called a cache miss and the information
is then retrieved from RAM.
Type of Cache memory
Cache memory improves the speed of the CPU, but it is expensive. Type of Cache
Memory is divided into different levels that are L1, L2, L3:
Level 1 (L1) cache or Primary Cache
L1 is the primary type cache memory. The Size of the L1 cache very small
comparison to others that is between 2KB to 64KB, it depends on computer
processor. It is an embedded register in the computer microprocessor (CPU).The
Instructions that are required by the CPU that are firstly searched in L1 Cache.
Example of registers are accumulator, address register, Program counter etc.
Level 2 (L2) cache or Secondary Cache
L2 is secondary type cache memory. The Size of the L2 cache is more capacious
than L1 that is between 256KB to 512KB. L2 cache is located on computer
microprocessor. After searching the Instructions in L1 Cache, if not found then it
searched into L2 cache by computer microprocessor. The high-speed system bus
interconnecting the cache to the microprocessor.
Level 3 (L3) cache or Main Memory
The L3 cache is larger in size but also slower in speed than L1 and L2, its size is
between 1MB to 8MB. In Multicore processors, each core may have separate L1
and L2, but all core share a common L3 cache. L3 cache double speed than the
RAM.

4
The advantages and disadvantages of cache memory are as follows:
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.

VII. PRIMARY MEMORY (Main Memory)


Primary memory is the main memory of computer. It is a chip mounted on the
motherboard of computer. Primary memory is categorized into two main types:
Random access memory (ram) and read only memory (rom). RAM is used for the
temporary storage of input data, output data and intermediate results. The input data
entered into the computer using the input device, is stored in RAM for processing.
After processing, the output data is stored in RAM before being sent to the output
device. Any intermediate results generated during the processing of program are also
stored in RAM. Unlike RAM, the data once stored in ROM either cannot be changed
or can only be changed using some special operations. Therefore, ROM is used to
store the data that does not require a change.
Types of Primary Memory
1. RAM (Random Access Memory)
The Word “RAM” stands for “random access memory” or may also refer to short-
term memory. It’s called “random” because you can read store data randomly at any
time and from any physical location. It is a temporal storage memory. RAM is
volatile that only retains all the data as long as the computer powered. It is the
fastest type of memory. RAM stores the currently processed data from the CPU and
sends them to the graphics unit.

5
There are generally two broad subcategories of RAM:
• Static RAM (SRAM): Static RAM is the form of RAM and made with flip-flops
and used for primary storage are volatile. It retains data in latch as long as the
computer powered. SRAM is more expensive and consumes more power than
DRAM. It used as Cache Memory in a computer system. As technically, SRAM
uses more transistors as compared to DRAM. It is faster compared to DRAM due
to the latching arrangement, and they use 6 transistors per data bit as compared to
DRAM, which uses one transistor per bit.
• Dynamic Random Access Memory (DRAM): It is another form of RAM used as
Main Memory, its retains information in Capacitors for a short period (a few
milliseconds) even though the computer powered. The Data is Refreshed
Periodically to maintain in it. The DRAM is cheaper, but it can store much more
information. Moreover, it is also slower and consumes less power than SRAM.
2. ROM (Read Only Memory)
ROM is the long-term internal memory. ROM is “Non-Volatile Memory” that retains
data without the flow of electricity. ROM is an essential chip with permanently
written data or programs. It is similar to the RAM that is accessed by the CPU. ROM
comes with pre-written by the computer manufacturer to hold the instructions for
booting-up the computer.
There is generally three broad type of ROM:
• PROM (Programmable Read Only Memory): PROM stands for programmable
ROM. It can be programmed only be done once and read many. Unlike RAM,
PROMs retain their contents without the flow of electricity. PROM is also
nonvolatile memory. The significant difference between a ROM and a PROM is
that a ROM comes with pre-written by the computer manufacturer whereas
PROM manufactured as blank memory. PROM can be programmed by PROM
burner and by blowing internal fuses permanently.
• EPROM (Erasable Programmable Read Only Memory): EPROM is
pronounced ee-prom. This memory type retains its contents until it exposed to
intense ultraviolet light that clears its contents, making it possible to reprogram
the memory.
• EEPROM (Electrically Erasable Programmable Read Only Memory):
EEPROM can be burned (programmed) and erased by first electrical waves in a
millisecond. A single byte of a data or the entire contents of device can be erased.
To write or erase this memory type, you need a device called a PROM burner.

6
SECONDARY MEMORY

I. Secondary Memory
In the previous lecture, we saw that RAM is expensive and has a limited storage
capacity. Since it is a volatile memory, it cannot retain information after the computer
is powered off. Thus, in addition to primary memory, an auxiliary or secondary
memory is required by a computer. The secondary memory is also called the storage
device of computer. In this lecture, the terms secondary memory and storage device
are used interchangeably. In comparison to the primary memory, the secondary
memory stores much larger amounts of data and information (for example, an entire
software program) for extended periods of time. The data and instructions stored in
secondary memory must be fetched into RAM before processing is done by CPU.
Magnetic tape drives, magnetic disk drives, optical disk drives are the different types
of storage devices.

II. MAGNETIC TAPE


Magnetic tape is a plastic tape with magnetic coating (Figure 5.1). It is a storage
medium on a large open reel or in a smaller cartridge or cassette (like a music
cassette). Magnetic tapes are cheaper storage media. They are durable, can be written,
erased, and re-written. Magnetic tapes are sequential access devices, which mean that
the tape needs to rewind or move forward to the location where the requested data is
positioned in the magnetic tape. Due to their sequential nature, magnetic tapes are not
suitable for data files that need to be revised or updated often.
They are generally used to store back-up data that is not frequently used or to transfer
data from one system to other.

Figure 5.1 A 10.5-inch reel of 9-track tape


The working of magnetic tape is explained as follows:
Magnetic tape is divided horizontally into tracks (7 or 9) and vertically into frames
(Figure 5.2). A frame stores one byte of data, and a track in a frame stores one bit.
Data is stored in successive frames as a string with one data (byte) per frame.

Figure 5.2 A portion of magnetic tape

Data is recorded on tape in the form of blocks, where a block consists of a group of
data also called as records. Each block is read continually. There is an Inter-Record
Gap (IRG) between two blocks that provides time for the tape to be stopped and
started between records (Figure 5.3).

Figure 5.3 Blocking of data in a magnetic tape


Magnetic tape is mounted on a magnetic tape drive for access. The basic magnetic
tape drive mechanism consists of the supply reel, take-up reel, and the read/write
head assembly. The magnetic tape moves on tape drive from the supply reel to take-
up reel, with its magnetic coated side passing over the read/write head.
Tapes are categorized based on their width - ¼ inch, ½ inch, etc.
The storage capacity of the tape varies greatly. A 10–inch diameter reel of tape
which is 2400 feet long can store up to 180 million characters.

The features of magnetic tape are:


Inexpensive storage device
Can store a amount of data
Easy to carry or transport
Not suitable for random access data
Slow access device
Needs dust prevention, as dust can harm the tape
Suitable for back-up storage or archiving
III. MAGNETIC DISK
Magnetic disk is a direct access secondary storage device. It is a thin plastic or
metallic circular plate coated with magnetic oxide and encased in a protective cover.
Data is stored on magnetic disks as magnetized spots. The presence of a magnetic spot
represents the bit 1 and its absence represents the bit 0.

The working of magnetic disk is explained as follows:


The surface of disk is divided into concentric circles known as tracks. The
outermost track is numbered 0 and the innermost track is the last track. Tracks are
further divided into sectors. A sector is a pie slice that cuts across all tracks. The
data on disk is stored in sector. Sector is the smallest unit that can be read or written
on a disk. A disk has eight or more sectors per track (Figure 5.4).

Figure 5.4 Tracks and sectors of a disk


Magnetic disk is inserted into a magnetic disk drive for access. The drive consists of
a read/write head that is attached to a disk arm, which moves the head. The disk arm
can move inward and outward on the disk.
During reading or writing to disk, the motor of disk drive moves the disk at high
speed (60–150 times/sec.)

Accessing data on the disk requires the following:


o The read/write head is positioned to the desired track where the data is to be read
from or written to. The time taken to move the read/write head to the desired
track is called the seek time.
o Once the read/write head is at the right track, then the head waits for right sector
to come under it (disk is moving at high speed). The time taken for desired sector
of the track to come under read/write head is called the latency time.
o Once the read/write head is positioned at the right track and sector, the data has to
be written to disk or read from disk. The rate at which data is written to disk or
read from disk is called data transfer rate.
o The sum of seek time, latency time and time for data transfer is the access time of
the disk.
The storage capacity of disk drive is measured in gigabytes (GB).
Large disk storage is created by stacking together multiple disks. A set of same tracks
on all disks forms a cylinder. Each disk has its own read/write head which work in
coordination.
A disk can also have tracks and sectors on both sides. Such a disk is called double-
sided disk.

The features of magnetic disk are:


Cheap storage device
Can store a large amount of data
Easy to carry or transport
Suitable for frequently read/write data
Fast access device
More reliable storage device
To be prevented from dust, as the read/write head flies over the disk. Any dust
particle in between can corrupt the disk.

Examples to Magnetic Disk


1. Floppy Disk
Floppy disk (FD) is a single disk made of Mylar plastic and enclosed in square
plastic jacket (Figure 5.5).
Floppy Disk Drive (FDD) is the disk drive for floppy disk.
The floppy disk is inserted into the floppy disk drive to read or write data to it.
Floppy disk has a write-protect slide tab that prevents a user from writing to it.
A floppy disk may be single-sided or double-sided disk, i.e., data can be read and
written on one and both sides of floppy disk, respectively.

Figure 5.5 Floppy disk


They are portable. They can be removed from the disk drive, carried or stored
separately.
They are small and inexpensive.
Floppy disks are slower to access than hard disk. They have less storage capacity
and are less expensive than hard disk.
They come in two basic sizes—5-¼ inch and 3-½ inch.
The 5-¼ inch disk came around 1987. It can store 360 KB to 1.2 MB of data.
The 3-½ inch disk has capacity of 400 KB to 1.44 MB.
 Since 2010, no motherboard is still manufactured with the support of floppy disk
drive.

2. Hard Disk
A hard disk (HD) consists of one or more platters divided into concentric tracks and
sectors. It is mounted on a central spindle, like a stack. It can be read by a read/write
head that pivots across the rotating disks. The data is stored on the platters covered
with magnetic coating (Figure 5.6).

Figure 5.6 Parts of hard disk


Hard disk is a fixed disk. The disk is not removable from the drive, unlike floppy disk.
The hard disk and Hard Disk Drive (HDD) is a single unit.
Hard disk can store much more data than floppy disk. The data in hard disk are
packed more closely and they have multiple platters, with data being stored on both
sides of each platter. Large capacity hard disks may have 12 or more platters.
Unlike floppy disk, the read/write head of hard disk does not touch the disk during
accessing.
Hard disk can spin at the speed of up to 10,000 revolutions per minute and have an
access time of 9-14 ms. It stores 512 bytes per sector but the number of sectors are
more per track (54 or more) than floppy disk.
Nowadays, hard disks are available that can store up to 4 TB of data. Generally, PCs
come with 250 GB hard disk.
Hard disk is the key secondary storage device of computer. The operating system is
stored on the hard disk. The performance of computer like speed of computer boot up,
5
loading of programs to primary memory, loading of large files like images, video,
audio
etc., is also dependent on the hard disk.
Nowadays, portable external hard disk drive is available which can be attached to the
USB drive of the computer. They come in the storage capacities of 250 GB to 3 TB.

IV. OPTICAL DISK


Optical disk is a flat and circular disk which is coated with reflective plastic material
that can be altered by laser light. Optical disk does not use magnetism. The bits 1 and
0 are stored as spots that are relatively bright and light, respectively.
An optical disk consists of a single spiral track that starts from the edge to the center
of disk. Due to its spiral shape, it can access large amount of data sequentially, for
example music and video. The random access on optical disk is slower than that of
magnetic disk, due to its spiral shape.
The tracks on optical disk are further divided into sectors which are of same length.
Thus, the sectors near the center of disk wrap around the disk longer than the sectors
on the edges of disk. Reading the disk thus requires spinning the disk faster when
reading near the center and slower when reading near the edge of disk. Optical disks
are generally slower than hard disks. Figure 5.7 shows the tracks and sectors in a
magnetic disk and optical disk.

Figure 5.7 Sectors and track in magnetic disk and optical disk
Optical disks can store large amount of data, up to 25GB, in a small space.
Commonly used optical disks store 600–700 MB of data.
The access time for an optical disk ranges from 100 to 200 ms.
Examples to Optical Disk
1. CD-ROM
Originally, Compact Disk (CD) was a popular medium for storing music. Now, it is
used in computers to store data and is called Compact Disk-Read Only Memory (CD-
ROM).
 CD-ROM (Figure 5.8) is an optical disk that can only be read and not written on.
CD-ROM is written on by the manufacturer of the CD-ROM using the laser light.
A CD-ROM drive reads data from the compact disk. Data is stored as pits
(depressions) and lands (flat area) on CD-ROM disk. When the laser light is focused
on the disk, the pits scatter the light (interpreted as 0) and the lands reflect the light to
a sensor (interpreted as 1).
As CD-ROM is read only, no changes can be made into the data contained in it.
Since there is no head touching the disk, but a laser light, CD-ROM does not get
worn out easily.
The storage density of CD-ROM is very high and cost is low as compared to hard
disk.
Access time of CD-ROM is less. CD-ROM drives can read data at 150Kbps. They
come in multiples of this speed like—2x, 4x, 52x, 75x, etc.

Figure 5.8 CD-ROM


2. DVD-ROM
Digital Video Disk-Read Only Memory (DVD-ROM) is an optical storage device
used to store digital video or computer data (Figure 5.9).
DVDs look like CDs, in shape and physical size.

Figure 5.9 DVDs


It improves on CD technology.
It is a high-density medium with increased track and bit density.
DVD-ROM uses both sides of the disk and special data compression technologies.
The tracks for storing data are extremely small.
7
A full-length movie can be stored on a single disk.
Each side of DVD-ROM can store 4.7 GB of data, so a single DVD can store 9.4 GB
of data.

3. Blu-ray Disc
Blu-ray Disc designed to supersede DVD. Blu-ray Disc is 120 mm in diameter and
1.2 mm thick, the same size as DVD and CD. It's developed by Blu-ray Disc
Association and the read mechanism of Blu-ray Disc is 405 nm diode laser. The
Speed of Blu-ray Disc is 36 Mbit/s. The capacity of Blu-ray Disc is ~ 25 GB.

V.Flash Memory
Flash memory is a non-volatile memory chip used for storage and for transfering data
between a personal computer (PC) and digital devices. It has the ability to be
electronically reprogrammed and erased. It is often found in USB flash drives, MP3
players, digital cameras and solid-state drives.
Flash memory is a type of electronically erasable programmable read only memory
(EEPROM), but may also be a standalone memory storage device such as a USB
drives. EEPROM is a type of data memory device using an electronic device to erase
or write digital data. Flash memory is a distinct type of EEPROM, which is
programmed and erased in large blocks.

VI.Solid State Drives (SSD)


An SSD is a type of nonvolatile storage media that stores persistent data on solid-
state flash memory. Two key components make up an SSD: a flash
controller and NAND flash memory chips. The architectural configuration of the
SSD controller is optimized to deliver high read and write performance for both
sequential and random data requests. SSDs are sometimes referred to as flash drives
or solid-state disks.
8
VII.USING THE COMPUTER MEMORY
The computer starts using the memory from the moment the computer is switched on,
till the time it is switched off.
The list of steps that the computer performs from the time it is switched on are:
1. Turn the computer on.
2. The computer loads data from ROM. It makes sure that all the major
components of the computer are functioning properly.
3. The computer loads the BIOS from ROM. The BIOS provides the most basic
information about storage devices, boot sequence, security, plug and play
capability and other items.
4. The computer loads the OS from the hard drive into the system’s RAM.
CPU has immediate access to the OS as the critical parts of the OS are
maintained in RAM as long as the computer is on. This enhances the
performance and functionality of the overall system.
5. Now the system is ready for use.
6. When you load or open an application it is loaded in the RAM. Since the
CPU looks for information in the RAM, any data and instructions that are
required for processing (read, write or update) is brought into RAM. To
conserve RAM usage, many applications load only the essential parts of the
program initially and then load other pieces as needed. Any files that are
opened for use in that application are also loaded into RAM.
7. The CPU requests the data it needs from RAM, processes it and writes new
data back to RAM in a continuous cycle. The shuffling of data between the
CPU and RAM happens millions of times every second.
8. When you save a file and close the application, the file is written to the
secondary memory as specified by you. The application and any
accompanying files usually get deleted from RAM to make space for new
data.
9. If the files are not saved to a storage device before being closed, they are
lost.
10.Sometimes, when you write a program and the power goes off, your program
is lost if you have not saved it. This is because your program was in the RAM
and was not saved on the secondary memory; the content of the RAM gets
erased when the power is switched off.

You might also like