0% found this document useful (0 votes)
96 views20 pages

Unit 2 - Memory Computer Fundamental KKSU

Unit 2 discusses computer memory. There are three main types of memory: cache memory, primary memory (also called main memory), and secondary memory. Cache memory is very fast memory located between the CPU and RAM that stores frequently used data. Primary memory (RAM) is where active data and instructions are stored for processing. Secondary memory (hard disks, SSDs, etc.) is non-volatile storage for long-term storage.

Uploaded by

Siddhesh Kadu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
96 views20 pages

Unit 2 - Memory Computer Fundamental KKSU

Unit 2 discusses computer memory. There are three main types of memory: cache memory, primary memory (also called main memory), and secondary memory. Cache memory is very fast memory located between the CPU and RAM that stores frequently used data. Primary memory (RAM) is where active data and instructions are stored for processing. Secondary memory (hard disks, SSDs, etc.) is non-volatile storage for long-term storage.

Uploaded by

Siddhesh Kadu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 20

Unit 2 - Computer Memory

What is Memory:

A memory is just like a human brain. It is used to store data and instructions.
Computer memory is the storage space in the computer, where data is to be
processed and instructions required for processing are stored.

Memory is one of the basic functions of a computer, because without it, a


computer would not be able to function

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.

Example: , if the file has 64k size, then 64 * 1024 = 65536 memory
locations. The address of these varies from 0 to 65535.

A memory unit is the amount of data that the memory can hold. Besides, we
measure this storage capacity in terms of bytes. Moreover, there are different
units of memory as per the requirement.

The following table explains the main memory storage units −

S.No. Unit & Description

Bit (Binary Digit)


1 A binary digit is logical 0 and 1 representing a passive or an active state
of a component in an electric circuit.

Nibble
2
A group of 4 bits is called nibble.

Byte
3 A group of 8 bits is called byte. A byte is the smallest unit, which can
represent a data item or a character.

1
Word
A computer word, like a byte, is a group of fixed number of bits
processed as a unit, which varies from computer to computer but is
4 fixed for each computer.
The length of a computer word is called word-size or word length. It
may be as small as 8 bits or may be as long as 96 bits. A computer
stores the information in the form of computer words.

The following table lists some higher storage units −

S.No. Unit & Description

Kilobyte (KB)
1 1 KB = 1024 Bytes (2^10) bytes. Ex: Any small text file can take
2KB to 4 kb size

Megabyte (MB)
1 MB = 1024 KB or 1048576 (2^20) bytes. or 1024^2 = 1,048,576
2 bytes.
Ex: high-resolution JPEG image might range in size from 1-5
megabytes

GigaByte (GB)
3 1 GB = 1024 MB or 1024^3 bytes or 1073741824 (2^30) bytes.
Ex: a standard DVD drive can hold 4.7 GBs of data.

TeraByte (TB)
4 1 TB = 1024 GB or 2^40 bytes.
e.g., a typical internal HDD may hold 2 Terabytes of data

PetaByte (PB)
5
1 PB = 1024 TB or 2^50 bytes. used to measure the total data
stored in large networks or server farms. For example, Internet

2
Giants like Google and Facebook store more than over 100 PBs of
data on their data servers.

Exabyte: (EB)

6. which contains 2^60 bytes.The exabyte unit is so large that it


measure the storage of large cloud servers. also It can measure the
amount of data transfer over the internet for a certain time limit.

Zettabyte: (ZB)

7. which contains 2^70 bytes. It can measure a huge amount of data.


In fact, the whole data in the world is just a few zettabytes.

Yottabyte: (YB)

which contains 2^80 bytes.

8. It is a tremendously huge unit of measurement. Therefore, it has no


practical use.

Types of computer memory

3
In general, memory can be divided into primary and secondary memory;
moreover, there are numerous types of memory

4
Memory is primarily of three types −

• Cache Memory
• Primary Memory/Main Memory
• Secondary Memory

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

The data and instructions that are required during the processing of data
are brought from the secondary storage devices and stored in the RAM. For
processing, it is required that the data and instructions are accessed from the
RAM and stored in the registers. The time taken to move the data between
RAM and CPU registers is large. This affects the speed of processing of
computer, and results in decreasing the performance of CPU.

Cache memory is a very high speed memory placed in between RAM and CPU.
Cache memory increases the speed of processing.

During processing, CPU first checks cache for the required data. If data is not
found in cache, then it looks in the RAM for data.

