0% found this document useful (0 votes)
35 views65 pages

Pps Unit 1

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

Pps Unit 1

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

Programming

for
problem solving

B.Tech

(1ST YEAR)
Notes
[Type here]

Unit-1

Overview of Computers
What is computer ?
A computer is an electronic data processing device, which accepts and stores data input,
processes the data input, and generates the output in a required format.
The purpose of this tutorial is to introduce you to Computers and its fundamentals.

Functionalities of a Computer
If we look at it in a very broad sense, any digital computer carries out the following five
functions-
Step 1 − Takes data as input.
Step 2 − Stores the data/instructions in its memory and uses them as required.
Step 3 − Processes the data and converts it into useful information.
Step 4 − Generates the output.
Step 5 − Controls all the above four steps.

Basic components of computer system


By definition, components of a computer system are the primary elements which
make the functioning of an electronic device smooth and faster.
There are five basic components which include:
• Input Unit
• Output Unit
• Memory Unit
• Control Unit
• Arithmetical and Logical Unit

• Input Unit
A computer will only respond when a command is given to the device. These
commands can be given using the input unit or the input devices.
For example: Using a keyboard we can type things on a Notepad and the
computer processes the entered data and then displays the output of the same of
the screen.
The data entered can be in the form of numbers, alphabet, images, etc. We enter
the information using an input device, the processing units convert it into computer
understandable languages and then the final output is received by a human-
understandable language.

• Output Unit
When we command a computer to perform a task, it reverts for the action
performed and gives us a result. This result is called output. There are various
output devices connected to the computer. The most basic of which is a monitor.
Whatever we write using a keyboard or click using a mouse, is all displayed on the
monitor.
Thus, the output unit gives us the final result once the entire processing is done
within the mechanism of a device.
For example: when we visit an ATM, we enter our details like language, pin,
amount to be withdrawn, etc. and then the final money which the cash dispenser
releases is our outcome. In this case, the cash dispenser acts as an output unit.
To get a list of computer input and output device and the function of the
various I/O devices, visit the linked article.
For better understanding and more interactive analysis of the components of the
computer, candidates can check the video given below and get detailed
information reading the five major components responsible for the functioning of a
computer device.

• Memory Unit
When we enter the data into the computer using an input device, the entered
information immediately gets saved in the memory unit of the Central Processing
Unit (CPU). Because of the presence of some existing programming, the Memory
Unit transmits the data further to the other parts of the CPU.
Similarly, when the output of our command is processed by the computer, it is
saved in the memory unit before giving the output to the user.
• Control Unit
This is the core unit which manages the entire functioning of the computer device.
It is one of the most essential components of the computer system.
The Control Unit collects the data entered using the input unit, leads it on for
processing and once that is done, receives the output and presents it to the user. It
can be said to the centre of all processing actions taking place inside a computer
device.
Basically, the instructions taken, interpretation of entered data, issuing signals to
execute the data and then finally retrieving the data is all done in the Control Unit.

• Arithmetic & Logical Unit


As the name suggests, all the mathematical calculations or arithmetic operations
are performed in the Arithmetic and Logical Unit of the CPU.
It can also perform actions like a comparison of data and decision-making actions.
The ALU comprises circuits using which addition, subtraction, multiplication,
division and other numerical based calculations can be performed.

Block diagram of computer system

1. Input unit – Input unit is a unit that accepts any input device. The input
device is used to input data into the computer system.
Function of input unit:
• It converts inputted data into binary codes.
• It sends data to main memory of computer .
2. Central Processing Unit (CUP) – CPU is called the brain of a computer. An
electronic circuitry that carries out the instruction given by a computer program.
CPU can be sub classified into three parts. i
.Control unit (CU)
ii. Arithmetic & Logic unit (ALU)
iii.Memory Unit (MU)
i. Control unit (CU)- the control unit manages the various components of the
computer. It reads instructions from memory and interpretation and changes in a
series of signals to activate other parts of the computer. It controls and co-
ordinate is input output memory and all other units.
ii. Arithmetic & Logic unit (ALU) – The arithmetic logic unit (ALU), which
performs simple arithmetic operation such as +, -, *, / and logical operation such
as >, <, =<, <= etc.
iii. Memory Unit (MU)- Memory is used to store data and instructions before
and after processing. Memory is also called Primary memory or
internal memory. It is used to store data temporary or permanently.
Types of memory unit:-
Primary Memory
This is the internal memory that stores the data and instructions of the CPU.
It is volatile in nature (data is lost when the power is disconnected).

Secondary Memory
As we know that the primary memory is volatile therefore, we need some devices to
store the data permanently so we use some external storage devices for this purpose
which we name as the secondary memory. Some examples: CD, DVD,etc.

Function of CPU-

• It controls all the parts and software and data flow of computer.
• It performs all operations.
• It accepts data from input device.
• It sends information to output device.
• Executing programs stored in memory
• It stores data either temporarily or permanent basis.
• It performs arithmetical and logical operations.
• Output Unit –Output unit is a unit that constituents a number of
output device. An output device is used to show the result of
processing.
• it accepts data or information sends from main memory of
computer
• It converts binary coded information into HLL or inputted
languages.

Number system:-
When we type some letters or words, the computer translates them in numbers as
computers can understand only numbers. A computer can understand the
positional number system where there are only a few symbols called digits and
these symbols represent different values depending on the position they occupy in
the number.
The value of each digit in a number can be determined using −
• The digit
• The position of the digit in the number
• The base of the number system (where the base is defined as the total
number of digits available in the number system)
Decimal Number System
The number system that we use in our day-to-day life is the decimal number
system. Decimal number system has base 10 as it uses 10 digits from 0 to
9. In decimal number system, the successive positions to the left of the decimal
point represent units, tens, hundreds, thousands, and so on.
Each position represents a specific power of the base (10). For example, the
decimal number 1234 consists of the digit 4 in the units position, 3 in the tens
position, 2 in the hundreds position, and 1 in the thousands position.
Its value can be written as
(1 x 1000)+ (2 x 100)+ (3 x 10)+ (4 x l)
(1 x 103)+ (2 x 102)+ (3 x 101)+ (4 x l00)
1000 + 200 + 30 + 4
1234
As a computer programmer or an IT professional, you should understand the
following number systems which are frequently used in computers.
S.No. Number System and Description

1 Binary Number System

Base 2. Digits used : 0, 1

Octal Number System


2
Base 8. Digits used : 0 to 7

Hexa Decimal Number System


3
Base 16. Digits used: 0 to 9, Letters used : A- F

Binary Number System


Characteristics of the binary number system are as follows −
• Uses two digits, 0 and 1
• Also called as base 2 number system
• Each position in a binary number represents a 0 power of the base (2).
Example 20
• Last position in a binary number represents a x power of the base (2).
Example 2x where x represents the last position - 1.
Example
Binary Number: 101012 Calculating
Decimal Equivalent −
Step Binary Number Decimal Number

Step 1 101012 ((1 x 24) + (0 x 23) + (1 x 22) + (0 x 21) + (1 x


20))10

Step 2 101012 (16 + 0 + 4 + 0 + 1)10

Step 3 101012 2110


Note − 101012 is normally written as 10101.

Octal Number System


Characteristics of the octal number system are as follows −
• Uses eight digits, 0,1,2,3,4,5,6,7
• Also called as base 8 number system
• Each position in an octal number represents a 0 power of the base (8).
Example 80
• Last position in an octal number represents a x power of the base (8).
Example 8x where x represents the last position - 1
Example
Octal Number: 125708 Calculating
Decimal Equivalent −
Step Octal Number Decimal Number

Step 1 125708 ((1 x 84) + (2 x 83) + (5 x 82) + (7 x 81) + (0 x


80))10

Step 2 125708 (4096 + 1024 + 320 + 56 + 0)10

Step 3 125708 549610

Note − 125708 is normally written as 12570.


Hexadecimal Number System
Characteristics of hexadecimal number system are as follows −
• Uses 10 digits and 6 letters, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
• Letters represent the numbers starting from 10. A = 10. B = 11, C = 12, D
= 13, E = 14, F = 15
• Also called as base 16 number system
• Each position in a hexadecimal number represents a 0 power of the base
(16). Example, 160
• Last position in a hexadecimal number represents a x power of the base
(16). Example 16x where x represents the last position - 1
Example
Hexadecimal Number: 19FDE16
Calculating Decimal Equivalent −
Step Binary Decimal Number
Number

