Chapter 3 Computer Memory and Processors
Chapter 3 Computer Memory and Processors
Fundamentals and
Programming in C
2nd Edition
Reema Thareja
1
© Oxford University Press 2016. All rights reserved.
CHAPTER 3
OMPUTER MEMORY AND PROCESSORS
• 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.
• 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.
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.
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.
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.
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.
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
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 2016. 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
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
External hard disks with a storage capacity of 2 TB are very common these days (1 TB = 1000
GB).
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.
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.
Although a Blu-ray disk has the same size as that of a CD or a DVD, it can store much more data than a DVD.
A single-sided Blu-ray disk can store 25 GB of data and a dual-layer disk can store 50 GB of data.
The advantage of using a blue laser with a shorter wavelength of 405 nm than the red
laser (650 nm) is that it allows it to focus the laser spot with even greater precision. This means that data
can be
packed more tightly and therefore stored in less space.
A Blu-ray disk player is backwards compatible with CDs and DVDs and can therefore play a CD or a DVD
despite the differences between the types of laser used. However, the Blu-ray disks will not play on CD and
DVD
players, because those players lack the blue-violet laser required to read the disks.
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.
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
Disk Array
Automated Tape Library
CD-ROM Jukebox
• Once the memory receives an address from the BIU, it places the
contents at that address on the data bus, which is then transferred
to the IR of the processor through the MBR
• Faster the clock ticks, more is the number of operations that can
be performed