5
Cache memory is very expensive, so it is smaller in size. Generally, computers
have cache memory of sizes 256 KB to 2 MB.

The CPU has a built-in Level 1 (L1) cache and Level2 (L2) cache, as shown in
figure In addition to the built-in L1 and L2 cache, some CPUs have a separate
cache chip on the motherboard.

Nowadays, high-end processor comes with built-in L3 cache, like in Intel core
i7. Typically, CPUs have cache size varying from 256KB (L1), 6 MB (L2), to
12MB (L3) cache.

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.

The disadvantages of cache memory are as follows −

• Cache memory has limited capacity.


• It is very expensive.

Register

Register 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.
Registers are not referenced by their address, but are directly accessed
and manipulated by the CPU during instruction execution
The data and instructions that require processing must be brought in the
registers of CPU before they can be processed. For example, if two numbers
are to be added, both numbers are brought in the registers, added and the
result is also placed in a register.

6
Some of the important registers in CPU are as follows—

- Accumulator (ACC) stores the result of arithmetic and logic operations.


- Instruction Register (IR) contains the current instruction most recently
fetched.
- Program Counter (PC) contains the address of next instruction to be
processed.
- Memory Address Register (MAR) contains the address of next location in the
memory to be accessed.
- Memory Buffer Register (MBR) temporarily stores data from memory or the
data to be sent to memory.
- Data Register (DR) stores the operands and any other data.

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.

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. Primary memory is categorized into
two main types-

-- Random Access Memory (RAM), and


-- Read Only Memory (ROM)

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.

7
• Faster than secondary memories.
• A computer cannot run without the primary memory.

RAM and ROM


--RAM is used to store data and instructions during the operation of computer.
The data and instructions that need to be operated upon by CPU are
first brought to RAM from the secondary storage devices like the hard
disk.

CPU interacts with RAM to get the data and instructions for processing.

--RAM loses information when the computer is powered off. It is a volatile


memory. When the power is turned on, again, all files that are required by the
CPU are loaded from the hard disk to RAM. Since RAM is a volatile memory,
any information that needs to be saved for a longer duration of time must not
be stored in RAM.

--RAM provides random access to the stored bytes, words, or larger data
units. This means that it requires same amount of time to access information
from RAM, irrespective of where it is located in it.

--RAM can be read from and written to with the same speed.

--The size of RAM is limited due to its high cost. The size of RAM is measured
in MB or GB.

--The performance of RAM is affected by—


Access speed (how quickly information can be retrieved). The speed of
RAM is expressed in nanoseconds.

Data transfer unit size (how much information can be retrieved in one
request).

--RAM affects the speed and power of a computer. More the RAM, the better it
is. Nowadays, computers generally have 512 MB to 4 GB of RAM.

--RAM is a microchip implemented using semiconductors.

--There are two categories of RAM, depending on the technology used to


construct a RAM—

8
(1) Dynamic RAM (DRAM), and
(2) Static RAM (SRAM).

DRAM

is the most common type of memory chip. DRAM is mostly used as main
memory since it is small and cheap.
- It uses transistors and capacitors. The transistors are arranged in a matrix
of rows and columns. The capacitor holds the bit of information 0 and 1. The
transistor and capacitor are paired to make a memory cell. The transistor acts
as a switch that lets the control circuitry on the memory chip read the
capacitor or change its state.

- DRAM must be refreshed continually to store information. For this, a


memory controller is used. The memory controller recharges all the capacitors
holding a 1 before they discharge. To do this, the memory controller reads the
memory and then writes it right back.

-DRAM gets its name from the refresh operation that it requires to store the
information; otherwise it will lose what it is holding. The refresh operation
occurs automatically thousands of times per second. DRAM is slow because
the refreshing takes time.

- Access speed of DRAM ranges from 50 to 150 ns.

Characteristics of Dynamic RAM


• Short data lifetime
• Needs to be refreshed continuously
• Slower as compared to SRAM
• Used as RAM
• Smaller in size
• Less expensive
• Less power consumption

SRAM

chip is usually used in cache memory due to its high speed.

9
- SRAM uses multiple transistors (four to six), for each memory cell. It does
not have a capacitor in each cell.