Step 19FDE16 ((1 x 164) + (9 x 163) + (F x 162) + (D x 161) + (E x


1 160))10

Step ((1 x 164) + (9 x 163) + (15 x 162) + (13 x 161) + (14 x


19FDE16
2 160))10

Step 19FDE16 (65536+ 36864 + 3840 + 208 + 14)10


3

Step 19FDE16 10646210


4

Note − 19FDE16 is normally written as 19FDE.


Arithmetic Of Number System

A number system is a set of symbols used to represent values derived from a


common base or radix. In a number, the value of each digit can be determined
using digit, position of the digit in the number, and the base of the number system.
The base is defined as the total number of digits are available in the number
system. This is known as positional number system.
Number System Base Digit Used

Binary 2 0, 1

Octal 8 0, 1, 2, 3, 4, 5, 6, 7

Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Hexadecimal 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

Arithmetic operations like addition, subtraction, multiplication and division are


performed in various radix bases. These arithmetic operations may also use r’s
complement and (r-1)’s complement representation.
These representation techniques hold basic laws for various arithmetic operations:
(i) Unique Existence Law: The sum and product of any two numbers exist
uniquely. Where 0 is the identity element for additions and 1 is the identity element
for multiplication.
(ii) Associative Law:Addition and multiplication of binary numbers are
associative.
(iii) Commutative Law:Addition and multiplication of binary numbers are
commutative.
(iv) Distributive Law:Multiplication of binary numbers is distributive over two or
more terms in addition.
Now, arithmetic operations for various number systems are explained as following
below.
Arithmetic Operations of Binary Numbers:
In the Binary System, there are only two symbols or possible digit values, i.e., 0
and 1. Represented by any device that only 2 operating states or possible
conditions. Generally, it is expressed by subscript 2 or binary (B).
Binary arithmetic is essential part of various digital systems. You can add,
subtract, multiply, and divide binary numbers using various methods. These
operations are much easier than decimal number arithmetic operations because
binary system has only two digits: 0 and 1.
Binary additions and subtractions are performed as same in decimal additions and
subtractions. When we perform binary additions, there will have two outputs: Sum
(S) and Carry (C) . There are four rules for binary addition. These are given as
following below,

Input A Input B Sum (S) Carry (C)


A+B

0 0 0 0

0 1 1 0

1 0 1 0

1 1 0 1

There are four rules for binary subtraction. These are given as following
below,
Input A Input B Subtract (S) Borrow (B)
A-B

0 0 0 0

0 1 0 1

1 0 1 0

1 1 0 0

Borrow 1 is required from next higher order bit to subtract 1 from 0. So, result
became 0.
There are four rules for binary multiplication. These are given as following
below,

Input A Input B Multiply


(M)
AxB
0 0 0

0 1 0

1 0 0

1 1 1

Whenever at least one input is 0, then multiplication is always 0.


There are four part in any division: Dividend, Divisor, quotient, and remainder.
These are given as following rules for binary division,
Input A Input B Divide (D)
A/B

0 0 Not defined

0 1 0
1 0 Not defined

1 1 1

Whenever divisor is 0, then result is always not defined.


Arithmetic Operations of Octal Numbers:
It has base of 8 digits ranging from 0 to 7 (i.e., 0, 1, 2, 3, 4, 5, 6, 7). Generally, it is
expressed by subscript 8 or octal (o).
Arithmetic operations of octal numbers are also performed same as decimal
arithmetic operations. The addition table for octal numbers is given as below:

+ 0 1 2 3 4 5 6 7

0 0 1 2 3 4 5 6 7

1 1 2 3 4 5 6 7 10

2 2 3 4 5 6 7 10 11

3 3 4 5 6 7 10 11 12

4 4 5 6 7 10 11 12 13

5 5 6 7 10 11 12 13 14

6 6 7 10 11 12 13 14 15

7 7 10 11 12 13 14 15 16

With the help of above table, we can perform additions of octal numbers.
Similarly, we can perform subtraction of octal numbers same as decimal number
sutractions. But you can only take borrow of a number 7, which is maximum digit
allowed in octal number systems.
In the multiplication of octal numbers, if the product is less than radix of octal (i.e,
8), then we take it as the result, else divide it by radix of octal (i.e., 8) and take the
remainder as the LSB (least significant bit). The quotient is taken as carry in the
next significant digit.
Similarly, division of octal numbers can be performed by following the rules of
division of decimal numbers but maximum allowed digit will be 7.

Arithmetic Operations of Hexadecimal Numbers:


It has base of 16 digits ranging from 0 to F (i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and A, B,
C, D, E, F). A, B, C, D, E, F are equivalent single digits of 10, 11, 12, 13, 14, 15
respectively. Generally, it is expressed by subscript 16 or Hexa or (h).
Arithmetic operations of hexadecimal numbers can be performed using addition
table for hexadecimal numbers which is given as below:

+ 0 1 2 3 4 5 6 7 8 9 A B C D E F

0 0 1 2 3 4 5 6 7 8 9 A B C D E F

1 1 2 3 4 5 6 7 8 9 A B C D E F 10

2 2 3 4 5 6 7 8 9 A B C D E F 10 11

3 3 4 5 6 7 8 9 A B C D E F 10 11 12

4 4 5 6 7 8 9 A B C D E F 10 11 12 13

5 5 7 7 8 9 A B C D E F 10 11 12 13 14

6 6 7 8 9 A B C D E F 1 11 12 13 14 15
0

7 7 8 9 A B C D E F 1 1 12 13 14 15 16
0 1

8 8 9 A B C D E F 1 1 1 13 14 15 16 17
0 1 2

9 9 A B C D E F 1 1 1 1 14 15 16 17 18
0 1 2 3

A A B C D E F 1 1 1 1 1 15 16 17 18 19
0 1 2 3 4
B B C D E F 1 1 1 1 1 1 16 17 18 19 1A
0 1 2 3 4 5

C C D E F 1 1 1 1 1 1 1 17 18 19 1A 1B
0 1 2 3 4 5 6

D D E F 1 1 1 1 1 1 1 1 18 19 1A 1B 1
0 1 2 3 4 5 6 7 C

E E F 1 1 1 1 1 1 1 1 1 19 1 1B 1 1
0 1 2 3 4 5 6 7 8 A C D

F F 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1E
0 1 2 3 4 5 6 7 8 9 A B C D

With the help of above table, we can perform additions of hexadecimal numbers.
Subtraction of hexadecimal numbers can be performed by using complement
methods or simple as decimal sutractions. The rule of simple hexadecimal
subtraction is the digit borrowed from the immediate higher place is counted as 16.
In the multiplication of hexadecimal numbers, if the product is less than radix of
hexadecimal (i.e, 16), then we take it as the result, else divide it by radix of
hexadecimal (i.e., 16) and take the remainder as the LSB (least significant bit). The
quotient is taken as carry in the next significant digit. Using these rules, you can
make a table for hexadecimal multiplications.
Similarly, division of hexadecimal numbers can be performed by following the
rules of division of decimal numbers but maximum allowed digit will be F(=15 in
decimal).

Computer Hardware
Computer hardware is a collective term used to describe any of the physical
components of an analog or digital computer. The
term hardware distinguishes the tangible aspects of a computing device from
software, which consists of written, machine-readable instructions
or programs that tell physical components what to do and when to execute the
instructions.
Hardware and software are complementary. A computing device can function
efficiently and produce useful output only when both hardware and software work
together appropriately.

Computer hardware can be categorized as being either internal or external


components. Generally, internal hardware components are those necessary for the
proper functioning of the computer, while external hardware components are
attached to the computer to add or enhance functionality.

What are internal computer hardware components?


Internal components collectively process or store the instructions delivered by the
program or operating system (OS). These include the following:

• Motherboard. This is a printed circuit board that holds the central


processing unit (CPU) and other essential internal hardware and
functions as the central hub that all other hardware components run
through.

