Pps Unit 1
Pps Unit 1
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.
• 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.
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
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
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,
0 1 0
1 0 0
1 1 1
0 0 Not defined
0 1 0
1 0 Not defined
1 1 1
+ 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.
+ 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.
• 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.
• 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.
• 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.
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:
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
• 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.
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.
• Laser printers are bulky as they required the laser technology and
imaging drum.
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 .
Disadvantages of 3D printer:
• Its initial and resin costs are high.
• 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.
• 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.
• 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 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.
• 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.
• It creates high noise when the pins hit the ribbon to the paper.
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.
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.
• 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.
• These types of printers are easy to use as they have fewer buttons, including
the use of software.
• 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.
• 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.
• 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.
Storage Devices
• 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.
• Blu-ray disc
• CD-ROM disc
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.
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.
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.
• 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
Disadvantages
• Java consumes more memory and slower than other programming languages like C or C++.
3. C
• It is fast, efficient, portable, easy to extend, powerful, and flexible programming language.
Disadvantages
• In the C programming language, it is very difficult to find the errors.
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 provides high-level abstraction and useful for a low-level programming language, and more
efficient for general-purpose.
Disadvantages
• C++ programming language is not secured as compared to other programming languages like
Java or Python.
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.
• 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.
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.
Disadvantage
• JavaScript is completely based on the browser.
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.
Disadvantages
• R programming does not support 3D graphics.
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 can be run on a variety of operating systems such as Windows, Linux, and Mac.
Disadvantages
• PHP is not capable of handling a large number of applications and not suitable for large
applications.
9. Go
Disadvantages
• Go language does not support generics.
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.
• The code written in Ruby is small and contains less number of lines.
Disadvantages
• Ruby is slower than other programming languages.
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.
• 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.
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.
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.
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
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.
• Compiler
• Interpreter
Differences Between Compiler and Assembler
Compiler Assembler
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.
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.
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
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.