You are on page 1of 42

STORAGE UNITS

LECTURE 3

1
Storage Unit/ memory
The data and instructions that are entered into the computer system through input units
have to be stored inside the computer before the actual processing starts. Similarly, the
results produced by the computer after processing must also be kept somewhere inside the
computer system before being passed on to the output units.
Moreover, the intermediate results produced by the computer must also be preserved
for ongoing processing. The Storage Unit or the primary / main storage of a computer
system is designed to do all these things. It provides space for
■ storing data and instructions,
■ space for intermediate results and also
■ space for the final results

2
Memory
The memory system is constructed as a hierarchy of layers, as shown

3
Registers

■ Register are used to quickly accept, store, and transfer data and instructions that are
being used immediately by the CPU
■ While we are working on the System, these Registers are used by the CPU for Performing
the Operations. When we give some Input to the System, the Input will be Stored into the
Registers and when the System will gives us the Results after Processing, the Result will
also be from the Registers. So that they are used by the CPU for Processing the Data
which is given by the User

4
Two Kinds of Registers
User registers Control registers
■ These store data and addresses ■ Registers that store information
– These are manipulated by your used by the control unit to
program instructions perform the fetch-execute cycle
■ Example: Add R1, R2, R3 – PC – the memory location of the
– R1  R2 + R3 next instruction
■ Computers will have between – IR –the current instruction being
– executed
One and hundreds of registers
– Status flags – information about
– Possibly divided into data and
the results of the last instruction
address registers
executed (was there an overflow,
■ Registers are usually the size of was the result positive, zero or
the computer’s word size negative?)
– 32 or 64 bits today, previously it
had been 8 or 16 bits
Registers Perform:-
1)    Fetch: The Fetch Operation is used for taking the instructions those are given by the user
and the Instructions those are stored into the Main Memory will be fetch by using Registers.
2)    Decode: The Decode Operation is used for interpreting the Instructions means the
Instructions are decoded means the CPU will find out which Operation is to be performed on
the Instructions.
3)    Execute: The Execute Operation is performed by the CPU. And Results those are produced
by the CPU are then Stored into the Memory and after that they are displayed on the user
Screen

6
Types of Registers
■ MAR stand for Memory Address Register
This register holds the memory addresses of data and instructions. This register is used to access
data and instructions from memory during the execution phase of an instruction. Suppose CPU
wants to store some data in the memory or to read the data from the memory. It places the address
of the-required memory location in the MAR.
■ Program Counter (PC)
It is a 16 bit special function register in the 8085 microprocessor. It keeps track of the the next
memory address of the instruction that is to be executed once the execution of the current
instruction is completed. In other words, it holds the address of the memory location of the next
instruction when the current instruction is executed by the microprocessor.
■ Accumulator Register
This Register is used for storing the Results those are produced by the System.

7
■ Memory Data Register (MDR)
MDR is the register of a computer's control unit that contains the data to be stored in the computer storage
(e.g. RAM), or the data after a fetch from the computer storage. It acts like a buffer and holds anything
that is copied from the memory ready for the processor to use it. MDR hold the information before it
goes to the decoder.
■ Memory Buffer Register
MBR stand for Memory Buffer Register. This register holds the contents of data or instruction read from,
or written in memory. It means that this register is used to store data/instruction coming from the memory
or going to the memory.
■ Data Register
A register used in microcomputers to temporarily store data being transmitted to or from a peripheral
device.

8
Cache Memory
■ Cache memory is a very high speed semiconductor
memory which can speed up the CPU. It acts as a
buffer between the CPU and the main memory.
■ It is used to hold those parts of data and
program which are most frequently used by the
CPU. The parts of data and programs are transferred
from the disk to cache memory by the operating
system, from where the CPU can access them.

9
Typically there are now 3 layers of cache on modern CPU cores:
■ L1 cache is very small and very tightly bound to the actual processing units of the CPU, it can
typically fulfil data requests within 3 CPU clock ticks. L1 cache tends to be around 4-32KB
depending on CPU architecture and is split between instruction and data caches.
■ L2 cache is generally larger but a bit slower and is generally tied to a CPU core. Recent
processors tend to have 512KB of cache per core and this cache has no distinction between
instruction and data caches, it is a unified cache. I believe the response time for in-cache data is
typically under 20 CPU "ticks"
■ L3 cache tends to be shared by all the cores present on the CPU and is much larger and slower
again, but it is still a lot faster than going to main memory. L3 cache tends to be of the order of
4-8MB these days.

