0% found this document useful (0 votes)
42 views13 pages

FOC Unit - 2

Uploaded by

Darshit Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views13 pages

FOC Unit - 2

Uploaded by

Darshit Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

FUNDAMENTALS OF COMPUTER (BBC - 101)

UNIT – 2

Prepared By – Er. Pankaj Kumar, Asst. Professor

Ashoka Institute Of Technology & Management

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.

Types of Primary Memory

1. RAM (Random Access Memory) : -


The Word “RAM” stands for “random access memory” or may also refer to shortterm
memory. It‟s called “random” because you can read store data randomly at any time
and from any physical location. It is a temporal storage memory. RAM is volatile that
only retains all the data as long as the computer powered. It is the fastest type of
memory. RAM stores the currently processed data from the CPU and sends them to the
graphics unit.

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.

RAM is further classified into two parts

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

2. ROM (READ ONLY MEMORY) :-


ROM is the long-term internal memory. ROM is “Non-Volatile Memory” that retains data
without the flow of electricity. ROM is an essential chip with permanently written data or
programs. It is similar to the RAM that is accessed by the CPU. ROM comes with pre-
written by the computer manufacturer to hold the instructions for booting-up the
computer. This memory is mainly used by our computer when we just turn on our
computer. It contains BIOS of system.

There is generally Four broad type of ROM:-

MROM(Masked ROM):- Hard-wired devices with a pre-programmed collection of data


or instructions were the first ROMs. Masked ROMs are a type of low-cost ROM that
works in this way.

PROM (Programmable Read Only Memory):- It can be programmed only be done


once and read many. Unlike RAM, PROMs retain their contents without the flow of
electricity. PROM is also non volatile memory. The significant difference between a
ROM and a PROM is that a ROM comes with pre-written by the computer manufacturer
where as PROM manufactured as blank memory. PROM can be programmed by
PROM burner and by blowing internal fuses permanently.

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.

EEPROM (Electrically Erasable Programmable Read Only Memory):-

EEPROM can be burner or programmed and erased by first electrical waves in a


millisecond. A single byte of a data or the entire contents of device can be erased. To
write or erase this memory type, you need a device called a PROM burner.

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

Compact Disc – A Compact Disc or the CD is a type of secondary storage media


that is widely utilised. Its surface is covered in tracks and sectors. It is composed of
polycarbonate plastic and has a round form. CDs have a data storage capacity of up
to 700 MB. A CD is also known as a CD-ROM (Compact Disc Read-Only Memory)
because computers can read the data on it but not write new data onto it.

There are two types of CDs:

CD-R or compact disc recordable – It is not possible to remove data that has
been written onto it , it can only be read .

CD-RW or compact disc rewritable – It‟s a particular kind of CD that allows us


to wipe and rewrite data as many times as we desire, so It‟s also known as an
erasable CD.

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:

 DVD-ROM or Digital Versatile Disc Read-Only Memory – The


manufacturer writes the data on the DVD-ROM, and the users can only read it;
they cannot create new data on it. For example, a movie DVD has already been
written by the maker, and we can only watch it; we cannot add new data to it.
 DVD-R or Digital Versatile Disc Recordable – You can write data on a
DVD-R, but only once. It is not possible to remove data that has been written
onto it; it can only be read.
 DVD-RW or Digital Versatile Disc RW (Rewritable and Erasable) –
It‟s a particular kind of DVD that allows us to wipe and rewrite data as many
times as we desire. It‟s also known as an erasable DVD.

Blu-ray Disc – It resembles a CD/VD, but it can actually hold up to 25 GigaBytes


data or information. You‟ll need a Blu-ray reader if you wish to use a Blu-ray disc. The
name Blu-ray comes from the technology used to read the disc: „Blu‟ comes from a
blue-violet laser, and „ray‟ comes from an optical ray.

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

Flash Drive – A flash drive or pen drive is available in a variety of storage


capacities, including 1, 2, 4, 8, 16, 32, 64 GB, and 1 TB. Data is transferred and stored
using a flash drive. To use a flash drive, it must be plugged into a computer‟s USB
port. A flash drive is quite popular nowadays because it is simple to use and small in
size.

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 -

A compiler is a software program that translates code written in a high-level


programming language into machine language, making it understandable by a
computer's processor. This translation process involves converting the entire source
code of a program into an executable binary file before the program is run.
Example: C, C++, C#.
Interpreter : -

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.

Example:- Perl, Python and Matlab.


Assembler : -
An assembler is a tool that translates assembly language, a low-level programming language
that closely represents machine code, into executable machine code. Assembly language
provides a way for programmers to write instructions in a more understandable form, using
mnemonic codes and symbolic references instead of binary code. The output generated by the
assembler is the object code or machine code understandable by the computer. Assembler is
basically the 1st interface that is able to communicate humans with the machine. We need an
assembler to fill the gap between human and machine so that they can communicate with each
other. code written in assembly language is some sort of mnemonics(instructions) like ADD,
MUL, MUX, SUB, DIV, MOV and so on.

For example, the architecture of intel 8085 and intel 8086 are different.
Difference Between Compiler, Interpreter and Assembler :-

Feature Compiler Interpreter Assembler

Translates high-level Executes high-level


Converts assembly language
Function programming languages programming code directly,
code into machine code.
into machine code. line by line.

Processes assembly code into


Converts the entire
Translates and executes executable machine code,
Execution program before
code line by line on the fly. typically in a one-to-one
execution.
translation.

Execution is fast after


Slower than compiled code Fast, but writing code in
compilation because the
Speed because translation occurs assembly language is time-
program is directly in
at runtime. consuming and complex.
machine language.

Errors are found and must Syntax errors are detected


Errors are detected and
Error be corrected at runtime, during the assembly process,
must be corrected before
Detection making it easier to debug but logical errors can only be
execution.
specific lines of code. found during execution.

Used for large Used for low-level


Suitable for scripting, small
applications where programming tasks that
Usage programs, and rapid
execution speed is require direct hardware
development cycles.
critical. manipulation.

x86 assembly language, ARM


Examples C, C++, Rust Python, JavaScript, Ruby
assembly language

You might also like