• CPU. The CPU is the brain of the computer that processes and
executes digital instructions from various programs; its clock speed
determines the computer's performance and efficiency in processing
data.

• RAM. RAM -- or dynamic RAM -- is temporary memory storage that


makes information immediately accessible to programs; RAM is
volatile memory, so stored data is cleared when the computer powers
off.

• Hard drive. Hard disk drive are physical storage devices that store both
permanent and temporary data in different formats, including programs,
OSes, device files, photos, etc.
• Solid-state drive (SSD). SSDs are solid-state storage devices based on
NAND flash memory technology; SSDs are non-volatile, so they can
safely store data even when the computer is powered down.

• Optical drive. Optical drives typically reside in an on-device drive bay;


they enable the computer to read and interact with nonmagnetic external
media, such as compact disc read-only memory or digital video discs.

• Heat sink. This is a passive piece of hardware that draws heat away
from components to regulate/reduce their temperature to help ensure
they continue to function properly. Typically, a heat sink is installed
directly atop the CPU, which produces the most heat among internal
components.

• Graphics process unit. This chip-based device processes graphical


data and often functions as an extension to the main CPU.

• Network interface card (NIC). A NIC is a circuit board or chip that


enables the computer to connect to a network; also known as
a network adapter or local area network adapter, it typically supports
connection to an Ethernet network.

Other computing components, such as USB ports, power supplies, transistors and
chips, are also types of internal hardware. This computer hardware chart below
illustrates what typical internal computer hardware components look like.
What are external hardware components?
External hardware components, also called peripheral components, are those items
that are often externally connected to the computer to control either input or output
functions. These hardware devices are designed to either provide instructions to
the software (input) or render results from its execution (output).
Common input hardware components include the following:

• Mouse. A mouse is a hand-held pointing device that moves a cursor


around a computer screen and enables interaction with objects on
the screen. It may be wired or wireless.

• Keyboard. A keyboard is an input device featuring a standard


QWERTY keyset that enables users to input text, numbers or
special characters.

• Microphone. A microphone is a device that translates sound waves


into electrical signals and supports computer-based audio
communications.

• Camera. A camera captures visual images and streams them to the


computer or through a computer to a network device.

• Touchpad. A touchpad is an input device, external or built into a


laptop, used to control the pointer on a display screen. It is typically
an alternative to an external mouse.

• USB flash drive. A USB flash drive is an external, removable


storage device that uses flash memory and interfaces with a
computer through a USB port.

• Memory card. A memory card is a type of portable external storage


media, such as a Compactflash card, used to store media or data files.
Other input hardware components include joysticks, styluses and scanners.

Examples of output hardware components include the following:

• Monitor. A monitor is an output device similar to a TV screen that


displays information, documents or images generated by the computing
device.

Printer
Printers render electronic data from a computer into printed material. A printer is a
hardware output device that is used to generate hard copy and print any document.
A document can be of any type such as a text file, image, or the combination of
both. It accepts input command by users on a computer or on other devices to print
the documents. For example, if you have to submit a project report at your college,
you need to create a soft copy of your report and print it with the help of the
printer.

Printers are one of the common computer peripheral devices that can be classified
into two categories that are 2D and 3D printers. The 2D printers are used to print
text and graphics on a paper, and 3D printers are used to create three dimensional
physical objects.
Types of printer
Although there are different types of printers, nowadays, two types of printers are
commonly used, which are inkjet and laser printers. A list of all the various types
of printers is given below:
• Inkjet Printers

• Laser Printers
• 3D Printers

• LED Printers

• Solid Ink Printers

• Dot Matrix Printers

• Multifunction or All-in-One Printers

• Thermal printer

• Plotter

Inkjet Printers
It is widely used by home and business computer users that prints characters by
spraying the ink using magnetic plates on the paper. It contains a paper feed
assembly, ink cartridge, print head, stabilizer bar, and belt. It stores the ink in
cartridges, and uses separate cartridge to print several types of color documents.
These colors are a combination of cyan, magenta, yellow, and black color. These
types of printers have the ability to create high-quality pictures with the help of
vivid colors. Furthermore, the inkjet printers are more affordable and easier to use
as compared to other printers.

Advantages of Inkjet Printers:


• The Inkjet printers have the ability to produce high-quality output.

• These printers are reasonably fast and easy to use.

• Additionally, these types of printers do not take warm up time.

Disadvantages of Inkjet Printer:


• It may take more time to print.

• Its running cost is high.

• It does not allow the highlighter marker.

• Sometimes, it can produce a wrong warning of an empty cartridge.

Laser printers
The laser printer is one of the common personal computer printers. It was
introduced in 1971, and after that it was developed at Xerox PARC by Gary
Starkweather. It uses the laser or non-impact photocopier technology to print the
text and images on the paper. Whenever it gets input to print any document, a laser
beam draws the document on the selenium-coated drum with the help of electric
charges.
• When the drum is charged, it is rolled in toner (dry ink powder). The ink
follows the image, which has charged on the drum. The ink is combined
with the paper, including heat and pressure, then transferred on a chunk (piece)
of paper.

When the document is printed, the excess toner is collected, and an electric charge
is removed from the drum. Most of the laser printers are capable of printing only in
monochrome. The monochrome laser printer is around ten times cheaper than a
color laser printer.

There are many differences between a laser printer and inkjet printer, such as:
• The laser printer contains dry ink, while an inkjet contains wet ink.

• An inkjet printer is approximately ten times more expensive than the laser
printer as it requires replacing the ink very frequently.
• If a paper is wet, the inkjet printer will print the document with blur, but the
laser printer will print clear. The inkjet printer is suitable for printing fewer
documents, while the laser printer has the ability to print more documents.

Advantages of a Laser printer:


• These types of printers have a higher paper capacity.

• It is less expensive than the inkjet printer.

• It has the ability to print documents speedily.


• Furthermore, it is able to increase productivity.

Disadvantages of a Laser printer:


• Laser printers may need warm up time.

• Laser printers are bulky as they required the laser technology and
imaging drum.

• It requires high voltage leads to small carbon emissions.

3D Printers
One of the best enhancements in the history of printing technology is the 3d
printer, which was developed by Chuck Hull in 1984. It produces 3D objects and
items by using quality resin. It uses materials like plastics, polymers, metal alloys,
or even food ingredients.
Application of 3D printers
There are many applications where 3D printers are used, such
as archaeology, aerospace engineering, information systems,
dentistry, and biotechnology. For example, it might be used to reconstruct
ancient artifacts of archaeology physically, which have been destroyed with time.

Advantages of 3D printer:
• The main advantage of a 3D printer is that it allows users to print
objects in 3D .

• It has the ability of full customization.

• It is easy to access and cost-effective.

• It prints the documents with better quality.

• It provides users unlimited shapes and geometry.

Disadvantages of 3D printer:
• Its initial and resin costs are high.

• 3D printing is still developing technology.


• It consumes high energy around 50 to 100 more than injection molding.

• It includes limited materials

• The 3D printers are slow as they are limitless for mass customization.

LED Printers
The LED printer is mostly like a laser printer. It uses the drum, ink, and fuser
system to print the black or colored documents. Initially, Casio and function
developed the LED printers by focusing light throughout the whole length of the
drum. These types of printers are non-impact, but instead of using a laser in the
printhead they use a light-emitting diode. These printers were invented by the
manufacturer OKI in 1989.

There is a difference between laser printers and LED printers; the LED printers use
a strip of LEDs to create an ink-attracting static charge on the printing drum while
laser printers use a laser and mirror. Although LED printers are not more popular
as compared to inkjet and laser printer, they are gently gaining popularity as they
provide users the unique benefits.

Advantages of the LED printer:


• The manufacturing of LED printers is cheaper than laser printers.

• These types of printers mostly contain free warranty extensions.


• These printers are capable of printing on thick 3D items.

Solid Ink Printers