The clock rate typically refers to the frequency at which the clock circuit of a processor can
generate pulses, which are used to synchronize the operations (such as adding two numbers or
transferring a value from one register to another

10
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.

11
FYO

■ Semiconductor definition
a substance, as silicon or germanium, with electrical conductivity intermediate between that
of an insulator and a conductor: a basic component of various kinds of electronic circuit
element (semiconductor device) used in communications, control, and detection technology
and in computers

12
Primary Memory (Main Memory)
Primary memory holds only those data and instructions on which the computer is
currently working. It has a limited capacity and data is lost when power is switched off. It
is generally made up of semiconductor device. These memories are not as fast as registers.
The data and instruction required to be processed resides in the main memory.
Characteristics of Main Memory
■ These are semiconductor memories. It is known as the main memory.
■ Usually volatile memory. Data is lost in case power is switched off.
■ It is the working memory of the computer.
■ Faster than secondary memories.
■ A computer cannot run without the primary memory.

It is divided into two subcategories RAM and ROM

13
Random Access Memory
■ RAM is used to store data and instructions temporarily . It is also called
"direct access memory". Random access means that each individual
byte in entire memory can be access directly.. A program must be loaded
into RAM before execution.
■ RAM is volatile memory. It means that its contents are lost when the
power is turned off. RAM is read/write memory. CPU can read data from
RAM and write data to RAM. It is used to store data and instruction
while it is being executed
■ The contents of RAM are necessary for the computer to process data. The
results of the processing are kept temporarily in RAM until they are
needed again or until they are saved onto the hard disk or other storage
device
■ RAM plays very important role in the processing speed of a computer. A
bigger RAM size provides larger amount of space for processing. So the
processing speed is increased

14
RAM VS SAM

■ RAM is considered “random access” because access to any memory cell can be done
directly if the intersection of row and column is well known. The opposite of RAM is
Serial Access Memory (SAM).
■ SAM stores data as a series of memory cells that can only be accessed sequentially. If
the data is not at the current location, each memory cell is checked until the needed data
is found. RAM data on the other hand can be accessed in any or

■ Lets look at the old audio cassettes used or video tapes used in VCRs in old days
Read Only Memory(ROM)
■ Unlike RAM, ROM is non-volatile and only permits the user to read data. The information is stored
permanently in such memories during manufacture.
■ A ROM stores such instructions that are required to start a computer. This operation is referred to as
bootstrap.
■ ROM chips are not only used in the computer but also in other electronic items like washing machine
and microwave oven

The advantages of ROM are as follows:


– Non-volatile in nature
– Cheaper than RAMs
– Easy to test
– More reliable than RAMs
– Static and do not require refreshing
– Contents are always known and can be verified
16
Types of ROM

■ MROM (Masked ROM): The very first ROMs were hard-wired devices that contained a pre-
programmed set of data or instructions. These kind of ROMs are known as masked ROMs, which
are inexpensive.
■ PROM (programmable read-only memory): a PROM is a memory chip on which you can store
a program. 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 for a duration of up to 40 minutes. Usually,
an EPROM eraser achieves this function.
■ EEPROM (electrically erasable programmable read-only memory): an EEPROM is a special
type of PROM that can be programmed and erased by exposing it to an electrical charge. It
can be erased and reprogrammed about ten thousand times. Both erasing and programming take
about 4 to 10 ms (millisecond). In EEPROM, any location can be selectively erased and
programmed. EEPROMs can be erased one byte at a time, rather than erasing the entire chip. Hence,
the process of reprogramming is flexible but slow.

17
Secondary Memory

■ This type of memory is also known as external memory or non-volatile. It is


slower than the 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. The contents of secondary memories are first
transferred to the main memory, and then the CPU can access it.
■ Common secondary storage devices are the hard disk and optical disks.

18
Characteristics of Secondary Memory

■ These are magnetic and optical memories. It is known as the backup memory.
■ It is a non-volatile memory.
■ Data is permanently stored even if power is switched off.
■ It is used for storage of data in a computer.
■ Computer may run without the secondary memory.
■ Slower than primary memories

19
Physical storage
It is very important to distinguish between memory, which refers to the circuitry that has a
direct link to the computer processor, and the storage, which refers to media such as disks
that are not directly linked to the processor.
Remember, a storage device is anything that is used to store computer data. Floppy disks,
hard disks, optical disks, CDs and magnetic tapes are all types of storage device.
Physical storage refers to how data are actually kept on the storage disk. The most
commonly used medium for storage is magnetic storage. The two most popular types of
magnetic storage media are hard disks and diskettes.
Magnetic tape provides a third type of magnetic storage, and optical disk is a new storage
medium. Following is a discussion of each.

20
Physical storage cont’d
■ Hard drive: The storage area within the computer itself, where megabytes of space are
available to store bits of information. Also known as a hard disk.

■ Diskette. A small, removable, flexible mylar plastic disk covered with a thin layer of a
magnetisable substance, onto which digital data can be recorded and stored. Also known
as a floppy disk.

21
Physical storage cont’d
■ Optical disk: A storage device that uses reflecting surfaces and laser technology to read
and write data on a disk. Also known as a laser disk.

22
There are three types of optical disks.
■ CD-ROM’s are the most popular type of optical storage. CD-ROM stands for Compact Disc
Read Only Memory. A computer CD-ROM disk, like its audio counterpart, contains data that has
been stamped on the disk surface as a series of pits. To read the data on a CD-ROM an optical
read head distinguishes the patterns of pits that represent bytes. CD-ROM disks provide
tremendous storage capacity. CD-ROMs usually come with data already written onto them. These
days most applications software is provided on CD-ROM.
■ It is now possible for computer users to write data to an optical disk. These are known as WORM
disks, which stands for ‘Write Once Read Many’. A single CD holds up to 680 megabytes,
equivalent to over 300,000 pages of text in character format, and these disks are quite durable.
These CDs are know as CD re-recordable (CD-R). There are other types of WORM disks,
although there is no standard for these.
■ There is a third type of optical disk which can be erased and use to rewrite new information.
These are sometimes known as EO (erasable optical) disks and CD-RW (CD rewritable).

23
CD vs DVD
■ CDs and DVDs are similar in composition and usage,
however DVDs offer more data storage capacity compared
to CDs. CDs are also commonly used for audio and
program files, while DVDs are used for video and program
files. DVDs allowed users to hold data up to 17.08 GB
■ DVDs (digital video disc or "digital versatile disc) are
similar to CDs and are also an optical disc storage device.
■ There are also various different types of DVDs including
DVD-ROM, DVD-R and DVD-RW, Blu-ray. When DVD
players were created, they had backward capability, which
allowed CDs to be read on them. However, many CD-
players could not read

24
Hard disk (hard drive)

■ The hard disk drive is the main, and usually largest, data storage hardware device in a
computer. The operating system, software titles, and most other files are stored in the
hard disk drive.
■ The hard drive is sometimes referred to as the "C drive" due to the fact that Microsoft
Windows, by default, designates the "C" drive letter to the primary partition on the
primary hard drive in a computer.
■ Unlike volatile storage like RAM, a hard drive keeps a hold of its data even when
powered off. This is why you can restart a computer, which powers down the HDD, but
still has access to all the data when it's back on.
Hard disk (hard drive) construction

■ The disk controller is the controller circuit which enables the CPU to communicate with


a hard disk, floppy disk or other kind of disk drive. Also it provides an interface
between the disk drive and the bus connecting it to the rest of the system.
■ The disk controller is circuitry on the computer's motherboard or on a plug-in circuit
board that controls the operation of your hard disk drive, floppy disk drives, or both.
■ When the computer wants to transfer data to or from the disk, it tells the disk controller.
The controller in turn sends electronic commands to the disk drive making the disk spin
and move its magnetic heads to the proper location on the disk.
■ The controller then transfers the data between the computer and the disk drive. The
computer's Operating System and BIOS issue commands directly to the controller to
BOOT the computer and to access files stored on the disks. 
Hard disk (hard drive) construction

■ A hard disk uses platters, round discs that are coated with a special media that is designed to
store data in magnetic patterns.
■ These discs rotate so that heads, electromagnetic read/write devices, can either record data
onto the platters or read what the platters already contain.
■ Each platter has tracks which is then broken down into sectors which is where pieces of
data is actually recorded.
■ The tracks are concentric circles around the central spindle on either side of each platter.
Tracks physically above each other on the platters are grouped together into cylinders
which are then further subdivided into sectors of 512 bytes apiece.
■ The sector is a disk’s smallest accessible unit.

28
Reading Data
■ When the computer wants to read data, the operating system works out where the data is
on the disk. To do this it first reads the FAT (File Allocation Table) at the beginning of
the partition.
■ This tells the operating system in which sector on which track to find the data. With this
information, the head can then read the requested data.
■ The disk controller controls the drive’s servo-motors and translates the fluctuating
voltages from the head into digital data for the CPU
■ More often than not, the next set of data to be read is sequentially located on the disk.
For this reason, hard drives contain between 256KB and 8MB of cache buffer in which
to store all the information in a sector or cylinder in case it’s needed. This is very
effective in speeding up both throughput and access times.
Reading Data
cont’d
■ A hard drive also requires servo information, which provides a continuous update on the
location of the heads.
■ This can be stored on a separate platter, or it can be intermingled with the actual data on
all the platters.
■ A separate servo platter is more expensive, but it speeds up access times, since the data
heads won’t need to waste any time sending servo information.
Formatting

■ The term "format" is understood to mean an operation in which a new disk medium is
fully prepared to store files
Disk formatting process.
■ Formatting a disk for use by an operating system and its applications typically involves
three different processes.
Low-level formatting

■ This is the closest to the hardware which marks the surfaces of the disks with markers
indicating the start of a recording block (typically today called sector markers) and other
information like block CRC to be used later, in normal operations, by the disk
controller to read or write data.
■ This is intended to be the permanent foundation of the disk, and is often completed at
the factory
High-level Disk Formatting

■ After a low-level formatting has been completed, users need to make high-level
formatting which makes it possible to save data and should be done on a partition.
■ It is the process of writing a file system, cluster size, partition label, and so on for a
newly created partition or volume.
■ And we can also say high-level formatting just clears data on hard disk, generates boot
information, initializes FAT, and labels logical bad sectors when the partition has
existed. This process does no harm to hard disk in general situations, so we suggest
taking such a format to fix a logically damaged partition or device
Reformatting.

■ Reformatting is a high-level formatting performed on a functioning disk drive to free


the medium of its contents. Reformatting is unique to each operating system because
what actually is done to existing data varies by OS.
■ The most important aspect of the process is that it frees disk space for use by other data
■ Reformatting often carries the implication that the operating system and all other
software will be reinstalled after the format is complete.
File Allocation Table(FAT)

■ The precise manner in which data is organized on a hard disk drive is determined by the
file system used. File systems are generally operating system dependent
■ The purpose of the File Allocation Table is to provide the mapping between clusters –
the basic unit of logical storage on a disk at the operating system level – and the
physical location of data in terms of cylinders, tracks and sectors – the form of
addressing used by the drive’s hardware controller
■ FAT was the primary file system used in all of Microsoft's consumer operating systems.
Even though FAT is still a supported option on Microsoft's newer operating systems,
NTFS(New Technology File System) is the primary file system used these days.
■ The FAT contains an entry for every file stored on the volume that contains the address
of the file’s starting cluster. Each cluster contains a pointer to the next cluster in the file,
or an end-of-file indicator at (0xFFFF), which indicates that this cluster is the end of the
file.
■ The diagram shows three files: File1.txt uses three clusters, File2.txt is a fragmented file
that requires three clusters and File3.txt fits in one cluster. In each case, the file
allocation table entry points to the first cluster of the file.
File systems (FAT8, FAT16, FAT32 and NTFS)

FAT8
■ FAT8, introduced in 1977, was the first true version of the FAT file system but had
limited use and only on some terminal-style computer systems of the time
FAT12 (12-bit File Allocation Table)
■ The first widely used version of the FAT file system, FAT12, was introduced in 1980,
right along with the first versions of DOS.
■ FAT12 supports drive sizes and file sizes of up to 16 MB using 4 KB clusters or 32 MB
using 8 KB ones, with a maximum number of 4,084 files on a single volume (when
using 8KB clusters).
■ File names under FAT12 cannot exceed the maximum character limit of 8 characters,
plus 3 for the extension
FAT16 (16-bit File Allocation Table)
■ Depending on the operating system and the cluster size used, the maximum drive size a FAT16-
formatted drive can be ranges from 2 GB up to 16 GB, the latter only in Windows NT 4 with
256 KB clusters.
■ The maximum number of files that can be held on a FAT16 volume is 65,536. Just like with
FAT12, file names were limited to 8+3 characters but was extended to 255 characters starting
with Windows 95.
■ The archive file attribute was introduced in FAT16.

FAT32 (32-bit File Allocation Table)


■ FAT32 supports basic drive sizes up to 2 TB or even as high as 16 TB with 64 KB clusters.
NTFS (New Technology File System)

■ NTFS (NT file system; sometimes New Technology File System) is the file system that
the Windows NT operating system uses for storing and retrieving files on a hard disk.
■ NTFS is the Windows NT equivalent of the Windows 95 file allocation table (FAT) and
the High Performance File System (HPTS). However, NTFS offers a number of
improvements over FAT and HPFS in terms of performance, extendibility, and security.
Notable features of NTFS include:
■ Use of a b-tree directory scheme to keep track of file clusters
■ Information about a file's clusters and other data is stored with each cluster, not just a
governing table (as FAT is)
■ Support for very large files (up to 2 to the 64th power or approximately 16 billion bytes
in size)
■ An access control list (ACL) that lets a server administrator control who can access
specific files
■ Integrated file compression.
■ Data security on both removable and fixed disks
THE END

42

You might also like