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

Computer memory

Computer memory is essential for storing and retrieving data, classified into internal and external memory, primary and secondary memory, and volatile and non-volatile memory. RAM (volatile) and ROM (non-volatile) are key types, with RAM serving as the main memory for active data and instructions, while ROM retains critical startup information. Cache memory enhances processing speed by acting as a faster intermediary between the CPU and RAM, and virtual memory allows systems to handle larger programs than the physical RAM can accommodate by swapping data in and out of memory.

Uploaded by

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

Computer memory

Computer memory is essential for storing and retrieving data, classified into internal and external memory, primary and secondary memory, and volatile and non-volatile memory. RAM (volatile) and ROM (non-volatile) are key types, with RAM serving as the main memory for active data and instructions, while ROM retains critical startup information. Cache memory enhances processing speed by acting as a faster intermediary between the CPU and RAM, and virtual memory allows systems to handle larger programs than the physical RAM can accommodate by swapping data in and out of memory.

Uploaded by

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

Computer Memory

The CPU Contains the basic instructions needed to operate the computer, but
it can’t store large sets of data permanently. The CPU does contain registers,
but these are small areas that can hold only a few bytes at a time. In addition
to registers, the CPU needs to have millions of bytes of randomly accessed
space where it can quickly read or write programs and data while they are
being used. This area is called memory.

What is a Computer Memory?


Answer: A computer memory is nothing but a power or capability to store data
and then reproduce or delivery or retrieve the stored data when necessary.
Example: Hard disk, RAM, ROM, CD, DVD, Pen drive etc.

Classification of Computer Memory


Computer memories can be classified according to following criteria:
1. According to the distance from the CPU.
2. According to importance.
3. According to permanence of storage or volatility.
Computer Memory
(According to the distance from CPU)

Internal Memory External Memory

Ex. RAM, ROM Ex. HD, CD, DVD, Pen drive etc.

Computer Memory
(According to the importance)

Primary Memory Secondary Memory