A laser class solid ink printer is designed to save space and money on packaging. It
uses a unique type of ink technology that is melted into a liquid before being used.
As inkjet printers stream the ink directly on the paper, but solid ink printers are
different as they stream the ink on the drum. Firstly, transferring the ink to the
drum than to the printer is a better way to get a good color combination as a drum
can be controlled appropriately than the moving paper. Xerox acquired the color
printer division of Tektronix, Inc., in 2000. The solid ink printer was introduced in
the market by Tektronix, Inc., with its crayonlike cartridges.
Advantages of solid ink printer:
• The print quality of a solid ink printer is good as it produces dynamic colors
and extraordinary print quality on a broad range of media like envelopes,
recycled paper, transparencies, and cardstock.

• The solid ink printers are easy to handle because these are made by non-
toxic vegetable oils and do not melt in our hands. Unlike laser or inkjet
printers, they do not spill or leak.

• These types of printers are capable of printing the documents fast.


Generally, it can print up to 30 pages per minute.

• The ink loading in the solid printer is an easy as it includes sticks in


particular shapes that only go to the correct slot. These types of printers
contain the ink slot on the top of the printer, and they allow you to replace
the ink at any time, including at the time of printing.

• The solid ink printers are designed in that way; they comprise only three
main assemblies, print drum, print head, and controller. It takes less space as
compared to the color laser printer.

• Furthermore, these printers and their parts are affordable than the color toner
cartridges and color laser printers.
Disadvantages of a solid ink printer:
• These printers may require warm-up and cool downtime.
• These are sensitive to UV light, and color may fade under the sunlight with
the time.

• These printers consume more power than the laser printer

• These printers are mainly used for a large numbers of printing. If it is turned
off in the middle of the printing, it will take some time to warm up again.

Dot Matrix Printers


The dot matrix printers are also known as a pin printer that was released by
IBM in 1957. Although, in 1970, Centronics created the first dot-matrix impact
printer. It strikes an ink ribbon using print heads that place thousands of little dots
to form images and text. Nowadays, as compared to laser and inkjet printers, it is
less used, as its printing speed slow and generates lower quality images. However,
dot matrix printers are still in use in some sectors like package delivery companies
and auto part stores.

Advantages of Dot matrix printer:


• A dot matrix printer is less expensive as compared to most of the printers,
and it is easily available in the market.

• It has the ability to print carbon copies of a particular print out, unlike non-
impact printers.
• Its printing cost is lowest than the other printers.

• Furthermore, its maintenance cost is less expensive than the other


printers.

Disadvantages of Dot matrix printer:


• The speed of the dot matrix printer is slow as compared to non-impact
printers, and its output is also not of high resolution.

• It creates high noise when the pins hit the ribbon to the paper.

• It may be a time-consuming printer as it requires a single paper to


wound up and aligned manually.

Multifunction Printers
Multifunction printer is a hardware device that can perform various tasks such as
printing, scanning, faxing, and copying. It is also called the All- in-One printer.
It is suitable for budget-minded businesses that want to reduce costs, consolidate
assets, and improve workflow. Although it is necessary to connect the printer to a
computer with the help of a wire or wireless connection, sometimes it can be
controlled from their control panel like standalone copiers. Furthermore, no need
for more than one unit as it can easily complete multiple tasks within an office or
home simultaneously.

Advantages of Multifunction Printers:


• The multifunction printers can save initial cost, as instead of purchasing
many printers and fax machines, you can purchase only one large MFG for
multipurpose.
• These types of printers are beneficial for home and office as they save a lot
of floor space. It may be difficult to find space for the fax machine, printer,
and scanner, but a multifunction printer takes limited space and can perform
multi-task such as a printing, faxing, and scanning.

• One of the best advantages of a multifunction printer, the operation


functionality is faster as compared to laser printers or other printers.

Also, some of the multifunction printers can send print documents, faxes,
scan images, and copy all at the same time.

• Furthermore, these printers need only one cable to power the whole setup,
which reduces the congestion and electricity required to run the device.
Thus, the multifunction printer consumes less power as compared to other
printers.

Disadvantages of Multifunction Printers:


• The operating cost of a multifunction printer is high. Its maintenance cost is
also expensive as it uses ink speedily as compared to other printers. All
functions, such as faxing, copying, and printer, use ink faster.

• These printers perform a task on the basis of first in first out rule. So all
tasks stack up in a queue that can cause slow the machine.Thus, some people
may have to wait to use the machine.

• When the multifunction printer is out of service or broken down, the all
work scanning, printing, copying, faxing will be completely stopped. It can
be an issue for an organization, if they have more requirements for faxing,
copying, and printing the documents.

Thermal printer
The thermal printer is invented by Jack Kilby that is also known as an
electrothermal printer, thermal transfer printer, or thermal wax-transfer printer. It
utilizes heated pins in order to produce the image on paper. These types of printers
are widely used in banking, airline, grocery, entertainment, retail, healthcare
industries, fax, and calculator machines.These printers are low-cost and print fast,
and do not use ink like other printers. They primarily depend on the thermal paper
to produce the images.
This technology is useful for an organization as it is reliable as well as cost-
effective. Employees can work continuously without getting interrupted because
they do not need to change the cartridges or ribbons in this printer.

Advantages of Thermal printer:


• One of the main advantages of a thermal printer, it does not need any
ribbons or cartridges.Thus, the companies can save the time by using it.

• These types of printers are easy to use as they have fewer buttons, including
the use of software.

• These are beneficial for offices as they provide noise-free environments.

• These printers are cheaper and available in several models and sizes.

• These printers are faster and more efficient in printing monochromic ones
than the other printers.

Disadvantages of Thermal printer:


• Generally, a thermal printer does not produce colors print out well, like
standard printers.

• At the time of printing, the high heat can be harmful to the printhead.
Consequently, if the printhead breaks down, you have to pay for a repair or
buy a new one.
Plotter
A plotter is a hardware device or a printer, which was first invented by
Remington-Rand in 1953. It is developed to print vector graphics and uses a
pencil, pen, marker, or other writing tools for drawing continuous lines instead of
using ink or tonner. It is widely used to print a hard copy of schematics and other
similar applications.
There are several types of plotter given in the below list:
• Drum plotter: It is also known as roller plotter. It turns the paperback and
forth on a drum while pens move left and right. With the help of combining
these two directions, the line can be drawn in any direction.

• Flatbed plotter: In flatbed plotter, a paper is placed on a large horizontal


surface.A traveling bar moves across the surface and draws the lines.

• Electrostatic plotter: It draws on paper that is charged negatively with


positively charged ink or tonner.

• Inkjet Plotter: It is a type of Pinch Roller Plotter, which produces an image


with the help of showering little drops of ink on the paper.

• Cutting Plotter: It is a new generation device that allows users to cut


different shapes. It is mainly used for advertising, sign-making, bill board,
and vehicle graphics.
Advantages of Plotter:
• A Plotter is capable of working on the large sheet around 2 feet or more with
better quality.

• It can print on sheet, steel, plastic, aluminum, plywood, and any flat sheet
material, including paper.

• It has the ability to save all templates and patterns on the disk. Thus, it can
overcome the problem to load the same pattern again and again.

• Furthermore, it can draw the same pattern thousand times without any
degradation.

Disadvantages of Plotter:
• The size of a plotter is very large than the traditional printers.

• Plotters are more expensive as compared to a traditional printer.

Storage Devices

Magnetic storage devices


Nowadays, magnetic storage is commonly founded on hybrid hard drives or
extremely large HDDs.
A list is given below of magnetic storage devices:
• Floppy diskette: A floppy disk drive (FDD) offers users the benefit of
saving data to removable diskettes. FDDs have been replaced with other
storage devices like network file transfer and USB.

• Hard drive: A hard disk drive (HDD) is used to store data permanently as it
is a non-volatile computer storage device, and directly connected to the disk
controller of the computer's motherboard. Usually, it is installed internally in
a computer, known as secondary storage device.

• Magnetic Card: A magnetic card is a card that may have information about
an individual, such as passcodes to enter secure buildings or available
recognition on a credit card.

• SuperDisk: Imation Corporation developed the disk storage technology.


SuperDisk is also known as a LS-240 and LS-120. The drive was most
popular with OEM computers and able to store up to 120 MB (Megabyte) on
a single disk. Later, it was capable of storing 240 MB and also backward
compatible with 1.44 MB disks.

• Tape cassette: A tape is a rectangular and flat container that is capable of