- A SRAM memory cell has more parts so it takes more space on a chip than
DRAM cell.
- It does not need constant refreshing and therefore is faster than DRAM.
- SRAM is more expensive than DRAM, and it takes up more space.
- It stores information as long as it is supplied with power.
- SRAM are easier to use and very fast. The access speed of SRAM ranges
from 2– 10 nanosecond.
Characteristic of Static RAM
• Long life
• No need to refresh
• Faster
• Used as cache memory
• Large size
• Expensive
• High power consumption

10
ROM:

ROM stands for Read Only Memory. The memory from which we can only
read but cannot write on it. This type of memory is non-volatile. 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.
The ROM memory chip stores the Basic Input Output System (BIOS). BIOS
provides the processor with the information required to boot the system. It
provides the system with the settings and resources that are available on the
system. BIOS is a permanent part of the computer. It does not load from disk
but instead is stored in a ROM memory chip. The program code in the BIOS
differs from ordinary software since it acts as an integral part of the
computer.
ROM chips are not only used in the computer but also in other electronic items
like washing machine and microwave oven.

Let us now discuss the various types of ROMs and their characteristics.

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)


PROM is read-only memory that can be modified only once by a user. The
user buys a blank PROM and enters the desired contents using a PROM
program. Inside the PROM chip, there are small fuses which are burnt open
during programming. It can be programmed only once and is not erasable.

11
EPROM (Erasable and Programmable Read Only Memory)
EPROM can be erased by exposing it to ultra-violet light for a duration of up to
40 minutes. Usually, an EPROM eraser achieves this function. During
programming, an electrical charge is trapped in an insulated gate region. The
charge is retained for more than 10 years because the charge has no leakage
path. For erasing this charge, ultra-violet light is passed through a quartz
crystal window (lid). This exposure to ultra-violet light dissipates the charge.
During normal use, the quartz lid is sealed with a sticker.

EEPROM (Electrically Erasable and Programmable Read Only Memory)


EEPROM is programmed and erased electrically. 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.
Flash Memory
Is a kind of semiconductor-based non-volatile, rewritable computer memory
that can be electrically erased and reprogrammed. It is a specific type of
EEPROM.
-- It combines the features of RAM and ROM. It is a random access
memory and its content can be stored in it at any time. However, like
ROM, the data is not lost when the machine is turned off or the electric
power is cut.

-- Flash memories are high-speed memories, durable, and have low-


energy consumption. Since flash memory has no moving part

-- flash memory is used in devices such as digital camera, mobile


phone, printer, laptop computer, and record and play back sound
devices, such as MP3 players.

Advantages of ROM
The advantages of ROM are as follows −

• Non-volatile in nature
• Cannot be accidentally changed
• Cheaper than RAMs
• Easy to test
• More reliable than RAMs

12
• Static and do not require refreshing
• Contents are always known and can be verified

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. For
example, disk, CD-ROM, DVD, etc.

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.

13
ACCESS TYPES OF STORAGE DEVICES
The information stored in storage devices can be accessed in two ways—
1. Sequential access
2. Direct access

Sequential Access Devices

Sequential access means that computer must run through the data in
sequence, starting from the beginning, in order to locate a particular piece of
data. Magnetic tape is an example of sequential access device. Let us suppose
that magnetic tape consists of 80 records. To access the 25th record, the
computer starts from first record, then reaches second, third etc. until it
reaches the 25th record. Sequential access devices are generally slow devices.
Magnetic tape is the common sequential access storage device.

i. Magnetic tape: It is a medium for magnetic recording, made of a thin,


magnetizable coating on a long, narrow strip of plastic film. Devices
that record and play audio and video using magnetic tape are tape
recorders and videotape recorders. A device that stores computer data
on magnetic tape is known as a tape drive.
It was a key technology in early computer development, allowing

14
unparalleled amounts of data to be mechanically created, stored for
long periods, and rapidly accessed.

The features of magnetic tape are—

-- Inexpensive storage device


-- Can store a large 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

Direct Access Devices

Direct access devices are the ones in which any piece of data can be retrieved
in a non-sequential manner by locating it using the data’s address. It accesses
the data directly, from a desired location. Magnetic disks and optical disks are
examples of direct access devices. There is no predefined order in which one
can read and write data from a direct access device. In a magnetic disk
consisting of 80 records, to access the 25th record, the computer can directly
access the 25th record, without going past the first 24 records. Based on
access, magnetic tapes are sequential access devices, and, magnetic disks,
optical disk and magneto-optical disks are direct access devices.

1. Magnetic disks: A magnetic disk is a storage device that uses a


