0% found this document useful (0 votes)
19 views

Ch-4-Computer Memory

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Ch-4-Computer Memory

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Computer Fundamentals and Programming in C

Reema Thareja, Assistant Professor,


Institute of Information Technology and
Management

© Oxford University Press 2012. All rights reserved.


CHAPTER 4

COMPUTER MEMORY

© Oxford University Press 2012. All rights reserved.


INTRODUCTION
● Computer memory is an internal storage area used to store data and programs

● It can be divided into two groups: primary memory and secondary memory.

While the main memory holds instructions and data when a program is executing,

the auxiliary or the secondary memory holds data and programs not currently in
use and provides long-term storage.

The primary memory is volatile, so the data can be retained in it, only when the

power is on. Moreover, it is very expensive and therefore limited in capacity.

© Oxford University Press 2012. All rights reserved.


INTRODUCTION (Contd.)

●On the contrary, the secondary memory stores data or instructions


permanently, even when the power is turned off. It is cheap and can store
large volumes of data. Moreover, data stored in auxiliary memory is highly
portable, as the users can easily move it from one computer to the other.

●The only drawback of secondary memory is that data can be accessed


from it at a very slow speed as and when compared with the data access
speed of primary memory.

© Oxford University Press 2012. All rights reserved.


MEMORY HIERARCHY
In contemporary usage, memory usually refers to random-access
CPU Registers memory, typically DRAM (Dynamic-RAM) but memory can also

Level 1 Cache
refer to other forms of data storage.
In computer’s terminology, the term storage refers to storage
Level 2 Cache
devices that are not directly accessible by the CPU (secondary or
Level 3 Cache tertiary storage).
Examples of secondary storage include hard disk drives, optical
Primary
Memory disc drives, and other devices that are slower than RAM but are
Hard Disk
used to store data permanently.

Optical Disk These days, computers use different types of memory which can
be organized in a hierarchy around the CPU, as a trade-off between
Magnetic performance and cost.
Tape
The memory at a higher level in the storage hierarchy has less
capacity to store data, is more expensive and is fastest to access.
© Oxford University Press 2012. All rights reserved.
PROCESSOR REGISTERS
Processor registers are located inside the processor and are therefore directly accessed by
the CPU. Each register stores a word of data (which is either 32 or 64 bits). CPU instructions
instruct the arithmetic and logic unit to perform various calculations or other operations on
this data. Registers are the fastest of all forms of computer data storage.

CACHE MEMORY
Cache memory is an intermediate form of storage between ultra-fast registers and the RAM.
The CPU uses cache memory to store instructions and data that are repeatedly required to
execute programs thereby improving the overall system speed and increase the
performance of the computer.
Cache memory is basically a portion of memory made of high-speed static RAM (SRAM)
instead of the slower and cheaper dynamic RAM (DRAM) which is used for main memory.

© Oxford University Press 2012. All rights reserved.


TYPES OF RAMS
SRAM (Static RAM) and DRAM (Dynamic RAM): This is a type of RAM that holds
data without an external refresh as long as it is powered. This is in striking
contrast with the DRAM which must be refreshed multiple times in a second to
hold its data contents.
SRAM is made of D flip flops in which the memory cells flip-flop between 0 and 1
without the use of capacitors. Therefore, there is need for an external refresh
process to be carried out.
SRAM occupies more space and is expensive as compared to DRAM. While each
transistor on a DRAM chip can store one bit of information, the SRAM chip, on the
other hand requires four to six transistors to store a bit.
However, SRAM is faster and more reliable than DRAM. SRAM is often used as
cache memory. Static RAM chips are also used in cars, household appliances and
handheld electronic devices.

© Oxford University Press 2012. All rights reserved.


READ ONLY MEMORY (ROM)
ROM refers to computer memory chips containing permanent or semi-permanent
data. Unlike RAM, ROM is non-volatile.
Most computers contain a small amount of ROM that stores critical programs
such as BIOS which is used to boot the computer when it is turned on.

Rewritable ROM chips include PROMs, EPROMs and EEPROMs.


Programmable read-only memory (PROM) can be written to or programmed using
a special device called a PROM programmer. The PROM programmer uses high
voltages to permanently destroy or create internal links within the chip. The
working of a PROM is similar to that of CD-ROM recorder which enables the users
to "burn" programs onto blanks once.

© Oxford University Press 2012. All rights reserved.


READ ONLY MEMORY (ROM) contd.

Erasable programmable read-only memory (EPROM) can be erased and


re-programmed by exposing the chip to strong ultraviolet light for 10 minutes or
longer and then rewritten with a process that again needs higher than usual
voltage applied. The EPROM is much more useful than PROM and can be
compared with a reusable CD-RW.