storing data. As compared to other storage media, it is less expensive and
commonly used for backing up a huge amount of data.
• Zip diskette: A Zip drive is a hardware data storage device that is an
advanced version of the floppy disk. Its functions like a diskette and
standard 1.44" floppy drive and developed by Iomega. It became very
popular in the late 1990s and capable of storing data that was not possible
with ordinary floppy disks.

Optical storage devices


Another type of storage devices are given below:

• Blu-ray disc

• CD-ROM disc

• CD-R and CD-RW disc.

• DVD-R, DVD+RW, DVD+R, and DVD-RW disc.

Flash memory devices


Flash memory is cheaper as well as portable. Due to become more reliable and
efficient solution, most magnetic and optical media have replaced by flash memory
device.
• Flash drive: A USB flash drive is a portable storage device used for data
storage that is also known as pen drive, thumb drive, data stick, keychain
drive. They are connected to a computer via a USB port and often the size of
a human thumb.

• Memory card: A memory card is commonly used in digital cameras,


printers, MP3 players, PDAs, digital camcorders, game consoles, and
handheld computers. The most common memory card format was
CompactFlash for many years, but today are CFexpress, SD, MicroSD, and
XQD.

• Compact Flash (CF): Compact Flash is a type of flash memory that is


commonly found in digital cameras, PDAs and other portable devices. It is a
50-pin connection storage device that is capable of storing data ranging from
2 MB to 128 GB.

• 2: M.2 is a solid-state drive, introduced in 2014.There are two types of


M.2 devices; SATA M.2 and PCIe M.2.

• MultiMediaCard: A MultiMediaCard or MMC is an Integrated Circuit that


is used in car radios, printers, PDAs, MP3 players, and digital cameras. It
acts as external storage for data. The MMCP (MMCplus) and MMCM
(MMCmobile / MMCmicro) are the variations of the MMC card.
• SDHC card (Secure Digital High Capacity): It uses new technology and
an improved version of the standard SD card. It is not backward compatible
with SD format devices and has the ability to store data in a range from 4
GB to 32 GB.

• NVMe (Non-Volatile Memory Express): It is a device specification that is


designed for data centers and standardizes the way devices like SSDs can be
connected to a computer's PCI Express bus, introduced by Intel in 2007.

• Sony Memory Stick: Sony Memory Stick is a family of flash memory


cards, first introduced by Sony in October 1998. It is designed for digital storage
in cameras and other Sony products.

• SmartMedia Card: A SmartMedia card is a memory card developed by


Toshiba that is also known as a solid-state floppy disk card.

• xD-Picture Card (EXtreme Digital Picture Card): The xD-Picture Card is


a flash memory card that is introduced by Olympus and Fuji in 2002. In
2003, until the Mini SD card was introduced, the xD cards were the smallest
flash memory cards available on the market. H and M/M+ versions of the
xD-Picture Card had a capacity of up to 2 GB and the original version up to
512 MB.

• SSD: An SSD is a storage medium that is similar to a hard disk drive


(HDD). Even without power, it has the ability to maintain stored data in a
permanent state. It has higher reliability, noiseless operation, lower power
consumption, and faster access time because it has no moving parts, unlike a
hard drive.

• SD Card: An SD Card, stands for Secure Digital Card, is most commonly


used with electronics that are designed to offer high- capacity memory with
small size. It is often used in small portable devices like cell phones, digital
cameras, digital video camcorders, mp3 players, etc. It is used by more than
400 brands of electronic devices.

Online and cloud storage


The need to store data online and in cloud storage is increasing rapidly.
• Cloud storage: Cloud storage is a cloud computing model that transmits
and holds data on remote storage systems where a cloud computing provider
manages, maintains, and made available data to users over a network. It
offers users the reliability, confidentiality, durability, and 'access data
anytime'.

• Network media: Network media is used on a computer network such as the


Internet, as it is any audio, video, images or text.

Paper storage
Initially, computers were not able to store data on any storage technologies, like
flash memory devices, optical storage devices; they had to depend on paper. In
modern times, the method of paper storage to store data is rarely used or found.

• Punch card: A punch card is also known as Hollerith cards or IBM cards
that are able to store data in the form of small punched holes. It is a simple
piece of paper stock that was widely used to input data into early computers.

• OMR: It stands for optical mark recognition or optical mark reading. It is a


method of extracting data from human beings by identifying certain
markings on a document, such as checkboxes and fill-infields, on printed
forms. Generally, the OMR process is accomplished by scanning that detects
a reflection or transmission with the help of a piece of paper. This
technology provides advantages for applications such as ballots, reply cards,
surveys, and questionnaires as they need a large amount of hand-filled forms
to be processed quickly and with accuracy.

Introduction to Programming Language


Programming Language
As we know, to communicate with a person, we need a specific language, similarly to
communicate with computers, programmers also need a language is called Programming
language.
Before learning the programming language, let's understand what is language?

What is Language?
Language is a mode of communication that is used to share ideas, opinions with each other.
For example, if we want to teach someone, we need a language that is understandable by both
communicators.

What is a Programming Language?


A programming language is a computer language that is used by programmers (developers)
to communicate with computers. It is a set of instructions written in any specific language ( C,
C++, Java, Python) to perform a specific task.
A programming language is mainly used to develop desktop applications, websites, and
mobile applications.

Types of programming language


1. Low-level programming language
Low-level language is machine-dependent (0s and 1s) programming language. The processor
runs low- level programs directly without the need of a compiler or interpreter, so the programs
written in low-level language can be run very fast.
Low-level language is further divided into two parts -
i. Machine Language
Machine language is a type of low-level programming language. It is also called as
machine code or object code. Machine language is easier to read because it is normally
displayed in binary or hexadecimal form (base 16) form. It does not require a translator to
convert the programs because computers directly understand the machine language programs.
The advantage of machine language is that it helps the programmer to execute the programs
faster than the high-level programming language.
ii. Assembly Language
Assembly language (ASM) is also a type of low-level programming language that is designed for
specific processors. It represents the set of instructions in a symbolic and human-
understandable form. It uses an assembler to convert the assembly language to machine
language.
The advantage of assembly language is that it requires less memory and less execution time to
execute a program.
2. High-level programming language
High-level programming language (HLL) is designed for developing user-friendly software
programs and websites. This programming language requires a compiler or interpreter to
translate the program into machine language (execute the program).
The main advantage of a high-level language is that it is easy to read, write, and maintain.
High-level programming language includes Python, Java, JavaScript, PHP, C#, C++,
Objective C, Cobol, Perl, Pascal, LISP, FORTRAN, and Swift programming language.
A high-level language is further divided into three parts -
i. Procedural Oriented programming language
Procedural Oriented Programming (POP) language is derived from structured programming and
based upon the procedure call concept. It divides a program into small procedures called
routines or functions.
Procedural Oriented programming language is used by a software programmer to create a
program that can be accomplished by using a programming editor like IDE, Adobe
Dreamweaver, or Microsoft Visual Studio.
The advantage of POP language is that it helps programmers to easily track the program flow
and code can be reused in different parts of the program.
The advantage of POP language is that it helps programmers to easily track the program flow and
code can be reused in different parts of the program.
Example: C, FORTRAN, Basic, Pascal, etc.
ii. Object-Oriented Programming language
Object-Oriented Programming (OOP) language is based upon the objects. In this
programming language, programs are divided into small parts called objects. It is used to
implement real-world entities like inheritance, polymorphism, abstraction, etc in the program to
makes the program resusable, efficient, and easy-to-use.
The main advantage of object-oriented programming is that OOP is faster and easier to execute,
maintain, modify, as well as debug.
Note: Object-Oriented Programming language follows a bottom-up approach.
Example: C++, Java, Python, C#, etc.
iii. Natural language
Natural language is a part of human languages such as English, Russian, German, and
Japanese. It is used by machines to understand, manipulate, and interpret human's language. It is
used by developers to perform tasks such as translation, automatic summarization, Named
Entity Recognition (NER), relationship extraction, and topic segmentation.
The main advantage of natural language is that it helps users to ask questions in any subject and
directly respond within seconds.
3. Middle-level programming language
Middle-level programming language lies between the low-level programming language and
high-level programming language. It is also known as the intermediate programming language
and pseudo-language.
A middle-level programming language's advantages are that it supports the features of high-level
programming, it is a user-friendly language, and closely related to machine language and human
language.
Example: C, C++, language

