Unit-1
Introduction to Computer
Definition:
Computer System is an electronic data processing device which does the
following:
Accept and store an input data.
Process the data input.
And output the processed data in required format
Functionalities of a computer
Any digital computer carries out five functions in gross terms:
• Takes data as input.
• Stores the data/instructions in its memory and can use them when required.
• Process the data and convert it into useful information.
• Output the information.
Control all the above four steps
Block diagram of Computer:
The data is entered through input devices such as the keyboard, mouse, etc. This
set of instruction is processed by the CPU after getting the input by the user, and
then the computer system produces the output. The computer can show the output
with the help of output devices to the user, such as monitor, printer, etc.
CPU (Central Processing Unit)
Storage Unit
ALU(Arithmetic Logic Unit)
Control Unit
Central Processing Unit (CPU)
The computer system is nothing without the Central processing Unit so, it is also
known as the brain or heat of computer. The CPU is an electronic hardware device
which can perform different types of operations such as arithmetic and logical
operation.
The CPU contains two parts: the arithmetic logic unit and control unit. We have
discussed briefly the arithmetic unit, logical unit, and control unit which are given
below:
Control Unit
The control unit (CU) controls all the activities or operations which are performed
inside the computer system. It receives instructions or information directly from
the main memory of the computer.
When the control unit receives an instruction set or information, it converts the
instruction set to control signals then; these signals are sent to the central processor
for further processing. The control unit understands which operation to execute,
accurately, and in which order.
Arithmetic and Logical Unit
The arithmetic and logical unit is the combinational digital electronic circuit that
can perform arithmetic operations on integer binary [Link] presents the
arithmetic and logical operation. The outputs of ALU will change asynchronously
in response to the input. The basic arithmetic and bitwise logic functions are
supported by ALU.
Storage Unit
The information or set of guidelines are stored in the storage unit of the computer
system. The storage unit provides the space to store the data or instruction of
processed data. The information or data is saved or hold in computer memory or
storage device. The data storage is the core function and fundamental of the
computer components.
Components of Computer System
The hardware and software exist on the computer. The information which is stored
through the device is known as computer software. The hardware components of
the computer system are related to electronic and mechanical parts, and the
software component is related to data and computer programs. Many elements are
connected to the main circuit board of the computer system called a
“motherboard.”
Processor.
Main Memory.
Secondary Memory.
Input Devices.
Output Devices.
These are mainly five components of the computer system. The computer
hardware, computer software, and liveware exist in the element of the computer
system.
Processor
The processor is an electric circuitry within the computer system. The Central
processing unit is the central processor or main processor of the computer system.
The processor carries out the instructions of the computer program with the help of
basic arithmetic and logic, input/output operations.
Main Memory
The Random Access Memory is the main memory of the computer system, which
is known as RAM. The main memory can store the operating system software,
application software, and other information. The Ram is one of the fastest
memory, and it allows the data to be readable and writeable.
Secondary memory
We can store the data and programs on a long-term basis in the secondary
memory. The hard disks and the optical disks are the common secondary devices.
It is slow and cheap memory as compare to primary memory. This memory is not
connected to the processor directly.
It has a large capacity to store the data. The hard disk has a capacity of 500
gigabytes. The data and programs on the hard disk are organized into files, and the
file is the collection of data on the disk. The secondary storage is direct access by
the CPU; that’s why it is different from the primary storage.
The hard disk is about 100 times the capacity of the main memory. The main
difference between primary and secondary storage is speed and capacity. There are
several large blocks of data which are copied from the hard disk into the main
memory.
Input Devices
The user provides the set of instruction or information to the computer system with
the help of input devices such as the keyboard, mouse, scanner, etc. The data
representation to the computer system is in the form of binary language after that
the processor processes the converted data. The input unit implements the data
which is instructed by the user to the system.
We can enter the data from the outside world into the primary storage as the input
through input devices. The input devices are the medium of communication
between the outside world and the computer system.
There are some important features of input devices which are given below:
1. The input devices receive or accept the data or instruction from the user, who exist
in the outside world.
2. These devices convert the data or instruction into the machine-readable form for
further processing.
3. The input device performs like the connection between the outside world and our
computer system.
4. The keyboard and mouse are common examples of input devices.
5. When the whole procedure is finished, we get the desired output from the output
devices such as monitor, printer, etc.
Output Devices
The output devices produce or generate the desired result according to our input,
such as a printer, monitor, etc. These devices convert the data into a human-
readable form from binary code.
The computer system is linked or connected to the outside world with the help of
output devices. The primary examples of output devices are a printer, projector,
etc.
These devices have various features which are given below:
1. These devices receive or accept the data in the binary form.
2. The output devices convert the binary code into the human-readable form.
3. These devices produce the converted result and show to the user.
Advantages:
Following list demonstrates the advantages of Computers in today's arena.
HIGH SPEED
• Computer is a very fast device.
• It is capable of performing addition of very big data.
• The computer has units of speed in microsecond,nanosecond and even the
picosecond.
• It can perform millions of calculations in a few seconds as compared to man
who can spend many months for doing the same task.
ACCURACY
• In addition to being very fast, computer are very accurate.
• The computer has performed calculations 100% error free.
• Computers perform all jobs with 100% accuracy.
STORAGE CAPABILITY
• Memory is a very important characteristic of computers.
• The computer has much more storage capacity than human beings.
• It can store large amount of data.
• It can store any type of data such as images, videos, text, audio and any other
type.
DILIGENCE
• Unlike human beings, a computer is free from monotony, tiredness and lack of
concentration.
• It can work continuously without creating any error and boredom.
Types of Computer
Depending upon the internal structure and subsequent features and applicability,
computer system is categorized as follows −
Mainframe Computer
It is high capacity and costly computer. It is largely used by big organizations where
many people can use it simultaneously.
Super Computer
This category of computer is the fastest and also very expensive. A typical
supercomputer can solve up to ten trillion individual calculations per second.
Workstation Computer
The computer of this category is a high-end and expensive one. It is exclusively made
for complex work purpose.
Personal Computer (PC)
It is a low capacity computer developed for single users.
Apple Macintosh (Mac)
It is a sort of personal computer manufactured by Apple company.
Laptop computer (notebook)
It is a handy computer that can be easily carried anywhere.
Tablet and Smartphone
Modern technology has advanced further. It has helped develop computers that are
pocket-friendly. Tablets and smartphones are the best examples of such computer.
Computer Memory:
Primary or Main Memory
Primary memory is also known as the computer system's main memory that
communicates directly within the CPU, Auxiliary memory and the Cache memory.
Main memory is used to kept programs or data when the processor is active to use
them. When a program or data is activated to execute, the processor first loads
instructions or programs from secondary memory into main memory, and then the
processor starts execution. Accessing or executing of data from primary memory is
faster because it has a cache or register memory that provides faster response, and it
is located closer to the CPU. The primary memory is volatile, which means the data
in memory can be lost if it is not saved when a power failure occurs. It is costlier
than secondary memory, and the main memory capacity is limited as compared to
secondary memory.
The primary memory is further divided into two parts:
1. RAM (Random Access Memory)
2. ROM (Read Only Memory)
Random Access Memory (RAM)
Random Access Memory (RAM) is one of the faster types of main memory accessed
directly by the CPU. It is the hardware in a computer device to temporarily store
data, programs or program results. It is used to read/write data in memory until the
machine is working. It is volatile, which means if a power failure occurs or the
computer is turned off, the information stored in RAM will be lost. All data stored
in computer memory can be read or accessed randomly at any time.
There are two types of RAM:
o SRAM
o DRAM
DRAM: DRAM (Dynamic Random-Access Memory) is a type of RAM that is
used for the dynamic storage of data in RAM. In DRAM, each cell carries one-bit
information. The cell is made up of two parts: a capacitor and a transistor. The size
of the capacitor and the transistor is so small, requiring millions of them to store on
a single chip. Hence, a DRAM chip can hold more data than an SRAM chip of the
same size. However, the capacitor needs to be continuously refreshed to retain
information because DRAM is volatile. If the power is switched off, the data store
in memory is lost.
Characteristics of DRAM
1. It requires continuously refreshed to retain the data.
2. It is slower than SRAM
3. It holds a large amount of data
4. It is the combination of capacitor and transistor
5. It is less expensive as compared to SRAM
6. Less power consumption
SRAM: SRMA (Static Random-Access Memory) is a type of RAM used to store
static data in the memory. It means to store data in SRAM remains active as long as
the computer system has a power supply. However, data is lost in SRAM when
power failures have occurred.
Characteristics of Static Ram
1. It does not require to refresh.
2. It is faster than DRAM
3. It is expensive.
4. High power consumption
5. Longer life
6. Large size
7. Uses as a cache memory
SRAM Vs. DRAM
SRAM DRAM
It is a Static Random-Access Memory. It is a Dynamic Random Access Memory.
The access time of SRAM is slow. The access time of DRAM is high.
It uses flip-flops to store each bit of It uses a capacitor to store each bit of
information. information.
It does not require periodic refreshing to It requires periodically refreshing to
preserve the information. preserve the information.
It uses in cache memory. It is used in the main memory.
The cost of SRAM is expensive. The cost of DRAM is less expensive.
It has a complex structure. Its structure is simple.
It requires low power consumption. It requires more power consumption.
Advantages of RAM
o It is a faster type of memory in a computer.
o It requires less power to operate.
o Program loads much faster
o More RAM increases the performance of a system and can multitask.
o Perform read and write operations.
o The processor can read information faster than a hard disc, floppy, USB, etc.
Disadvantages of RAM
o Less RAM reduces the speed and performance of a computer.
o Due to volatile, it requires electricity to preserve the data.
o It is expensive than ROM
o It is unreliable as compared to ROM
o The Size of RAM is limited.
Read-Only Memory (ROM)
ROM is a memory device or storage medium that is used to permanently store
information inside a chip. It is a read-only memory that can only read stored
information, data or programs, but we cannot write or modify anything. A ROM
contains some important instructions or program data that are required to start or
boot a computer. It is a non-volatile memory; it means that the stored information
cannot be lost even when the power is turned off or the system is shut down.
Types of ROM
There are five types of Read Only Memory:
1. MROM (Masked Read Only Memory):
MROM is the oldest type of read-only memory whose program or data is pre-
configured by the integrated circuit manufacture at the time of manufacturing.
Therefore, a program or instruction stored within the MROM chip cannot be
changed by the user.
2. PROM (Programmable Read Only Memory):
It is a type of digital read-only memory, in which the user can write any type
of information or program only once. It means it is the empty PROM chip in
which the user can write the desired content or program only once using the
special PROM programmer or PROM burner device; after that, the data or
instruction cannot be changed or erased.
3. EPROM (Erasable and Programmable Read Only Memory):
It is the type of read only memory in which stored data can be erased and re-
programmed only once in the EPROM memory. It is a non-volatile memory
chip that holds data when there is no power supply and can also store data for
a minimum of 10 to 20 years. In EPROM, if we want to erase any stored data
and re-programmed it, first, we need to pass the ultraviolet light for 40 minutes
to erase the data; after that, the data is re-created in EPROM.
4. EEPROM (Electrically Erasable and Programmable Read Only
Memory):
The EEROM is an electrically erasable and programmable read only memory
used to erase stored data using a high voltage electrical charge and re-
programmed it. It is also a non-volatile memory whose data cannot be erased
or lost; even the power is turned off. In EEPROM, the stored data can be
erased and reprogrammed up to 10 thousand times, and the data erase one byte
at a time.
5. Flash ROM:
Flash memory is a non-volatile storage memory chip that can be written or
programmed in small units called Block or Sector. Flash Memory is an
EEPROM form of computer memory, and the contents or data cannot be lost
when the power source is turned off. It is also used to transfer data between
the computer and digital devices.
Advantages of ROM
1. It is a non-volatile memory in which stored information can be lost even
power is turned off.
2. It is static, so it does not require refreshing the content every time.
3. Data can be stored permanently.
4. It is easy to test and store large data as compared to RAM.
5. These cannot be changed accidently
6. It is cheaper than RAM.
7. It is simple and reliable as compared to RAM.
8. It helps to start the computer and loads the OS.
Disadvantages of ROM
1. Store data cannot be updated or modify except to read the existing data.
2. It is a slower memory than RAM to access the stored data.
3. It takes around 40 minutes to destroy the existing data using the high charge
of ultraviolet light.
RAM Vs. ROM
RAM ROM
It is a Random-Access Memory. It is a Read Only Memory.
Read and write operations can be Only Read operation can be performed.
performed.
Data can be lost in volatile memory when Data cannot be lost in non-volatile memory
the power supply is turned off. when the power supply is turned off.
It is a faster and expensive memory. It is a slower and less expensive memory.
Storage data requires to be refreshed in Storage data does not need to be refreshed in
RAM. ROM.
The size of the chip is bigger than the The size of the chip is smaller than the RAM
ROM chip to store the data. chip to store the same amount of data.
Types of RAM: DRAM and SRAM Types of ROM: MROM, PROM, EPROM,
EEPROM
Secondary Memory
Secondary memory is a permanent storage space to hold a large amount of data.
Secondary memory is also known as external memory that representing the various
storage media (hard drives, USB, CDs, flash drives and DVDs) on which the
computer data and program can be saved on a long term basis. However, it is cheaper
and slower than the main memory. Unlike primary memory, secondary memory
cannot be accessed directly by the CPU. Instead of that, secondary memory data is
first loaded into the RAM (Random Access Memory) and then sent to the processor
to read and update the data. Secondary memory devices also include magnetic disks
like hard disk and floppy disks, an optical disk such as CDs and CDROMs, and
magnetic tapes.
Features of Secondary Memory
o Its speed is slower than the primary/ main memory.
o Store data cannot be lost due to non-volatile nature.
o It can store large collections of different types, such as audio, video, pictures,
text, software, etc.
o All the stored data in a secondary memory cannot be lost because it is a
permanent storage area; even the power is turned off.
o It has various optical and magnetic memories to store data.
Types of Secondary Memory
The following are the types of secondary memory devices:
Hard Disk
A hard disk is a computer's permanent storage device. It is a non-volatile disk that
permanently stores data, programs, and files, and cannot lose store data when the
computer's power source is switched off. Typically, it is located internally on
computer's motherboard that stores and retrieves data using one or more rigid fast
rotating disk platters inside an air-sealed casing. It is a large storage device, found
on every computer or laptop for permanently storing installed software, music, text
documentation, videos, operating system, and data until the user did not delete.
Floppy Disk
A floppy disk is a secondary storage system that consisting of thin, flexible magnetic
coating disks for holding electronic data such as computer files. It is also known as
Floppy Diskette that comes in three sizes like 8 inches, 5.5 inches and 3.5 inches.
The stored data of a floppy disk can be accessed through the floppy disk drive.
Furthermore, it is the only way through a new program installed on a computer or
backup of the information. However, it is the oldest type of portable storage device,
which can store data up to 1.44 MB. Since most programs were larger, that required
multiple floppy diskettes to store large amounts of data. Therefore, it is not used due
to very low memory storage.
CD (Compact Disc)
A CD is an optical disk storage device, stands for Compact Disc. It is a storage
device used to store various data types like audio, videos, files, OS, Back-Up file,
and any other information useful to a computer. The CD has a width of 1.2 mm and
12 cm in height, which can store approximately 783 MB of data size. It uses laser
light to read and write data from the CDs.
Types of CDs
1. CD-ROM (Compact Disc Read Only Memory): It is mainly used for bulk
size mass like audio CDs, software and computer games at the time of
manufacture. Users can only read data, text, music, videos from the disc, but
they cannot modify or burnt it.
2. CD-R (Compact Disc Recordable): The type of Compact Disc used to write
once by the user; after that, it cannot be modified or erased.
3. CD-RW (Compact Disc Rewritable): It is a rewritable CD disc, often used
to write or delete the stored data.
DVD Drive/Disc
DVD is an optical disc storage device, stands for Digital Video Display or Digital
Versatile Disc. It has the same size as a CD but can store a larger amount of data
than a compact disc. It was developed in 1995 by Sony, Panasonic, Toshiba and
Philips four electronics companies. DVD drives are divided into three types, such as
DVD ROM (Read Only Memory), DVD R (Recordable) and DVD RW (Rewritable
or Erasable). It can store multiple data formats like audio, videos, images, software,
operating system, etc. The storing capacity of data in DVD is 4.7 GB to 17 GB.
Blu Ray Disc (BD)
Blu Ray is an Optical disc storage device used to store a large amount of data or high
definition of video recording and playing other media files. It uses laser technology
to read the stored data of the Blu-ray Disk. It can store more data at a greater density
as compared to CD/ DVD. For example, compact discs allow us to store 700 MB of
data, and in DVDs, it provides up to 8 GB of storage capacity, while Blu-ray Discs
provide 28 GB of space to store data.
Pen Drive
A pen drive is a portable device used to permanently store data and is also known as
a USB flash drive. It is commonly used to store and transfer the data connected to a
computer using a USB port. It does not have any moveable part to store the data; it
uses an integrated circuit chip that stores the data. It allows the users to store and
transfer data like audio, videos, images, etc. from one computer to any USB pen
drive. The storing capacity of pen drives from 64 MB to 128 GB or more.
Cache Memory
It is a small-sized chip-based computer memory that lies between the CPU and the
main memory. It is a faster, high performance and temporary memory to enhance
the performance of the CPU. It stores all the data and instructions that are often used
by computer CPUs. It also reduces the access time of data from the main memory.
It is faster than the main memory, and sometimes, it is also called CPU memory
because it is very close to the CPU chip. The following are the levels of cache
memory.
1. L1 Cache: The L1 cache is also known as the onboard, internal, or primary
cache. It is built with the help of the CPU. Its speed is very high, and the size
of the L1 cache varies from 8 KB to 128 KB.
2. L2 Cache: It is also known as external or secondary cache, which requires
fast access time to store temporary data. It is built into a separate chip in a
motherboard, not built into the CPU like the L1 level. The size of the L2 cache
may be 128 KB to 1 MB.
3. L3 Cache: L3 cache levels are generally used with high performance and
capacity of the computer. It is built into a motherboard. Its speed is very slow,
and the maximum size up to 8 MB.
Advantages of Cache Memory
1. Cache memory is the faster memory as compared to the main memory.
2. It stores all data and instructions that are repeatedly used by the CPU for
improving the performance of a computer.
3. The access time of data is less than the main memory.
Disadvantage of Cache Memory
1. It is very costly as compared to the Main memory and the Secondary memory.
2. It has limited storage capacity.
Register Memory
The register memory is a temporary storage area for storing and transferring the data
and the instructions to a computer. It is the smallest and fastest memory of a
computer. It is a part of computer memory located in the CPU as the form of
registers. The register memory is 16, 32 and 64 bits in size. It temporarily stores data
instructions and the address of the memory that is repeatedly used to provide faster
response to the CPU.
Primary Vs. Secondary Memory
Primary Memory Secondary Memory
It is also known as temporary memory. It is also known as a permanent memory.
Data can be access directly by the processor Data cannot be accessed directly by the I/O
or CPU. processor or CPU.
Stored data can be a volatile or non-volatile The nature of secondary memory is always
memory. non-volatile.
It is more costly than secondary memory. It is less costly than primary memory.
It is a faster memory. It is a slower memory.
It has limited storage capacity. It has a large storage capacity.
It required the power to retain the data in It does not require power to retain the data in
primary memory. secondary memory.
Examples of primary memory are RAM, Examples of secondary memory are CD,
ROM, Registers, EPROM, PROM and DVD, HDD, magnetic tapes, flash disks, pen
cache memory. drive, etc.
Program Definition: A computer program is a sequence of instructions written
using a Computer Programming Language to perform a specified task by the
computer.
Hardware – any physical device or equipment used in or with a computer system
(anything you can see and touch).
External hardware
External hardware devices (peripherals) – any hardware device that is located
outside the computer.
Input device – a piece of hardware device which is used to enter information to a
computer for processing.
Examples: keyboard, mouse, trackpad (or touchpad), touchscreen, joystick,
microphone, light pen, webcam, speech input, etc.
Output device – a piece of hardware device that receives information from a
computer.
Examples: monitor, printer, scanner, speaker, display screen (tablet,
smartphone …), projector, head phone, etc.
Computer software
Software – a set of instructions or programs that tells a computer what to do or
how to perform a specific task (computer software runs on hardware).
Main types of software – systems software and application software.
Application software
Application software – a computer program that provides users with tools to
accomplish a specific task.
Examples of application software: word processing, spreadsheets, presentation,
database management, Internet browsers, email programs, media players,
accounting, pronunciation, translation, desktop publishing, enterprise, etc.
System Software
System software – it is designed to run a computer’s hardware and application
software, and make the computer system available for use. It serves as the interface
between hardware, application software, and the user.
Main functions of system software – allocating system resources, managing
storage space, storing and retrieval of files, providing security, etc.
Main types of systems software – operating system, device driver, utility software,
programming software, etc.
The main difference between System Software and Application Software is that
without system software, system can not run on the other hand without
application software, system always runs.
[Link] System Software Application Software
System Software maintain the
system resources and give the
path for application software Application software is built
1. to run. for specific tasks.
While high level languages
Low level languages are used are used to write the
2. to write the system software. application software.
While its a specific purpose
3. Its a general purpose software. software.
While without application
Without system software, software system always
4. system can’t run. runs.
System software runs when While application software
system is turned on and stop runs as per the user’s
5. when system is turned off. request.
Example of application
Example of system software software are Photoshop,
6. are operating system, etc. VLC player etc.
Application software
System Software programming is simpler as
programming is complex than comparison to system
7. application software. software.
What is a Firmware?
Firmware is a software program on the hardware device, which perform functions
like basic input/output tasks and offers necessary instructions for the device to
communicate with other computing devices. It is a set of instructions programmed
that is permanently etched into a hardware device like video cards, BIOS, keyboards,
or hard drives. Without using special programs, it cannot be modifying or deleted by
an end-user, unlike normal software. And it remains on that device whether it is on
or off. But firmware is typically stored in the flash ROM, which is actually a kind of
flash memory and allows users to erase and rewrite information.
What is Interpreter?
An interpreter is a computer program, which coverts each high-level program
statement into the machine code. This includes source code, pre-compiled code,
and scripts. Both compiler and interpreters do the same job which is converting
higher level programming language to machine code. However, a compiler will
convert the code into machine code (create an exe) before program run.
Interpreters convert code into machine code when the program is run.
What is Compiler?
A compiler is a computer program that transforms code written in a high-level
programming language into the machine code. It is a program which translates the
human-readable code to a language a computer processor understands (binary 1
and 0 bits). The computer processes the machine code to perform the
corresponding tasks.
A compiler should comply with the syntax rule of that programming language in
which it is written. However, the compiler is only a program and cannot fix errors
found in that program. So, if you make a mistake, you need to make changes in the
syntax of your program. Otherwise, it will not compile.
Interpreter Vs Compiler
Interpreter Compiler
Scans the entire program and
Translates program one statement at
translates it as a whole into machine
a time.
code.
Interpreters usually take less amount Compilers usually take a large
of time to analyze the source code. amount of time to analyze the source
However, the overall execution time code. However, the overall execution
is comparatively slower than time is comparatively faster than
compilers. interpreters.
Generates Object Code which further
No Object Code is generated, hence
requires linking, hence requires more
are memory efficient.
memory.
Programming languages like
Programming languages like C, C++,
JavaScript, Python, Ruby use
Java use compilers.
interpreters.