Electrically erasable programmable read-only memory (EEPROM) is based on a


similar semiconductor structure to EPROM, but allows its entire or selected
contents to be electrically erased, then rewritten electrically, so that they need
not be removed from the computer (or camera, MP3 player, etc.). The process
of writing an EEPROM is also known as flashing.

© Oxford University Press 2012. All rights reserved.


READ ONLY MEMORY (ROM) contd.

The flash memory is also a type of EEPROM in which the contents can be erased
under software control. This is the most flexible type of ROM, and is widely used
to store BIOS programs. It is primarily used in memory cards, USB flash drives,
MP3 players, PDAs (personal digital assistants), laptop computers, digital audio
players, digital cameras, and mobile phones. The EEPROM blurs the difference
between what "read-only" really means. However, the EEPROM is rewritten only
once a year or so, compared to real read-write memory (RAM) where rewriting is
done often many times per second.

© Oxford University Press 2012. All rights reserved.


HARD DISK
A hard disk is a set of disks stacked together like
phonograph records, that has data recorded
electromagnetically in concentric circles also known as
tracks.
A single hard disk includes several platters (or disks)
that are covered with a magnetic recording medium.

Each platter requires two read/write heads, one for each side.
Data is actually stored on the surface of a platter in sectors and tracks. While
tracks are concentric circles, sectors on the other hand are pie-shaped wedges on
a track.

© Oxford University Press 2012. All rights reserved.


HARD DISK (Contd.)

A track is divided into a number of segments (also called sectors) that can
store a fixed number of bytes- for example, 256 or 512.
The performance of a hard disk depends on its access time where access time
is the time required to read or write on the disk. Access time is actually a
combination of three components:
● Seek time
● Rotational delay
● Transfer time

© Oxford University Press 2012. All rights reserved.


HARD DISK contd.

Seek time: The time taken to position the R/W head over the appropriate cylinder
(usually around 8 msec on average). Seek time varies depending on the position
of the access arm when the R/W command is received. Seek time will be maximum
when the access arm is positioned over the innermost track while the data that
has to be accessed is stored on the outermost track. Similarly, seek time will be
zero if the access arm is already positioned over the desired track. On an average,
the seek time varies from 10-100 milli-seconds.

Rotational delay: The time taken to bring the target sector to rotate under the R/W
head. Assuming that the hard disk has 7,200 rotations per minute, or 120
rotations per second, a single rotation is done in approximately 8 msec. The
average rotational delay is around 4 msec.

© Oxford University Press 2012. All rights reserved.


HARD DISK (contd.)

Transfer time: The time to transfer data or the time taken to read/write to a
disk is called transfer rate.

Thus, the overall time required to access data = seek time + rotational delay
+ transfer time.

To access data from the hard disk, a disk address has to be specified. The disk
address consist of Sector number, Track number and Surface number (when
data is recorded on both the sides of the disk)
Storage capacity of a disk with multiple recording surfaces can be calculated
as:
Storage capacity = no. of recording surfaces * no. of tracks per surface * no. of sectors
per track * no. of bytes per sector

© Oxford University Press 2012. All rights reserved.


HARD DISK (contd.)

Advantages:
● Enable random access of data
● Can be often used as a shared device in a multi-user environment
● Preferred both for online and offline storage of data
● Can store large amounts of data
● The cost of data storage is very low.

Disadvantages:
● Must be stored in a dust free environment
● Magnetic disks are larger in size and heavy in weight

© Oxford University Press 2012. All rights reserved.


OPTICAL DRIVE
Optical storage refers to storing data on an optically readable medium by making
marks in a pattern that can be read using a beam of laser light precisely focused
on a spinning disc.

An optical storage media consists of a flat, round, portable metal disc, which is
usually 0.75 inches in diameter and less than one-twentieth of an inch thick.
The disc is coated with a thin metal or plastic or other material that is highly
reflective.

© Oxford University Press 2012. All rights reserved.


The optical disk stores information in the form of pits and lands. The pits are
the tiny reflective bumps created with laser beam and lands are flat areas
separating the pits. While a land reflects the laser light and is read as binary
digit 1, a pit on the other hand absorbs the light and is read as binary digit 0.
Like magnetic disk, the optical disk also has tracks which are divided into
sectors but shape of these sectors is different than that of magnetic disk.

© Oxford University Press 2012. All rights reserved.


Compact Disc Read-Only-Memory (CD-ROM)
It is a type of optical disc that uses laser technology to read and write data on the
disc. The information stored on CDROM becomes permanent and cannot be
altered. This means that the stored information can only be read for processing.