magnetization process to write, rewrite and access data. It is covered with a
magnetic coating and stores data in the form of tracks, spots and sectors.
Hard disks, zip disks and floppy disks are common examples of magnetic
disks.

i. Floppy Disk: A floppy disk is a flexible disk with a magnetic coating on


it, and it is packaged inside a protective plastic envelope. These are
among the oldest portable storage devices that could store up to 1.44
MB of data, but now they are not used due to very little memory
storage.

15
ii. Hard Disk Drive (HDD): Hard disk drive comprises a series of circular
disks called platters arranged one over the other almost ½ inches apart
around a spindle. Disks are made of non-magnetic material like
aluminium alloy and coated with 10-20 nm magnetic material. The
standard diameter of these disks is 14 inches, and they rotate with
speeds varying from 4200 rpm (rotations per minute) for personal
computers to 15000 rpm for servers.
Data is stored by magnetizing or demagnetizing the magnetic coating. A
magnetic reader arm is used to read data from and write data to the
disks. A typical modern HDD has a capacity in terabytes (TB).

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.

16
2. Optical Disk: An optical disk is any computer disk that uses optical
storage techniques and technology to read and write data. It is a computer
storage disk that stores data digitally and uses laser beams to read and write
data.

An optical disk consists of a single spiral track that starts from the edge to the
centre 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. Optical disks are generally slower than hard disks.

i. CD Drive: CD stands for Compact Disk. CDs are circular disks that use
optical rays, usually lasers, to read and write data. They are very cheap
as you can get 700 MB of storage space for less than a dollar. CDs are
inserted in CD drives built into the CPU cabinet. They are portable as
you can eject the drive, remove the CD and carry it with you. There are
three types of CDs:

17
o CD-ROM (Compact Disk - Read Only Memory): The
manufacturer recorded the data on these CDs. Proprietary
Software, audio or video are released on CD-ROMs.

o CD-R (Compact Disk - Recordable): The user can write data


once on the CD-R. It cannot be deleted or modified later.

o CD-RW (Compact Disk - Rewritable): Data can repeatedly be


written and deleted on these optical disks.

ii. DVD Drive: DVD stands for digital video display. DVD is an optical
device that can store 15 times the data held by CDs. They are usually
used to store rich multimedia files that need high storage capacity.
DVDs also come in three varieties - read-only, recordable and
rewritable.

iii. Blu Ray Disk: Blu Ray Disk (BD) is an optical storage media that stores
high definition (HD) video and other multimedia files. BD uses a shorter
wavelength laser than CD/DVD, enabling the writing arm to focus more
tightly on the disk and pack in more data. BDs can store up to 128 GB
of data.

3. Memory Storage Devices: A memory device contains trillions of


interconnected memory cells that store data. When switched on or off, these
cells hold millions of transistors representing 1s and 0s in binary code,
allowing a computer to read and write information. It includes USB drives,
flash memory devices, SD and memory cards, which you'll recognize as the
storage medium used in digital cameras.

18
Memory vs. storage

The concept of memory and storage can be easily conflated as the same
concept; however, there are some distinct and important differences. Put
succinctly, memory is primary memory, while storage is secondary memory.
Memory refers to the location of short-term data, while storage refers to the
location of data stored on a long-term basis.

Memory is most often referred to as the primary storage on a computer, such


as RAM. Memory is also where information is processed. It enables users to
access data that is stored for a short time. The data is only stored for a short

19
time because primary memory is volatile, meaning it isn't retained when the
computer is turned off.

The term storage refers to secondary memory and is where data in a


computer is kept. An example of storage is a hard drive or a hard disk drive
(HDD). Storage is nonvolatile, meaning the information is still there after the
computer is turned off and then back on. A running program may be in a
computer's primary memory when in use -- for fast retrieval of information --
but when that program is closed, it resides in secondary memory or storage.

How much space is available in memory and storage differs as well. In


general, a computer will have more storage space than memory. For example,
a laptop may have 8 GB of RAM while having 250 GB of storage. The
difference in space is there because a computer will not need fast access to all
the information stored on it at once, so allocating approximately 8 GB of
space to run programs will suffice.

The terms memory and storage can be confusing because their usage today is
not always consistent. For example, RAM can be referred to as primary
storage -- and types of secondary storage can include flash memory. To avoid
confusion, it can be easier to talk about memory in terms of whether it is
volatile or nonvolatile -- and storage in terms of whether it is primary or
secondary.

20

You might also like