FOC Unit - 2
FOC Unit - 2
UNIT – 2
Varanasi - 221007
MEMORY UNIT
INTRODUCTION -
The computer‟s memory stores data, instructions required during the processing of
data, and output results. Storage may be required for a limited period of time, instantly,
or, for an extended period of time. Different types of memories, each having its own
unique features, are available for use in a computer. The cache memory, registers, and
RAM are fast memories and store the data and instructions temporarily during the
processing of data and instructions. The secondary memory like magnetic disks and
optical disks has large storage capacities and store the data and instructions
permanently, but are slow memory devices.
The computer memory stores different kinds of data like input data, output data,
intermediate results, etc., and the instructions. Binary digit or bit is the basic unit of
memory. A bit is a single binary digit, i.e., 0 or 1. A bit is the smallest unit of
representation of data in a computer.
Hierarchy Of Memory -
The memory is characterized on the basis of two key factors: capacity and access time.
1. Capacity is the amount of information (in bits) that a memory can store.
2. Access time is the time interval between the read/ write request and the availability
of data. The lesser the access time, the faster is the speed of memory. Ideally, we want
the memory with fastest speed and largest capacity. However, the cost of fast memory
is very high. The computer uses a hierarchy of memory that is organized in a manner to
enable the fastest speed and largest capacity of memory.
The Internal Memory and External Memory are the two broad categories of memory
used in the computer. The Internal Memory consists of the CPU registers, cache
memory and primary memory. The internal memory is used by the CPU to perform the
computing tasks. The External Memory is also called the secondary memory. The
secondary memory is used to store the large amount of data and the software.
Types Of Memory : -
Primary memory : -
Primary memory is the main memory of computer. It is a chip mounted on the
motherboard of computer. The instructions that must be performed at the time are
copied to primary memory because the CPU may directly access data from the primary
memory.
Primary memory is categorized into two main types: Random access memory
(RAM) and read only memory (ROM). RAM is used for the temporary storage of input
data, output data and intermediate results. The input data entered into the computer
using the input device, is stored in RAM for processing. After processing, the output
data is stored in RAM before being sent to the output device. Any intermediate results
generated during the processing of program are also stored in RAM. Unlike RAM, the
data once stored in ROM either cannot be changed or can only be changed using some
special operations. Therefore, ROM is used to store the data that does not require a
change.
The information that has to be currently processed is stored in RAM, which the CPU
may immediately access. It is a volatile memory that loses data when the electricity is
turned off.
1. SRAM
2. DRAM
SRAM :- Known as Static RAM. The word “static” refers that the memory retains its
contents as long as the power is supplied so that‟s why we can say this is volatile in
nature. SRAM does not need to be refreshed periodically . SRAM is faster but more
expensive than DRAM. It retains data in latch as long as the computer powered. It used
as Cache Memory in a computer system. As technically, SRAM uses more transistors
as compared to DRAM. It is faster compared to DRAM due to the latching arrangement,
and they use 6 transistors per data bit as compared to DRAM, which uses one transistor
per bit
DRAM :- It also contains data only when electricity is available. DRAM needs to
refreshed periodically due to this, this RAM works slower than SRAM. its retains
information in Capacitors for a short period (a few milliseconds) even though the
computer powered. The Data is Refreshed Periodically to maintain in it. The DRAM is
cheaper, but it can store much more information
EPROM (Erasable Programmable Read Only Memory):- This memory type retains
its contents until it exposed to intense ultraviolet light that clears its contents, making it
possible to re-program the memory.
Cache Memory –
Cache memory is a chip-based computer component that makes retrieving
data from the computer's memory more efficient. Cache memory is a high-speed
memory, which is small in size but faster than the main memory (RAM). The CPU can
access it more quickly than the primary memory. So, it is used to synchronize with high-
speed CPU and to improve its performance.
Virtual Memory –
Virtual memory is a memory management technique used by operating systems to
give the appearance of a large, continuous block of memory to applications, even if
the physical memory (RAM) is limited.
A virtual memory is what its name indicates- it is an illusion of a memory that is larger
than the real memory. We refer to the software component of virtual memory as a
virtual memory manager.
Secondary Memory : -
Secondary memory is a physical device for the permanent storage of programs and
data(Hard disk, Compact disc, Flash drive, etc.).
Secondary memory is a type of computer memory that is used to store data and
programs that can be accessed or retrieved even after the computer is turned off.
Secondary memory is computer memory that is non-volatile, persistent and not
immediately accessible by a computer or processor. It allows users to store data and
information that can be retrieved, transmitted, and used by apps and services quickly
and easily. Secondary storage is another name for secondary memory.
Types of Secondary Memory –
Magnetic Disk –
A magnetic disk is a types of data storage device that employs magnetization to write,
rewrite and access of data it is magnetically coated and retains data in the form of
track, spots and sector.
Data is organized on the disk in the form of tracks and sectors, where tracks are the
circular divisions of the disk. Tracks are further divided into sectors that contain blocks
of data. All read and write operations on the magnetic disk are performed on the
sectors. The floating heads require very precise control to read/write data due to the
proximity of the tracks.
Magnetic disk include – floppy disk, hard disk, etc.
Magnetic Tape –
Magnetic tapes are used in most organizations to save data files. Magnetic tapes
use a read-write mechanism. The read-write mechanism defines writing data on
or reading data from a magnetic tape. The tapes sequentially save the data
manner.
The amount of work that you do on your computer at home can easily be backed up
onto a CD-RW, CDROM, DVD or a memory stick. However, many organisations, such
as your school or an office, need to back up large volumes of data each day.
Optical Disk : -
Optical Disk is a storage medium that relies on laser technology to read and write data,
in shape, it is a flat circular disk which is made up of polycarbonate or a similar material
with a very shiny reflective layer on the surface. An optical disc, which may be used as
a portable and secondary storage device. To read and write to CDs and DVDs,
computers use a CD writer or DVD writer drive, and to read and write to Blu-ray discs,
they require a Blu-ray drive.
Type of Optical Disk :-
CD-R or compact disc recordable – It is not possible to remove data that has
been written onto it , it can only be read .
Digital Versatile Disc – DVD stands for Digital Versatile Disc. It resembles a CD,
but it has a larger storage capacity; up to 4.7 GB of data can be stored. To use a DVD
on a computer, a DVD-ROM drive is required. Video files, such as movies or video
recordings, are commonly saved on DVDs, which may be played with a DVD player.
There are three different kinds of DVDs available:
Hard Disk – Hard discs are storage devices designed to hold a lot of information.
Hard discs, often known as hard disc drives, are available in a variety of storage
capacities. (For example, 256 GB, 500 GB, 1 TB, and 2 TB). It is made up of platters,
which are a collection of discs. The dishes are stacked one on top of the other. They
have a magnetic coating on them. Each platter is made up of a number of invisible
circles, each of which has the same central track. Internal and external hard discs are
the two types of hard discs.
Floppy Disk – A floppy disc refers to a magnetic disc housed in a square plastic
container. It is primarily used to store information and then transfer it from one device
to another. Flash memory is secondary memory and so it is non- volatile which means
it persists the data even if there is not an electrical supply provided. This flash memory
works on the principle of EEPROM. EEPROM stands for Electrical Erasable
Programmable Read-Only Memory. ROM operation can only one time write and many
times read and we can‟t erase it. But Flash Memory can be erased multiple times and
update the data or program integrated into it. So it gives flexibility to the updation of
the program but ROM has no such type of feature.
Flash Memory : -
Flash memory is used in a wide range of devices. Flash is made up of transistors. Each
transistor is either carrying an electric charge or it isn't. When the transistor is charged,
it is read as a “1”; without a charge it's read as a “0.”
Solid-state Disk – A Solid-state Disk (SSD) is a data storage and retrieval device
that is non-volatile. It‟s faster, makes no noise (since it doesn‟t have any moving parts
like a hard drive), uses less electricity, and so on. If the price is right, it‟s a perfect
replacement for regular hard drives in laptops and desktops, and it‟s also ideal for
tablets, notebooks, and other devices that don‟t require a lot of storage.
SD Card – A Secure Digital Card (SD Card) is commonly used to store data in
portable devices such as cell phones and cameras. It comes in a variety of capacities,
including 1, 2, 4, 8, 16, 32, and 64 GB. You can access the data present in the SD
card by removing it from the device and inserting it into a computer using a card
reader. The data in the SD card is stored in memory chips (which are included in the
SD card), and there are no moving elements like there are on a hard disc.
Computer Languages : -
A group of instructions that are used to create computer programs are known as
computer languages. A formal computer language that includes a controlled
vocabulary and set of grammatical rules designed to instruct a computer how to
perform specific tasks. Programming languages are used to create programs to
control the behavior of a machine or to express algorithms. The description of a
programming language is usually split into two components: syntax (form) and
semantics (meaning).
Compiler -
The translation of a single statement of the source program into machine code is done
by a language processor and executes immediately before moving on to the next line
is called an interpreter. An interpreter is a type of software that translates and executes
a high-level programming language line by line, instruction by instruction, rather than
compiling the entire program into machine code at once. If there is an error in the
statement, the interpreter terminates its translating process at that statement and
displays an error message. The interpreter moves on to the next line for execution only
after the removal of the error.
For example, the architecture of intel 8085 and intel 8086 are different.
Difference Between Compiler, Interpreter and Assembler :-