Or Or
Main Memory Auxiliary Memory
Ex. RAM, ROM Ex. HD, CD, DVD, Pen drive etc.
Computer Memory
( According to permanence of storage and volatility

Volatile Memory Non-volatile Memory


Ex. RAM Ex. ROM, HD, CD, DVD, Pen drive etc.
Computer Memory
( According to permanence of storage and volatility

Volatile Memory Non-volatile Memory


Ex. RAM Ex. ROM, HD, CD, DVD, Pen drive etc.

Define the Volatile and Non-volatile Memory:


Some memory chips always retain the data they hold, even when the
computer is turned off. This type of memory is called nonvolatile memory
(RAM).

Other chips in fact, most of the memory in a microcomputer- lose their


contents when the computer’s power is shut off. These chips called as volatile
memory. For example-ROM, HD, CD,DVD, Pen drive etc.
ROM (Read Only Memory) :

Read-only memory (ROM) is a type of non-volatile memory used


in computers and other electronic devices, during the normal use, the data in
these chips is only read and used, not changed, so the memory is called read-
only memory(ROM).

ROM is a primary memory used to store some embedded data and instruction
for Input-Output operation and other important operations. Unlike RAM, in a
ROM data can only be read but not write. Although in programmable ROM
data can write but it is a complex operation. Processor can direct access in
ROM and executes its internal instructions.

One important reason a computer needs ROM is that it must know that to do
when the power is first turned on. Among other things, ROM contains a set of
start-up instructions, which ensures that the rest of memory is functioning
properly, checks for hardware devices, and checks for an operating system on
the computer’s disk drives.
BIOS: The full meaning of BIOS is Basic Input Output System. A BIOS is a
MROM. The instructions of a BIOS are executed by the processor and a
POST (Power On Self Test) procedure is taken place for checking whether the
input-output devices are in working order or not.

Types of ROM

MROM: This ROM maintains the characteristics of ROM. It is non-


programmable (non-writeable) ROM.
PROM: It is a one-time writeable (Programmable) but many-times readable
ROM.
EPROM: It is a many-times writeable (Programmable) and many-times
readable ROM. The programming is done using UV light.
EEPROM: It is a many-times writeable (Programmable) and many-times
readable ROM. The programming is done using electricity.
RAM (Random Access Memory):

Memory that can be instantly changed is called read-write memory or random


access memory(RAM). The purpose of RAM is to hold programs and data
while they are in use, Physically, RAM consists of some chips on a small
circuit board. This type of memory is referred to as random-access memory
because of its ability to access each byte of data directly.

There are two types of RAM:


1. Dynamic Random Access Memory(DRAM)
2. Static Random Access Memory(SRAM)

Define the DRAM and SRAM:


Dynamic RAM gets its name from the fact that it must be refreshed frequently.
DRAM chips must be refreshed many times each second, or they will lose
their contents. On the other hand, SRAM does not need to be refreshed as
often and can hold its contents longer than DRAM. SRAM is also considerably
faster than DRAM. Most DRAM technologies support access times of around
60 nanoseconds. Faster SRAM chips support access times of around 10
nanoseconds. Consequently, SRAM is more expensive than DRAM and is not
used as frequently in PCs.
Note: A nanosecond is one- billionth of a second.
RAM Architecture I3 I2 I1 I0

Input Buffer E
R/W { 0=write
1=read

O0

O1
A5
O2
A4
6 to 64
A3
A2
Decoder
: :
CS { CS=1
Chip Select
for read/write
A1
: :
A0
O62
O63

Output Buffer E

O3 O2 O1 O0
Fig. Internal organization of a 64x4 RAM.
Question: Draw the internal organization of a 64x4 RAM and discuss data
read write operation in it.

Answer:
Write Operation: To write any data in a location of memory, at first the input
buffer is enabled (E) by CS=1 and R/W=0. Then, the address of the specified
location is determined by decoding the address lines (A0 to A5). Finally, a
group of 4 bits data is sent through input data lines (I0 to I3) and written in the
specified memory location via input buffer.

Read Operation: To read any data in a location of memory, at first the output
buffer is enabled (E) by CS=1 and R/W=1. Then, the address of the specified
location is determined by decoding the address lines (A0 to A5). Finally, a
group of 4 bits data is sent from the specified memory location to the output
data lines (O0 to O3) via output buffer.

 Memory Access Time: Unlike a Sequential Access Memory (SAM, such as


HD, CD, DVD etc.), memory access time (data read/write operation time,
generally a read operation) in a RAM is not location dependent. That is,
equal for all location.
Memory Cell => Flip-Flop (FF) => store 1 bit data (for SRAM)
Memory Cell => Charged Capacitor => store 1 bit data (for DRAM)
Memory Word => Register => group of FFs or Charged Capacitor
(may be 4, 8, 16, 32, or 64 bits long)
Flip Flop (FFs) : Cross Coupled NAND gate or NOR gate.

Question: Write the difference between SRAM and DRAM.

Answer:

SRAM DRAM
1. Faster RAM. 1. Slower RAM.
2. Made by Flip-Flops. 2. Made by charged capacitors.
3. Data density is low. 3. Data density is high.
4. No refreshing is needed. 4. Refreshing is needed.
5. Expensive. 5. Less expensive.
Question: Why RAM is called a Main memory?

Answer: RAM is a very much essential memory. During the execution of a


program, there is a close interaction in between RAM and processor. In the
execution of program, processor takes data and instruction from RAM. After
processing, RAM stores information. For this important role, RAM is called a
main memory.

Question: Why RAM is called a Volatile memory?

Answer: RAM holds its contents (data) as long as power or electricity is


available. When the power is interrupted or shut down, the contents of RAM
are lost. This is why, RAM is called a volatile memory. On the other hand, non-
volatile memory does not loss its contents when the electricity is turned off.
Classification-4: According to Manufacturing Substance or Read-Write
Mechanism:

Computer Memory

Semiconductor Memory Magnetic Memory Optical Memory

RAM ROM Magnetic Tape Magnetic Disk CD DVD

Hard Disk
DRAM SRAM
MROM PROM EPROM EEPROM

RDRAM SDRAM
Cache Memory
Question: What is a cache memory? Why is it important in a computer system?
Answer:
Definition of cache memory
A cache memory is a physical memory like RAM. It is smaller in capacity but
faster in operation than RAM. It is positioned in between processor and RAM.
There are two types of cache memory, such as L1 type cache memory and L2
type cache memory. L1 type cache memory is built-in into the processor and
L2 type cache memory is built-in outside the processor but inside the
motherboard.
Importance of cache memory in a computer system
There is an unbelievable speed mismatch in between the operation of a
processor and RAM. Processor is the fastest unit in a computer system, but
RAM is not as fast as processor. So, there is always a speed mismatch
problem in between them when they work together. To overcome this speed
mismatch problem, a faster memory is used in between processor and RAM.
This faster memory is called cache memory.
Question: Discuss the function of a cache memory.
Answer:
Function of a Cache Memory

When processor needs any data/instruction, at first it goes to search that in


cache memory. If the required data/instruction is available in cache memory,
processor then takes it from cache. Otherwise, it goes to RAM to bring that
required data/instruction. Processor brings that required data/instruction from
RAM and a block of next data/instruction is stored in cache memory from RAM
for future use.

Cache Memory RAM


Processor

Figure: Blok diagram of the function of a cache memory.


Virtual Memory
Question: What is virtual memory? How is it implemented in a computer
system?
Answer:
Definition of virtual memory
A virtual memory is not a physical memory like RAM or cache. It is simply a
technique adopted by an operating system when the size of a program is
larger than the size of RAM.
Program=8GB
Page-1
Swap in
RAM=5GB Page-2
Frame-1 Page-3
Frame-2 Page-4
Frame-3 Page-5
Frame-4 Page-6
Frame-5 Swap out Page-7
Page-8

Figure: Block diagram of implementation of virtual memory technique.


Implementation of Virtual Memory
The virtual memory technique is taken place in between RAM and hard disk.
In this technique, the entire program is not loaded into the RAM at a time.
Instead of that, the program is divided into some equal size which are called
pages. The RAM is also divided into some equal size which are called
frames. Here the page size is equal to frame size. A page is loaded into a
frame which is called swap in. When a page is no more essential, it is back to
its previous location which is called swap out, This swap in and swap out
technique is called swapping. It is also called demand paging technique.
Using demand paging technique virtual memory is implemented.
Implementation of Virtual Memory
The virtual memory technique is taken place in between RAM and hard disk.
In this technique, the entire program is not loaded into the RAM at a time.
Instead of that, the program is divided into some equal size which are called
pages. The RAM is also divided into some equal size which are called
frames. Here the page size is equal to frame size. A page is loaded into a
frame which is called swap in. When a page is no more essential, it is back to
its previous location which is called swap out, This swap in and swap out
technique is called swapping. It is also called demand paging technique.
Using demand paging technique virtual memory is implemented.
Magnetic Memory - Hard Disk (HD)
Question: Draw the internal organization of a hard disk drive and discuss data
read-write operation in it.
Answer:

Read-Write Head Spindle/Shaft Sector


Disk/Plate/Platter
Read-Write
Access Arm

Track

Figure: Internal block diagram of a hard disk drive.


Discussion of Block Diagram:
A hard disk is made by aluminium like hard and light metal. The metal is cut in
circular disk which are called plates or platters. A set of 9 or 10 or more plates
are packed together to form a disk pack by maintaining a fine gap (narrow
space) between two plates in the pack. Both surfaces of a plate are used to
store data. To store data on a plate, the plate is coated with magnetic oxide
(Fe2O3) in concentric circular tracks. Data are stored on these tracks. Tracks
are divided into some equal length region and each region is called a sector.
For each disk surface there is a read-write access arm. The access arm
contains a read-write head for each track. The plates are attached with a
central spindle or shaft. In the hard disk drive, a motor is used to rotate the
plates by rotating the spindle.

Data Read-Write Operation:


To read/write any data in a hard disk, an operating system needs to know the
actual address or location of the data in the disk. An address can be
associated with plate number, surface number, track number and sector
number. The locations of all data (files) in a hard disk are written in a file with a
table called File Allocation Table (FAT).
To read any data in a hard disk, at first the operating system read the FAT to
know the address of the data. Then the motor of the hard disk drive is rotated
(about 3600 r.p.m.-7200 r.p.m) and the desired sector is positioned under the
read-write head of the desired track. The read-write head is made of coil
(wires). When the disk is rotated at a high speed, a voltage is dropped in the
coil with the variation of magnetic flux in the magnetic form of data. Finally,
the read voltages are sent to the data bus through read-write access arm.

To write any data in a hard disk, the same processes which are followed in a
read operation are also followed here. But, in the case of a write operation, the
conversion of data are taken place from electrical form to magnetic form. The
data are sent through data bus and written from read-write head to desired
sector.
 During a read/write operation, the read-write head does not contact to the
surface of a disk. There is a very fine gap (narrow space) in between a read-
write head and the surface of a disk. A hair, or a dust particle or even a smoke
particle is sufficient to contact the head to the surface of a disk. As a result, a
head crash is taken place and data of the surface are lost.
 Data capacity of all tracks in a sector are equal. That is, the inner most
track contains highest density of and outer most track contains lowest density
of data.
Capacity of a Hard Disk:

Capacity of a hard disk is calculated by the following formula:

Plates/Hard Disk x Surfaces/Plate x Tracks/Surface x Sectors/Track x Bytes/Sector

Example:

Calculate the capacity of a hard disk with 10 plates, 20 tracks/surface, 5


sectors/track, and 512 bytes/sector.

Solution:

We know the formula to calculate the capacity of a hard disk is:

Plates/Hard Disk x Surfaces/Plate x Tracks/Surface x Sectors/Track x Bytes/Sector

So,

The capacity of the hard disk = 10x2x20x5x512 bytes


= 1000 KB

You might also like