Most commonly used Programming Language


As we all know, the programming language makes our life simpler. Currently, all sectors (like
education, hospitals, banks, automobiles, and more ) completely depend upon the programming
language.
There are dozens of programming languages used by the industries. Some most widely used
programming languages are given below -
1. Python

Python is one of the most widely used user-friendly programming languages. It is an open-source
and easy to learn programming language developed in the 1990s. It is mostly used in
Machine learning,Artificial intelligence, Big Data, GUI based desktop applications, and
Robotics.
Advantages
• Python is easy to read, easy to understand, and easy to write.

• It integrates with other programming languages like C, C++, and Java.

• Python executes code line-by-line, so it is easy for the programmer to find the error that occurred
in the code.

• Python is platform-independent means you can write code once and run it anywhere.
Disadvantages
• Python is not suitable for developing mobile applications and games.

• Python works with the interpreter. That's why it is slower than other programming
languages like C and C++.

2. Java

java is a simple, secure, platform-independent, reliable, architecture-neutral high-level


programming language developed by Sun Microsystems in 1995. Now, Java is owned by
Oracle. It is mainly used to develop bank, retail, information technology, android, big data,
research community, web, and desktop applications.
Advantages
• Java is easy to write, compile, learn, and debug as compared to other programming
languages.

• It provides an ability to run the same program on different platforms.

• It is a highly secured programming language because in java, there is no concept of explicit


pointers.

• It is capable of performing multiple tasks at the same time.

Disadvantages
• Java consumes more memory and slower than other programming languages like C or C++.

• It does not provide a backup facility.

3. C

C is a popular, simple, and flexible general-purpose computer programming language.


Dennis M Ritchie develops it in 1972 at AT&T. It is a combination of both low-level
programming language as well as a high-level programming language. It is used to design
applications like Text Editors, Compilers, Network devices, and many more.
Advantages
• C language is easy to learn.

• It is fast, efficient, portable, easy to extend, powerful, and flexible programming language.

• It is used to perform complex calculations and operations such as MATLAB.

• It provides dynamic memory allocation to allocate memory at the run time.

Disadvantages
• In the C programming language, it is very difficult to find the errors.

• C does not support the concepts of constructors, destructors, abstraction, polymorphism,


encapsulation, and namespace like OOPs.

4. C++

C++ is one of the thousands of programming languages that we use to develop software. C++
programming language is developed by Bjarne Stroustrup in 1980. It is similar to the C
programming language but also includes some additional features such as exception
handling, object-oriented programming, type checking, etc.
Advantages
• C++ is a simple and portable structured programming language.

• It supports OOPs features such as Abstraction, Inheritance, Encapsulation.

• It provides high-level abstraction and useful for a low-level programming language, and more
efficient for general-purpose.

• C++ is more compatible with the C language.

Disadvantages
• C++ programming language is not secured as compared to other programming languages like
Java or Python.

• C++ can not support garbage collection.

• It is difficult to debug large as well as complex web applications.

5. C#
C# (pronounced as C sharp) is a modern, general-purpose, and object-oriented programming
language used with XML based Web services on the .NET platform. It is mainly designed to
improve productivity in web applications. It is easier to learn for those users who have sufficient
knowledge of common programming languages like C, C++, or Java.

Advantages
• C# is a modern, type-safe, easy, fast, and open-source programming language that is easily
integrated with Windows.

• The maintenance of C# (C sharp) is lower than the C++ programming language.

• C# is a pure object-oriented programming language.

• C# includes a strong memory backup facility. That's why it avoids the problem of memory
leakage.

Disadvantages
• C# is less flexible because it is completely based on Microsoft .Net framework.

• In C#, it is difficult to write, understand, debug, and maintain multithreaded applications.


6. JavaScript

javascript is a type of scripting language that is used on both client-side as well as a server-side.
It is developed in the 1990s for the Netscape Navigator web browser. It allows programmers to
implement complex features to make web pages alive. It helps programmers to create dynamic
websites, servers, mobile applications, animated graphics, games, and more.
Advantage
• JavaScript helps us to add behavior and interactivity on the web page.

• It can be used to decrease the loading time from the server.


• It has the ability to create attractive, dynamic websites, and rich interfaces.

• JavaScript is a simple, versatile, and lightweight programming language.

• JavaScript and its syntax are easy to understand.

Disadvantage
• JavaScript is completely based on the browser.

• It does not support multiple inheritance.

7. It is less secure compared to other programming languages.R

Currently, R programming is one of the popular programming languages that is used in data
analytics, scientific research, machine learning algorithms, and statistical computing. It is
developed in 1993 by Ross Ihaka and Robert Gentleman. It helps marketers and data scientists to
easily analyze, present, and visualize data.
Advantages
• R programming provides extensive support for Data Wrangling.

• It provides an easy-to-use interface.

• It runs on any platform like Windows, Linux, and Mac.

• It is an open-source and platform-independent programming language.

Disadvantages
• R programming does not support 3D graphics.

• It is slower than other programming languages.

8. PHP
PHP stands for Hypertext Preprocessor. It is an open-source, powerful server-side scripting
language mainly used to create static as well as dynamic websites. It is developed by Rasmus
Laird in 1994. Inside the php, we can also write HTML, CSS and javascript code. To save php
file, file extension .php is used.
Advantages
• PHP is a more secure and easy-to-use programming language.

• It supports powerful online libraries.

• It can be run on a variety of operating systems such as Windows, Linux, and Mac.

• It provides excellent compatibility with cloud services.

Disadvantages
• PHP is not capable of handling a large number of applications and not suitable for large
applications.

• It is quite difficult to maintain.

9. Go

Go or Golang is an open-source programming language. It is used to build simple, reliable,


and efficient software. It is developed by Robert Griesemer, Rob Pike, and Ken Thompson in
2007.
Advantages
• Go language is easy-to-learn and use.

• It comes with the in-built testing tools.

• Go is a fast programming language.

Disadvantages
• Go language does not support generics.

• It does not support error handling.

• It supports a lack of frameworks.

10. Ruby
Ruby is an open-source, general-purpose, and pure object-oriented programming language
released in 1993. It is used in front-end and back-end web development. It is mainly designed to
write CGI (Common Gateway Interface) scripts.
Advantages
• Ruby supports various GUI (Graphical User Interface) tools like GTK and OpenGL.

• It is used to develop both internet as well as intranet applications.

• The code written in Ruby is small and contains less number of lines.

Disadvantages
• Ruby is slower than other programming languages.

• It is very difficult for programmers to debug the code written in Ruby.

Introduction to Compiler
• A compiler is a translator that converts the high-level language into the machine language.

• High-level language is written by a developer and machine language can be understood by the
processor.

• Compiler is used to show errors to the programmer.


• The main purpose of compiler is to change the code written in one language without
changing the meaning of the program.

• When you execute a program which is written in HLL programming language then it
executes into two parts.

• In the first part, the source program compiled and translated into the object program (low level
language).

• In the second part, object program translated into the target program through the
assembler.

Fig: Execution process of source program in Compiler

Introduction to Interpreter
All high level languages need to be converted to machine code so that the computer can understand the program after
taking the required inputs. The software by which the conversion of the high level instructions is performed line- by-line to
machine level language, other than compiler and assembler, is known as INTERPRETER. If an error is found on any line,
the execution stops till it is corrected. This process of correcting errors is easier as it gives line-by-line error but the program
takes more time to execute successfully. Interpreters were first used in 1952 to ease programming within the limitations of
computers at the time. It translates source code into some efficient intermediate representation and immediately execute
this.