Digital Video Disk or Digital Versatile Disc (DVD-ROM)


It is an extremely high capacity optical disc with storage capacity from 4.7 GB to
17 GB. DVDs are widely used to store large databases, movies, music, complex
software etc.
Most of the DVD-ROMs are double sided discs as they can store data on both the
sides of the disc.

© Oxford University Press 2012. All rights reserved.


DVDROMs have a multi-layer storage technique and smaller sized pits and
tracks. When data is recorded on a DVD, the laser starts on the inside of the
disk and moves outward. The laser beam has a smaller wavelength and can be
focused on two different layers on the disk.

Compact Disc Rewritable (CD-RW) is an erasable optical disk. The user can
write and over-write data on the CD-RW disc multiple times.

© Oxford University Press 2012. All rights reserved.


USB FLASH DRIVES
USB flash drives are removable, rewritable, and physically much smaller drives
weighing even less than 30 g.
A flash drive consists of a small printed circuit board carrying the circuit elements
and a USB connector, insulated electrically and protected inside a plastic, metal,
or rubberized case which can be carried in a pocket or on a key chain.

Advantages
● Data stored on flash drives is impervious to scratches and dust
● Mechanically very robust
● Easily portable
● Have higher data capacity than any other removable media.
● Compared to hard drives, flash drives use little power
● Flash drives are small and light-weight devices
● Flash drives can be used without installing device drivers.
© Oxford University Press 2012. All rights reserved.
FLASH DRIVES contd.

Disadvantages
Can sustain only a limited number of write and erase cycles before the drive fails.

Most flash drives do not have a write-protect mechanism


Flash drives are very small devices that can easily be misplaced, left behind, or

otherwise lost.
The cost per unit of storage in a flash drive is higher than that of hard disks

Uses of flash drives


● Personal data transport
● System administration
● Booting operating systems
● Music storage and marketing
● Brand and product promotion
● Backup
© Oxford University Press 2012. All rights reserved.
FLOPPY DISK

Floppy disks are data storage devices that consist of a thin magnetic storage
medium encased in a square plastic shell lined with fabric.
The mechanism of a floppy disk has two motors. One motor in the drive rotates
the diskette at a regulated speed, the second motor moves the magnetic RW head,
along the surface of the disk. To read/write data on the disk media, there must be
a physical contact between the read–write head and the disk media.

© Oxford University Press 2012. All rights reserved.


Reading/Writing data on the disk
To write data on the floppy disk, current is passed through a coil in the head.
The magnetic field of the coil magnetizes spots on the disk as it rotates. The
change in magnetization encodes the digital data.
Similarly, to read data from the floppy disk, a small amount of current is
induced in the head coil to detect the magnetization on the disk. The floppy
drive controller separates the data from the stream of pulses coming from the
floppy drive, decodes the data, tests for errors, and sends the data on to the
host computer system.

© Oxford University Press 2012. All rights reserved.


MAGNETIC TAPE
Magnetic tape is a thin strip of plastic coated with magnetic recording material.
These storage devices are used as sequential access secondary storage device.

Storage capacity of magnetic tape = data recording density * length of the tape

Data is recorded in the form of tiny non-magnetized and magnetized spots, where
the presence of a spot represents 1 and its absence represents 0. This means that
data is stored in the form of zeroes and ones.

© Oxford University Press 2012. All rights reserved.


Advantages of Magnetic Tape:
Compact in size, light in weight and can store large amounts of data.
Easily portable
Economical
Consume less power
Can be used for long term data storage and retrieval

Disadvantages of Magnetic Tape:


Data stored on the tape can be accessed only sequentially
Data on a tape is accessed at a very slow speed
A special hw is required to read the data stored on tapes
Susceptible to degradation due to heat, humidity, dust, mishandling,
electromagnetic surfaces and ordinary wear

© Oxford University Press 2012. All rights reserved.


MEMORY CARD
A small device that can store a wide range of files. They are easily portable from
one place to another
It implements flash memory to add/delete files multiple times.
Most of these cards have constantly powered nonvolatile memory
Memory cards have no moving parts therefore they are unlikely to suffer from
mechanical difficulties.
Since newer memory cards are smaller, require less power, have higher storage
capacity, are completely silent, less prone to mechanical failures, allow immediate
access to data and are portable among a greater number of devices, they are
being widely used in the production of an increasing number of small, lightweight
and low-power devices.
Although memory cards are far better than hard disks, they still could not replace
them because a memory card is quite expensive.

© Oxford University Press 2012. All rights reserved.

You might also like