Source programs are compiled ahead of time and stored as machine independent code, which is then linked at run-time and
executed by an interpreter. An Interpreter is generally used in micro computer. It helps the programmer to find out the
errors and to correct them before control moves to the next statement. Interpreter system performs the actions described by
the high level program. For interpreted programs, the source code is needed to run the program every time. Interpreted
programs run slower than the compiled programs. Self-Interpreter is a programming language interpreter which is written in
a language which can interpret itself. For Example- BASIC interpreter written in BASIC. They are related to self-hosting
compilers. Some languages have an elegant and self-interpreter such as Lisp and Prolog. Need of an Interpreter : The first
and vital need of an interpreter is to translate source code from high-level language to machine language. However, for this
purpose Compiler is also there to satisfy this condition. The compiler is a very powerful tool for developing programs in
high-level language. However, there are several demerits associated with the compiler. If the source code is huge in size,
then it might take hours to compile the source code, which will significantly increase the compilation duration. Here,
Interpreter plays its role. They can cut this huge compilation duration. They are designed to translate single instruction at a
time and execute them immediately. Advantage and Disadvantage of Interpreter :
Advantage of interpreter is that it is executed line by line which helps users to find errors easily.
Disadvantage of interpreter is that it takes more time to execute successfully than compiler.
Applications of Interpreters :
Each operator executed in a command language is usually an invocation of a complex routine, such as an editor or compiler
so they are frequently used to command languages and glue languages.
Virtualization is often used when the intended architecture is unavailable.
Sand-boxing
Self-modifying code can be easily implemented in an interpreted language.
Emulator for running Computer software written for obsolete and unavailable hardware on more modern equipment.
Some examples of programming languages that use interpreters are Python, Ruby, Perl, PHP and Matlab. Top Interpreters
according to the computer languages –
Python- CPython, PyPy, Stackless Python, IronPython Ruby- YARV, Ruby MRI (CRuby)
JAVA- HotSpot, OpenJ9, JRockIt Kotlin- JariKo

Introduction to Dubugger
Debugging is the process of detecting and removing of existing and potential errors (also called
as ‘bugs’) in a software code that can cause it to behave unexpectedly or crash. To prevent
incorrect operation of a software or system, debugging is used to find and resolve bugs or
defects. When various subsystems or modules are tightly coupled, debugging becomes harder as
any change in one module may cause more bugs to appear in another. Sometimes it takes more
time to debug a program than to code it.

Introduction to Linker
A linker is a program in a system, also known as a link editor and binder, which combines
object modules into a single object file. Generally, it is a program that performs the process of
linking; it takes one or multiple object files, which are generated by compiler. And, then
combines these files into an executable files. Modules are called for the different pieces of code,
which are written in programming languages. Linking is a process that helps to gather and
maintain a different piece of code into an executable file or single file. With the help of a linker,
a specific module is also linked into the system library.

The primary function of the linker is to take objects from the assembler as input and create an
executable file as output for the loader, as it helps to break down a large problem into a small
module that simplifies the programming task. Usually, computer programs are made up of
various modules in which all being a compiled computer programs and span separate object
files. The whole program refers to these different compiled modules with the help of using
symbols.
These separate files are combined by linker into a single executable file. The source code is
converted into machine code, and the linking is performed at the last step while compiling the
program.
Source code -> compiler -> Assembler -> Object code -> Linker -> Executable file ->
Loader

The objects can be collected by linker from a library or runtime library. Most of the linker only
consists of files in the output that are referenced by other libraries or object files, and they do not
include the whole library. The process of library linking requires additional modules to be linked
with some referenced modules; thus, it may be an iterative process. Generally, one or more than
one system libraries are linked by default, and libraries are available for different purposes.
In the program's address space, the arranging of the objects is also handled by the linker. The
compiler often assumes a fixed base location (like zero), as it seldom knows about the object
location where it will reside. The loads, store, and re-targeting of absolute jumps may be
involved in the relocating machine code. When the executable output produced by the linker is
finally loaded into memory, it may require other relocation pass. Usually, this pass is omitted on
the hardware, hardware that offers virtual memory. There is no conflict even at the time all
programs load at the same base address because each program is put into its own address space.
If the executable file is a position-independent executable, this pass is also omitted on this file.

Introduction to Loader
A loader is a major component of an operating system that ensures all necessary programs and libraries
are loaded, which is essential during the startup phase of running a program. It places the libraries and
programs into the main memory in order to prepare them for execution. Loading involves reading the
contents of the executable file that contains the instructions of the program and then doing other
preparatory tasks that are required in order to prepare the executable for running, all of which takes
anywhere from a few seconds to minutes depending on the size of the program that needs to run.

The following are the responsibilities of a loader:


• Validate the program for memory requirements, permissions, etc.
• Copy necessary files, such as the program image or required libraries, from the disk into
the memory
• Copy required command-line arguments into the stack
• Link the starting point of the program and link any other required library
• Initialize the registers
• Jump to the program starting point in memory

Introduction to Assembler
The Assembler is a Software that converts an assembly language code to machine code. It takes
basic Computer commands and converts them into Binary Code that Computer’s Processor can
use to perform its Basic Operations. These instructions are assembler language or assembly
language.

We can also name an assembler as the compiler of assembly language. This is because a compiler
converts the high-level language to machine language. On the other hand, an assembler is doing
the same task but, for assembly language, the name compiler of assembly language.

What is an Assembly Language?

An assembly language is a low-level language. It gives instructions to the processors for different
tasks. It is specific for any processor. The machine language only consists of 0s and 1s therefore,
it is difficult to write a program in it. On the other hand, the assembly language is close to a
machine language but has a simpler language and code.
We can create an assembly language code using a compiler or, a programmer can write it directly.
Mostly, programmers use high-level languages but, when more specific code is required,
assembly language is used. It uses opcode for the instructions.
An opcode basically gives information about the particular instruction. The symbolic
representation of the opcode (machine level instruction) is called mnemonics.
Programmers use them to remember the operations in assembly language. For

example ADD A,B

Here, ADD is the mnemonic that tells the processor that it has to perform additional function.
Moreover, A and B are the operands. Also, SUB, MUL, DIVC, etc. are other mnemonics.

Types of Assembler

Assemblers generate instruction. On the basis of a number of phases used to convert to machine
code, assemblers have two types:

1. One-Pass Assembler
These assemblers perform the whole conversion of assembly code to machine code in one go.

2. Multi-Pass/Two-Pass Assembler
These assemblers first process the assembly code and store values in the opcode table and
symbol table. And then in the second step, they generate the machine code using these tables.

a) Pass 1
• Symbol table and opcode tables are defined.

• keep the record of the location counter.

• Also, processes the pseudo instructions.


b) Pass 2
• Finally, converts the opcode into the corresponding numeric opcode.

• Generates machine code according to values of literals and symbols.


Some Important Terms
• Opcode table: They store the value of mnemonics and their corresponding
numeric values.
• Symbol table: They store the value of programming language symbols used by the
programmer, and their corresponding numeric values.
• Location Counter: It stores the address of the location where the current
instruction will be stored.
Browse more Topics under System Software
• Operating system

• Compiler

• Interpreter
Differences Between Compiler and Assembler

Compiler Assembler

Compiler converts the high-level An assembler converts the assembly


language source code into machine level language code into the machine
level language code. level language code.

The input of a compiler is high-level Where as, its input is low level
language source code. assembly code.

Compiler converts the whole source Assembler does not convert the code in
code to machine code at once. one go.

It has the following phases: lexical


analysis, syntax analysis, semantic
An assembler completes the task in
analysis, intermediate code generation,
two passes.
code optimization, code generation and
error handling.

It produces a machine code in form of It produces binary code in form of 0s


mnemonics. and 1s.

Examples are Java, C, C++ etc. Examples of assemblers are GAS,


compilers. GNU etc.

Problem Analysis: Problem solving techniques


1. Define the problem

Diagnose the situation so that your focus is on the problem, not just its symptoms. Helpful
problem-solving techniques include using flowcharts to identify the expected steps of a
process and cause and effect to define and analyze root causes.
The sections below help explain key problem-solving steps. These steps support the involvement
of interested parties, the use of factual information, comparison of expectations to reality, and a
focus on root causes of a problem. You should begin by:
• Reviewing and documenting how processes currently work (i.e., who does what, with
what information, using what tools, communicating with what organizations and
individuals, in what time frame, using what format).
• Evaluating the possible impact of new tools and revised policies in the
development of your "what should be" model.
2. Generate alternative solutions

Postpone the selection of one solution until several problem-solving alternatives have been
proposed. Considering multiple alternatives can significantly enhance the value of your ideal
solution. Once you have decided on the "what should be" model, this target standard becomes
the basis for developing a road map for investigating
alternatives. Brainstorming and team problem-solving techniques are both useful tools in this
stage of problem solving.
Many alternative solutions to the problem should be generated before final evaluation. A
common mistake in problem solving is that alternatives are evaluated as they are proposed, so
the first acceptable solution is chosen, even if it’s not the best fit. If we focus on trying to get the
results we want, we miss the potential for learning something new that will allow for real
improvement in the problem-solving process.
3. Evaluate and select an alternative

Skilled problem solvers use a series of considerations when selecting the best alternative. They
consider the extent to which:
• A particular alternative will solve the problem without causing other unanticipated
problems.
• All the individuals involved will accept the alternative.
• Implementation of the alternative is likely.
• The alternative fits within the organizational constraints.
4. Implement and follow up on the solution

Leaders may be called upon to direct others to implement the solution, "sell" the solution, or
facilitate the implementation with the help of others. Involving others in the implementation is
an effective way to gain buy-in and support and minimize resistance to subsequent changes.
Regardless of how the solution is rolled out, feedback channels should be built into the
implementation. This allows for continuous monitoring and testing of actual events against
expectations. Problem solving, and the techniques used to gain clarity, are most effective if the
solution remains in place and is updated to respond to future changes.

Algorithm and Flowchart Representation


The algorithm and flowchart are two types of tools to explain the process of a program. In this
page, we discuss the differences between an algorithm and a flowchart and how to create a
flowchart to illustrate the algorithm visually.
Algorithms and flowcharts are two different tools that are helpful for creating new programs,
especially in computer programming. An algorithm is a step-by-step analysis of the process,
while a flowchart explains the steps of a program in a graphical way.
Part 1: Definition of Algorithm
Writing a logical step-by-step method to solve the problem is called the algorithm. In other
words, an algorithm is a procedure for solving problems. In order to solve a mathematical or
computer problem, this is the first step in the process.
An algorithm includes calculations, reasoning, and data processing. Algorithms can be presented
by natural languages, pseudocode, and flowcharts, etc.
Part 2: Definition of Flowchart
A flowchart is the graphical or pictorial representation of an algorithm with the help of different
symbols, shapes, and arrows to demonstrate a process or a program. With algorithms, we can
easily understand a program. The main purpose of using a flowchart is to analyze different
methods. Several standard symbols are applied in a flowchart:

Terminal Box - Start / End

Input / Output

Process / Instruction

Decision

Connector / Arrow

The symbols above represent different parts of a flowchart. The process in a flowchart can be
expressed through boxes and arrows with different sizes and colors. In a flowchart, we can easily
highlight certain elements and the relationships between each part.
Part 3: Difference between Algorithm and Flowchart
If you compare a flowchart to a movie, then an algorithm is the story of that movie. In other
words, an algorithm is the core of a flowchart. Actually, in the field of computer
programming, there are many differences between algorithm and flowchart regarding various
aspects, such as the accuracy, the way they display, and the way people feel about them. Below
is a table illustrating the differences between them in detail.
Algorithm Flowchart

It is a procedure for solving problems. It is a graphic representation of a process.

The process is shown in step-by-step The process is shown in block-by-block


instruction. information diagram.
It is complex and difficult to
It is intuitive and easy to understand.
understand.

It is convenient to debug errors. It is hard to debug errors.

The solution is showcased in natural


The solution is showcased in pictorial format.
language.

It is somewhat easier to solve


It is hard to solve complex problem.
complex problem.

It costs more time to create an


It costs less time to create a flowchart.
algorithm.

Part 4: Types of Algorithm


It is not surprising that algorithms are widely used in computer programming. However, it can
be applied to solving mathematical problems and even in everyday life. Here comes a question:
how many types of algorithms? According to Dr. Christoph Koutschan, a computer scientist
working at the Research Institute for Symbolic Computation (RISC) in Austria, he has surveyed
voting for the important types of algorithms. As a result, he has listed 32 crucial algorithms in
computer science. Despite the complexity of algorithms, we can generally divide algorithms into
six fundamental types based on their function.
1. Recursive Algorithm
It refers to a way to solve problems by repeatedly breaking down the problem into sub-
problems of the same kind. The classic example of using a recursive algorithm to solve
problems is the Tower of Hanoi.
2. Divide and Conquer Algorithm
Traditionally, the divide and conquer algorithm consists of two parts: 1. breaking down a
problem into some smaller independent sub-problems of the same type; 2. finding the final
solution of the original issues after solving these more minor problems separately.
The key points of the divide and conquer algorithm are:
• If you can find the repeated sub-problems and the loop substructure of the original
problem, you may quickly turn the original problem into a small, simple issue.
• Try to break down the whole solution into various steps (different steps need
different solutions) to make the process easier.
• Are sub-problems easy to solve? If not, the original problem may cost lots of time.
3. Dynamic Programming Algorithm
Developed by Richard Bellman in the 1950s, the dynamic programming algorithm is generally
used for optimization problems. In this type of algorithm, past results are collected for future
use. Like the divide and conquer algorithm, a dynamic programming algorithm simplifies a
complex problem by breaking it down into some simple sub- problems. However, the most
significant difference between them is that the latter requires overlapping sub-problems, while
the former doesn’t need to.
4. Greedy Algorithm
This is another way of solving optimization problems – greedy algorithm. It refers to always
finding the best solution in every step instead of considering the overall optimality. That is to
say, what he has done is just at a local optimum. Due to the limitations of the greedy algorithm,
it has to be noted that the key to choosing a greedy algorithm is whether to consider any
consequences in the future.
5. Brute Force Algorithm
The brute force algorithm is a simple and straightforward solution to the problem, generally
based on the description of the problem and the definition of the concept involved. You can also
use "just do it!" to describe the strategy of brute force. In short, a brute force algorithm is
considered as one of the simplest algorithms, which iterates all possibilities and ends up with a
satisfactory solution.
6. Backtracking Algorithm
Based on a depth-first recursive search, the backtracking algorithm focusing on finding the
solution to the problem during the enumeration-like searching process. When it cannot satisfy
the condition, it will return “backtracking” and tries another path. It is suitable for solving large
and complicated problems, which gains the reputation of the“general solution method.” One of
the most famous backtracking algorithm example it the eight queens puzzle.
Part 5: Use Flowcharts to Represent Algorithms
Now that we have learned the definitions of algorithm and flowchart, how can we use a
flowchart to represent an algorithm? To create an algorithm flowchart, we need to use a handy
diagramming tool like EdrawMax to finish the work.
Algorithms are mainly used for mathematical and computer programs, whilst flowcharts can be
used to describe all sorts of processes: business, educational, personal, and algorithms. So
flowcharts are often used as a program planning tool to organize the program's step-by-step
process visually. Here are some examples:
Example 1: Print 1 to 20:
Algorithm:
• Step 1: Initialize X as 0,
• Step 2: Increment X by 1,
• Step 3: Print X,
• Step 4: If X is less than 20 then go back to step 2.
Flowchart:
Example 2: Convert Temperature from Fahrenheit (℉) to Celsius (℃)
Algorithm:
• Step 1: Read temperature in Fahrenheit,
• Step 2: Calculate temperature with formula C=5/9*(F-32),
• Step 3: Print C.
Flowchart:
Example 3: Determine Whether A Student Passed the Exam or Not:
Algorithm:
• Step 1: Input grades of 4 courses M1, M2, M3 and M4,
• Step 2: Calculate the average grade with formula "Grade=(M1+M2+M3+M4)/4"
• Step 3: If the average grade is less than 60, print "FAIL", else print "PASS".

Flowchart:

Part 6: Conclusion
From the above, we can come to the conclusion that a flowchart is a
pictorial representation of an algorithm, an algorithm can be expressed and
analyzed through a flowchart. An algorithm shows you every step of
reaching the final solution, while a flowchart shows you how to carry out
the process by connecting each step. An algorithm uses mainly words to
describe the steps while you can create a flowchart with flowchart symbols
to make the process more logical.

You might also like