CP Unit 1 New
CP Unit 1 New
UNIT - I
Syllabus: History and Hardware - Computer Hardware, Bits and Bytes, Components,
Programming Languages - Machine Language, Assembly Language, Low- and High-Level
Languages, Procedural and Object-Oriented Languages, Application and System Software,
the Development of C Algorithms The Software Development Process
DAY-1
1. Define computer? What are the various terms that are used in computer?
The term "computer" is derived from Latin word "computare" which means to calcu-
late. Computer is a programmable electronic device that accepts raw data as input and pro-
cesses it with set of instructions to produce result as output. It renders output just after per-
forming mathematical and logical operations. The device also has memory that stores the
data, programs and result of processing.
It is believed that Analytical Engine was the first computer. It was invented by Charles Bab-
bage in 1837. Charles Babbage is also considered as the father of computer.
The various terms used in computer are such as Data, Processing and Information.
1. DATA: - “Data” is nothing but a mere collection of basic facts and figure without any
sequence. When the data is collected as facts and figure, it has no meaning at that time, for
example, name of student, names of employees etc.
2. PROCESSING: - ‘Processing’ is the set of instruction given by the user or the related data
to output the meaningful information. Which can be used by the user? The work of
processing may be the calculation, comparisons or the decision taken by the computer.
3. INFORMATION: - ‘Information ’is the end point or the final output of any processed work.
When the output data is meaning it is called information.
2. Explain the History of computers.
The first counting device was used by the primitive people. They used sticks, stones
and bones as counting tools. As human mind and technology improved with time more com-
puting devices were developed. Some of the popular computing devices starting with the
first to recent ones are described below;
Abacus:
1
The history of computer begins with the birth of abacus which is believed to be the first
computer. It is said that Chinese invented Abacus around 4,000 years ago.
It was a wooden rack which has metal rods with beads mounted on them. The beads were
moved by the abacus operator according to some rules to perform arithmetic calculations.
Abacus is still used in some countries like China, Russia and Japan. An image of this tool is
shown below;
Napier's bones:
It was a manually-operated calculating device which was invented by John Napier
(1550-1617) of Merchiston. In this calculating tool, he used 9 different ivory strips or bones
marked with numbers to multiply and divide. So, the tool became known as "Napier's
Bones. It was also the first machine to use the decimal point.
Pascaline:
Pascaline is also known as Arithmetic Machine or Adding Machine. It was invented
between 1642 and 1644 by a French mathematician-philosopher Biaise Pascal. It is believed
that it was the first mechanical and automatic calculator.
Pascal invented this machine to help his father, a tax accountant. It could only perform addi-
tion and subtraction. It was a wooden box with a series of gears and wheels. When a wheel
is rotated one revolution, it rotates the neighboring wheel. A series of windows is given on
the top of the wheels to read the totals. An image of this tool is shown below;
Stepped Reckoner or Leibnitz wheel :
It was developed by a German mathematician-philosopher Gottfried Wilhelm Leibn-
itz in 1673. He improved Pascal's invention to develop this machine. It was a digital mechan-
ical calculator which was called the stepped reckoner as instead of gears it was made of
fluted drums. See the following image;
2
Difference Engine:
In the early 1820s, it was designed by Charles Babbage who is known as "Father of
Modern Computer". It was a mechanical computer which could perform simple calculations.
It was a steam driven calculating machine designed to solve tables of numbers like logarithm
tables.
Analytical Engine:
This calculating machine was also developed by Charles Babbage in 1830. It was a
mechanical computer that used punch-cards as input. It was capable of solving any mathem-
atical problem and storing information as a permanent memory.
Tabulating Machine:
It was invented in 1890, by Herman Hollerith, an American statistician. It was a
mechanical tabulator based on punch cards. It could tabulate statistics and record or sort
data or information. This machine was used in the 1890 U.S. Census. Hollerith also started
the Hollerith’s Tabulating Machine Company which later became International Business Ma-
chine (IBM) in 1924.
Differential Analyzer:
It was the first electronic computer introduced in the United States in 1930. It was an
analog device invented by Vannevar Bush. This machine has vacuum tubes to switch elec-
trical signals to perform calculations. It could do 25 calculations in few minutes.
Mark I :
The next major changes in the history of computer began in 1937 when Howard
Aiken planned to develop a machine that could perform calculations involving large num-
3
bers. In 1944, Mark I computer was built as a partnership between IBM and Harvard. It was
the first programmable digital computer.
4
The second generation computers used transistors. The scientists at Bell laboratories
developed transistor in 1947. The size of the computers was decreased by replacing vacuum
tubes with transistors. The examples of second generation computers are IBM 7094 series,
IBM 1400 series and CDC 164 etc.
Advantages:
i. Smaller in size as compared to the first generation computers.
ii. The 2nd generation Computers were more reliable
iii. Used less energy and were not heated.
Disadvantages:
i. Cooling system was required
ii. Constant maintenance was required
iii. Commercial production was difficult
Third Generation Computers (1964-1975)
The Third generation computers used the integrated circuits (IC). It was an important
invention in the computer field. The first IC was invented and used in 1961. A single IC chip
may contain thousands of transistors. The computer became smaller in size, faster, more
reliable and less expensive. The examples of third generation computers are IBM 370, IBM
System/360, UNIVAC 1108 and UNIVAC AC 9000 etc.
Advantages:
i. Smaller in size as compared to previous generations.
ii. More reliable.
iii. Used less energy
Disadvantages:
i. Air conditioning was required.
ii. Highly sophisticated technology required for the manufacturing of IC chips.
Fourth Generation Computers (1975-Present)
The fourth generation computers started with the invention of Microprocessor. The
Microprocessor contains thousands of ICs. The LSI (Large Scale Integration) circuit and VLSI
(Very Large Scale Integration) circuit was designed. It greatly reduced the size of computer.
The size of modern Microprocessors is usually one square inch. It can contain millions of
electronic circuits. The examples of fourth generation computers are Apple Macintosh &
IBM PC.
5
Advantages:
i. More powerful and reliable than previous generations.
ii. Small in size
iii. Fast processing power with less power consumption
Disadvantages:
i. The latest technology is required for manufacturing of Microprocessors.
Fifth Generation Computers (Present & Beyond)
It is based on the technique of Artificial Intelligence (AI). Computers can understand
spoken words & imitate human reasoning. Can respond to its surroundings using
different types of sensors. The advancement in modern technologies will
revolutionize the computer in future.
Class work:
1. Definition of computer.
2. Explain the generations of a computer.
3. Explain the history of computers.
Home work:
1. The first generation computers works based on ________
2. Microprocessors as switching devices are for which generation computers
___________
Important questions:
1. Explain the generations of a computer.
2. Explain the history of computers.
DAY-2
4. Explain different Types of Computer.
We can categorize computer by two ways:
1. Based on Data
2. Size.
1. Based on Data
In this the computer is of three types:
Analogue Computer
Digital Computer
Hybrid Computer
6
Analogue Computer
Analogue computers are designed to process the analogue data. Analogue data is
continuous data that changes continuously and cannot have discrete values such as speed,
temperature, pressure and current.
The analogue computers measure the continuous changes in physical quantity and generally
render output as a reading on a dial or scale.
Analogue computers directly accept the data from the measuring device without first con-
verting it into numbers and codes.
Speedometer and mercury thermometer are examples of analogue computers.
EXAMPLES:
· Thermometer
· Analog clock
· Speedometer
· Tire pressure gauge
Digital Computer
Digital computer is designed to perform calculations and logical operations at high
speed. It accepts the raw data as digits or numbers and processes it with programs stored in
its memory to produce output. All modern computers like laptops and desktops that we use
at home or office are digital computers.
EXAMPLES:
· IBM PC
· Apple Macintosh
· Calculators
· Digital watches etc
7
Hybrid Computer
Hybrid computer has features of both analogue and digital computer. It is fast like
analogue computer and has memory and accuracy like digital computers. It can process
both continuous and discrete data. So it is widely used in specialized applications where
both analogue and digital data is processed. For example, a processor is used in petrol
pumps that convert the measurements of fuel flow into quantity and price.
Examples:
· Hybrid computer is the computer used in hospitals to measure the heartbeat of the patient.
· Devices used in petrol pump.
· Hybrid Machines are generally used in scientific applications or in controlling industrial pro-
cesses.
2. On the basis of size:
Based on size the computer can be of five types:
Supercomputer
Supercomputers are the biggest and fastest computers. They are designed to pro-
cess huge amount of data. A supercomputer can process trillions of instructions in a second.
It has thousands of interconnected processors.
Supercomputers are particularly used in scientific and engineering applications such as
weather forecasting, scientific simulations and nuclear energy research. First supercomputer
was developed by Roger Cray in 1976.
Mainframe computer
Mainframe computers are designed to support hundreds or thousands of users sim-
ultaneously. They can support multiple programs at the same time. It means they can ex -
ecute different processes simultaneously. These features of mainframe computers make
them ideal for big organizations like banking and telecom sectors, which need to manage
and process high volume of data.
Mini computer
8
It is a midsize multiprocessing computer. It consists of two or more processors and
can support 4 to 200 users at one time. Mini computers are used in institutes and depart-
ments for the tasks such as billing, accounting and inventory management.
Workstation
Workstation is a single user computer that is designed for technical or scientific ap-
plications. It has faster microprocessor, large amount of RAM and high speed graphic ad-
apters. It generally performs a specific job with great expertise; accordingly, they are of dif-
ferent types such as graphics workstation, music workstation and engineering design work-
station.
Microcomputer
Microcomputer is also known as personal computer. It is a general purpose com-
puter that is designed for individual use. It has a microprocessor as a central processing unit,
memory, storage area, input unit and output unit. Laptops and desktop computers are ex-
amples of microcomputers.
5. Explain different 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.
6. What are the Advantages of Computers?
Following are certain advantages of computers.
9
High Speed
Accuracy
Storage Capability
Diligence
Versatility
Reliability
Automation
Reduction in Paper Work and Cost
7. Explain the Disadvantages of Computers.
Following are certain disadvantages of computers.
No I.Q.
A computer is a machine that has no intelligence to perform any task.
Each instruction has to be given to the computer.
A computer cannot take any decision on its own.
Dependency
It functions as per the user’s instruction, thus it is fully dependent on humans.
Environment
The operating environment of the computer should be dust free and suitable.
No Feeling
Computers have no feelings or emotions.
It cannot make judgment based on feeling, taste, experience, and knowledge unlike
humans.
8. Explain Bits and Bytes in computer memory.
Memory unit is the amount of data that can be stored in the storage unit. This stor-
age capacity is expressed in terms of Bytes.
The following table explains the main memory storage units −
S.No. Unit & Description
Bit (Binary Digit)
1 A binary digit is logical 0 and 1 representing a passive or an active state of a compon-
ent in an electric circuit.
2 Nibble
10
A group of 4 bits is called nibble.
Byte
3 A group of 8 bits is called byte. A byte is the smallest unit, which can represent a data
item or a character.
Word
A computer word, like a byte, is a group of fixed number of bits processed as a unit,
which varies from computer to computer but is fixed for each computer.
4
The length of a computer word is called word-size or word length. It may be as small as
8 bits or may be as long as 96 bits. A computer stores the information in the form of
computer words.
The following table lists some higher storage units −
S.No. Unit & Description
Kilobyte (KB)
1
1 KB = 1024 Bytes
Megabyte (MB)
2
1 MB = 1024 KB
GigaByte (GB)
3
1 GB = 1024 MB
TeraByte (TB)
4
1 TB = 1024 GB
PetaByte (PB)
5
1 PB = 1024 TB
Class work:
1. Explain different types of computers.
2. Explain advantages and disadvantages of computers.
3. Explain bit and bytes.
Home work:
1. Arrange in ascending order by size --> TB,MB,GB,KB
2. One megabyte equals to ___________
3. A bit can have a binary value of___________
Important questions:
11
1. Explain types of computers.
2. Explain bits and bytes.
DAY-3
9. Computer Hardware and software.
A computer system consists of two major elements: hardware and software.
Computer hardware is the collection of all the parts you can physically touch. Computer
software, on the other hand, is not something you can touch. Software is a set of
instructions for a computer to perform specific operations. You need both hardware and
software for a computer system to work.
Some hardware components are easy to recognize, such as the mouse, keyboard, and
monitor. However, there are many different types of hardware components.
10.Block diagram of a computer:(Components of a computer).
1. Input Unit:
We need to first enter the data & instructions in the computer system, before any
12
computation begins. This task is accomplished by the input devices. (Eg: keyboard,
mouse, scanner, digital camera etc). This device is responsible for linking the system
with the external environment. The data accepted is in a human readable form. The
input device converts it into a computer readable form.
2. CPU:
Central Processing Unit (CPU) consists of the following features −
CPU is considered as the brain of the computer.
CPU performs all types of data processing operations.
It stores data, intermediate results, and instructions (program).
It controls the operation of all parts of the computer.
CPU itself has following three components.
I. Memory or Storage Unit
II. Control Unit
III. ALU(Arithmetic Logic Unit)
I. Memory or Storage Unit
This unit can store instructions, data, and intermediate results. This unit supplies informa-
tion to other units of the computer when needed. It is also known as internal storage unit or
the main memory or the primary storage or Random Access Memory (RAM).
Its size affects speed, power, and capability. Primary memory and secondary memory are
two types of memories in the computer. Functions of the memory unit are −
It stores all the data and the instructions required for processing.
It stores intermediate results of processing.
It stores the final results of processing before these results are released to an output
device.
All inputs and outputs are transmitted through the main memory.
II.Control Unit
This unit controls the operations of all parts of the computer but does not carry out any ac -
tual data processing operations.
Functions of this unit are −
It is responsible for controlling the transfer of data and instructions among other
units of a computer.
It manages and coordinates all the units of the computer.
13
It obtains the instructions from the memory, interprets them, and directs the opera-
tion of the computer.
It communicates with Input/Output devices for transfer of data or results from stor-
age.
It does not process or store data.
III.Arithmetic Logic Unit
This unit consists of two subsections namely,
Arithmetic Section
Logic Section
Arithmetic Section
Function of arithmetic section is to perform arithmetic operations like addition, subtraction,
multiplication, and division. All complex operations are done by making repetitive use of the
above operations.
Logic Section
Function of logic section is to perform logic operations such as comparing, selecting, match-
ing, and merging of data.
3. Output Unit:
The job of an output unit is It accepts the results produced by the computer in coded
form. It converts these coded results to human readable form. Finally, it displays the
converted results to the outside world with the help of output devices ( Eg :monitors,
printers, projectors etc..).
10. What is Memory? Explain different types of memories.
A memory is just like a human brain. It is used to store data and instructions. Com -
puter memory is the storage space in the computer, where data is to be processed and in-
structions required for processing are stored.
Memory is primarily of three types −
1. Cache Memory
2. Primary Memory(Main Memory)
3. Secondary Memory(Auxiliary memory)
1. Cache Memory
Cache memory is a very high speed semiconductor memory which can speed up the CPU. It
acts as a buffer between the CPU and the main memory. It is used to hold those parts of
14
data and program which are most frequently used by the CPU. The parts of data and pro-
grams are transferred from the disk to cache memory by the operating system, from where
the CPU can access them.
Advantages
The advantages of cache memory are as follows −
Cache memory is faster than main memory.
It consumes less access time as compared to main memory.
It stores the program that can be executed within a short period of time.
It stores data for temporary use.
Disadvantages
The disadvantages of cache memory are as follows −
Cache memory has limited capacity.
It is very expensive.
2. Primary Memory (Main Memory)
Primary memory holds only those data and instructions on which the computer is currently
working. It has a limited capacity and data is lost when power is switched off. It is generally
made up of semiconductor device. These memories are not as fast as registers. The data and
instruction required to be processed resides in the main memory. It is divided into two sub -
categories RAM and ROM.
Characteristics of Main Memory
These are semiconductor memories.
It is known as the main memory.
Usually volatile memory.
Data is lost in case power is switched off.
It is the working memory of the computer.
Faster than secondary memories.
A computer cannot run without the primary memory.
3. Secondary Memory
This type of memory is also known as external memory or non-volatile. It is slower than the
main memory. These are used for storing data/information permanently. CPU directly does
not access these memories; instead they are accessed via input-output routines. The con-
15
tents of secondary memories are first transferred to the main memory, and then the CPU
can access it. For example, disk, CD-ROM, DVD, etc.
Characteristics of Secondary Memory
These are magnetic and optical memories.
It is known as the backup memory.
It is a non-volatile memory.
Data is permanently stored even if power is switched off.
It is used for storage of data in a computer.
Computer may run without the secondary memory.
Slower than primary memories.
Class work:
1. CPU stands for_____________
2. Arithmetic or logical operations done at _______________ unit
Home Work:
1. BIOS stands for_____________
2. Example for primary storage _________
3. Central Processing Unit is consists of_________________
Important Questions:
1. Explain types of memory and the hierarchy of the memory?
2. Define the term secondary storage? Give three examples of secondary storage?
3. Explain the following terms
a. 2) CPU 3) ALU 4) Control Unit
Previous questions:
1. Explain various components of computer (2016 set 1- 7 marks)
DAY-4
11. Explain RAM and ROM.(volatile and non-volatile memories)
RAM:
RAM (Random Access Memory) is the internal memory of the CPU for storing data,
program, and program result. It is a read/write memory which stores data until the machine
is working. As soon as the machine is switched off, data is erased.
16
Access time in RAM is independent of the address, that is, each storage location inside the
memory is as easy to reach as other locations and takes the same amount of time. Data in
the RAM can be accessed randomly but it is very expensive.
RAM is volatile, i.e. data stored in it is lost when we switch off the computer or if there is a
power failure. Hence, a backup Uninterruptible Power System (UPS) is often used with com-
puters. RAM is small, both in terms of its physical size and in the amount of data it can hold.
RAM is of two types −
Static RAM (SRAM)
Dynamic RAM (DRAM)
Static RAM (SRAM)
The word static indicates that the memory retains its contents as long as power is
being supplied. However, data is lost when the power gets down due to volatile nature.
SRAM chips use a matrix of 6-transistors and no capacitors. Transistors do not require
power to prevent leakage, so SRAM need not be refreshed on a regular basis.
There is extra space in the matrix; hence SRAM uses more chips than DRAM for the same
amount of storage space, making the manufacturing costs higher. SRAM is thus used as
cache memory and has very fast access.
Characteristic of Static RAM
Long life
No need to refresh
Faster
Used as cache memory
Large size
17
Expensive
High power consumption
Dynamic RAM (DRAM)
DRAM, unlike SRAM, must be continually refreshed in order to maintain the data.
This is done by placing the memory on a refresh circuit that rewrites the data several hun-
dred times per second. DRAM is used for most system memory as it is cheap and small. All
DRAMs are made up of memory cells, which are composed of one capacitor and one tran-
sistor.
Characteristics of Dynamic RAM
Short data lifetime
Needs to be refreshed continuously
Slower as compared to SRAM
Used as RAM
Smaller in size
Less expensive
Less power consumption
ROM (Read Only Memory):
ROM stands for Read Only Memory. The memory from which we can only read but
cannot write on it. This type of memory is non-volatile. The information is stored perman-
ently in such memories during manufacture. A ROM stores such instructions that are re-
quired to start a computer. This operation is referred to as bootstrap. ROM chips are not
only used in the computer but also in other electronic items like washing machine and mi-
crowave oven.
Let us now discuss the various types of ROMs and their characteristics.
18
MROM (Masked ROM)
The very first ROMs were hard-wired devices that contained a pre-programmed set
of data or instructions. These kind of ROMs are known as masked ROMs, which are inex-
pensive.
PROM (Programmable Read Only Memory)
PROM is read-only memory that can be modified only once by a user. The user buys
a blank PROM and enters the desired contents using a PROM program. Inside the PROM
chip, there are small fuses which are burnt open during programming. It can be pro -
grammed only once and is not erasable.
EPROM (Erasable and Programmable Read Only Memory)
EPROM can be erased by exposing it to ultra-violet light for a duration of up to 40
minutes. Usually, an EPROM eraser achieves this function. During programming, an elec-
trical charge is trapped in an insulated gate region. The charge is retained for more than 10
years because the charge has no leakage path. For erasing this charge, ultra-violet light is
passed through a quartz crystal window (lid). This exposure to ultra-violet light dissipates
the charge. During normal use, the quartz lid is sealed with a sticker.
EEPROM (Electrically Erasable and Programmable Read Only Memory)
EEPROM is programmed and erased electrically. It can be erased and reprogrammed
about ten thousand times. Both erasing and programming take about 4 to 10 ms (milli-
second). In EEPROM, any location can be selectively erased and programmed. EEPROMs can
be erased one byte at a time, rather than erasing the entire chip. Hence, the process of re -
programming is flexible but slow.
Advantages of ROM
The advantages of ROM are as follows −
Non-volatile in nature
Cannot be accidentally changed
Cheaper than RAMs
Easy to test
More reliable than RAMs
Static and do not require refreshing
Contents are always known and can be verified
19
12. Differences between RAM and ROM.
Following are the basic differences between RAM and ROM.
RAM is easily accessed by the processor while ROM can’t be directly accessed by the
processor because first it is transferred into RAM where it is executed by the
processor.
RAM is volatile in nature as it automatically erased when computer shutdowns. ROM
is non-volatile in nature as it never erased when there is any shutdown or restart of
computer.
RAM is used to store the temporary information for short period of time. ROM
memory is used to store permanent information and can’t be deleted.
RAM is a form of chip while ROM is generally the optical drivers that are made of
magnetic tapes.
RAMs are expensive as compare to ROM.
RAM chip size is larger than ROM.
Static RAM and Dynamic RAM are types of RAM. PROM, EPROM and EEPROM are
types of ROM.
Class work:
1. RAM stands for_____________
2. ROM is __________ memory
Home Work:
1. Examples for ROM__________
2. A typical personal computer used for business purposes would have… of RAM.
Important Questions:
1. Difference between RAM and ROM?
2. Explain the following terms
3. 1) RAM 2) ROM 3)EEPROM
Previous questions:
1. Differentiate between RAM and ROM.(supply 2017 apr/may 2 marks)
DAY-5
13. Explain about INPUT DEVICES?
Input devices accept data and instructions from the user. Following are the examples of
various input devices, which are connected to the computer for this purpose.
20
1. Keyboard 2. Mouse 3. Light Pen
4. Optical/magnetic Scanner 5. Touch Screen
6. Microphone for voice as input 7. Track Ball
Keyboard
A keyboard is the most common input device. Several kinds of
keyboards are available, but they resemble each other with minor
variations. The keyboard in most common use is the QWERTY
board. Generally standard keyboard has 104 keys.
Mouse
A mouse is an electro-mechanical, hand-held device. It is used as a
pointer. It can perform functions like selecting menu commands, moving
icons, resizing windows, starting programs, and choosing Options. A
mouse is used to replace hard -to-remember key combinations with
easier "Point and Click" actions. However, it cannot substitute all
keyboard operations. It can be alternative for commands based
operations.
Light pen
Input device that utilizes a light-sensitive detector to select objects
on a display screen. A light pen is similar to a mouse except that with a
light pen you can move the pointer and select objects on the display
screen by directly pointing to the objects with the pen.
Optical Scanner
An image scanner translates printed images into an electronic
format that can be stored in a computer’s memory, and with the right
kind of software, one can alter a stored image. Another example of
scanner is optical character recognition (OCR) device, used by banks to
convert the scanned image of a typed or printed page into text that
can be edited on the computer.
Touch Screen
Touch panel displays and pads are now being offered as alternatives to keyboard.
Here the input can be given through the computer screen that accepts the input through
monitor; users touch electronic buttons displayed on the screen or they May use light
21
pen.
Microphone
Microphone is an input device, which takes voice as input. The
voice communication is more error-prone than information through
keyboard. There are two types of microphones available
1. Desktop Microphone
2. Hand held Microphone
Track Ball
Trackball, a pointing device, is a mouse lying on its back .To move the pointer; you
rotate the ball with your thumb, your fingers, or the palm of your hand.
There are usually one to three buttons next to the ball, which you use just
like mouse buttons. The advantage of trackballs over mouse is that the
trackball is stationary so it does not require much space to use it. In
addition, you can place a trackball on any type of surface, including your
lap. For both these reasons, trackballs are popular pointing devices for portable
computers.
14. Explain about some OUTPUT DEVICES.
Output devices return processed data that is information, back to the user
Following are some of the important output devices used in a computer.
1. Monitors
2. Printer
3. Plotter
4. Projector
5. speakers
1. Monitors
Monitors, commonly called as Visual Display Unit (VDU), are the main output device
of a computer. It forms images from tiny dots, called pixels that are arranged in a rectangu-
lar form. The sharpness of the image depends upon the number of pixels.
There are two kinds of viewing screen used for monitors.
Cathode-Ray Tube (CRT)
Flat-Panel Display
22
Cathode-Ray Tube (CRT) Monitor
The CRT display is made up of small picture elements called pixels. The smaller the
pixels, the better the image clarity or resolution. It takes more than one illuminated pixel to
form a whole character, such as the letter ‘e’ in the word help.
A finite number of characters can be displayed on a screen at once. The screen can
be divided into a series of character boxes - fixed location on the screen where a standard
character can be placed. Most screens are capable of displaying 80 characters of data hori-
zontally and 25 lines vertically.
There are some disadvantages of CRT −
Large in Size
High power consumption
Flat-Panel Display Monitor
The flat-panel display refers to a class of video devices that have reduced volume,
weight and power requirement in comparison to the CRT. You can hang them on walls or
wear them on your wrists. Current uses of flat-panel displays include calculators, video
games, monitors, laptop computer, and graphics display.
23
Non-Emissive Displays − Non-emissive displays use optical effects to convert sunlight
or light from some other source into graphics patterns. For example, LCD (Liquid-
Crystal Device).
2. Printers
Printer is an output device, which is used to print information on paper.
There are two types of printers −
Impact Printers
Non-Impact Printers
Impact Printers
Impact printers print the characters by striking them on the ribbon, which is then pressed on
the paper.
Characteristics of Impact Printers are the following −
Very low consumable costs
Very noisy
Useful for bulk printing due to low cost
There is physical contact with the paper to produce an image
These printers are of two types −
Character printers
Line printers
Character Printers
Character printers are the printers which print one character at a time.
These are further divided into two types:
Dot Matrix Printer(DMP)
Daisy Wheel
Dot Matrix Printer
In the market, one of the most popular printers is Dot Matrix Printer. These printers
are popular because of their ease of printing and economical price. Each character printed is
in the form of pattern of dots and head consists of a Matrix of Pins of size (5*7, 7*9, 9*7 or
9*9) which come out to form a character which is why it is called Dot Matrix Printer.
24
Advantages
Inexpensive
Widely Used
Other language characters can be printed
Disadvantages
Slow Speed
Poor Quality
Daisy Wheel
Head is lying on a wheel and pins corresponding to characters are like petals of Daisy
(flower) which is why it is called Daisy Wheel Printer. These printers are generally used for
word-processing in offices that require a few letters to be sent here and there with very nice
quality.
Advantages
More reliable than DMP
Better quality
Fonts of character can be easily changed
Disadvantages
Slower than DMP
Noisy
More expensive than DMP
Line Printers
25
Line printers are the printers which print one line at a time.
26
Non-impact Printers
Non-impact printers print the characters without using the ribbon. These printers
print a complete page at a time, thus they are also called as Page Printers.
These printers are of two types −
Laser Printers
Inkjet Printers
Characteristics of Non-impact Printers
Faster than impact printers
They are not noisy
High quality
Supports many fonts and different character size
Laser Printers
These are non-impact page printers. They use laser lights to produce the dots
needed to form the characters to be printed on a page.
Advantages
Very high speed
Very high quality output
Good graphics quality
Supports many fonts and different character size
Disadvantages
Expensive
Cannot be used to produce multiple copies of a document in a single printing
Inkjet Printers
27
Inkjet printers are non-impact character printers based on a relatively new techno-
logy. They print characters by spraying small drops of ink onto paper. Inkjet printers produce
high quality output with presentable features.
They make less noise because no hammering is done and these have many styles of printing
modes available. Color printing is also possible. Some models of Inkjet printers can produce
multiple copies of printing also.
Advantages
High quality printing
More reliable
Disadvantages
Expensive as the cost per page is high
Slow as compared to laser printer
3. Plotter
A plotter is a computer hardware device much like a printer that is used for printing
vector graphics. Instead of toner, plotters use a pen, pencil, marker, or another writing tool
to draw multiple, continuous lines onto paper rather than a series of dots like a traditional
printer. Though once widely used for computer-aided design, these devices have more or
less been phased out by wide-format printers. Plotters are used to produce a hard copy of
schematics and other similar applications.
4. Projector:
A projector is an output device that can take images generated by a computer or
Blue-ray player and reproduce them onto a screen, wall, or other surface. Typically, the sur-
face projected onto is large, flat, and lightly colour. For example, you could use a projector
to show a presentation on a large screen so that everyone in the room can see it. Projectors
28
can produce either still (slides) or moving images (videos). A projector is often about the size
of a toaster and weighs only a few pounds.
5. Speaker
Speakers are one of the most common output devices used with computer systems.
Some speakers are designed to work specifically with computers, while others can be
hooked up to any type of sound system. Regardless of their design, the purpose of speakers
is to produce audio output that can be heard by the listener.
Speakers are transducers that convert electromagnetic waves into sound waves. The speak-
ers receive audio input from a device such as a computer or an audio receiver. This input
may be either in analog or digital form. Analog speakers simply amplify the analog electro-
magnetic waves into sound waves. Since sound waves are produced in analog form, digital
speakers must first convert the digital input to an analog signal, and then generate the
sound waves.
Class work:
1) What type of device is computer keyboard?
2) Computer system comprises ___________ major units
3) PPR stands for __________
4) CRT Stands for_____________
Home Work:
1) List any 3 input devices?
2) List any 3 output devices?
3) LED stands for___________
Important Questions:
1) What are input and output devices?
2) What are the different types of printers?
3) Explain the following input and output devices
i) Printer ii) speaker iii) mouse iv) scanner
DAY - 4
DAY-6
15. Different types of computer languages.
29
Around the world language is a source of
communication among human beings. Similarly, in
order to communicate with computer user also
needs to have a language that should be understand-
able by the computers. For the purpose different lan-
guages are developed for performing different types
of work on the computer.
30
programs directly in machine code. For this reason, programs are normally written in as-
sembly or high level languages and then are translated in the machine language by different
translators.
Advantages
1. It makes fast and efficient use of the computer
2. It requires no translator to translate the code i.e. directly understood by the com-
puter.
Disadvantages
1. All operation codes have to be remembered
2. All memory addresses have to be remembered
3. It is hard to amend or find errors in a program written in the machine language
4. These languages are machine dependent i.e. a particular machine language can be
used on only one type of computer.
Assembly Languages
It was developed to overcome some of the many inconveniences of machine lan-
guage. This is another low level but a very important language in which operation codes and
operands are given in the form of alphanumeric symbols instead of 0’s and 1’s. These alpha-
numeric symbols will be known as mnemonic codes and can have maximum up to 5 letter
combinations e.g. ADD for addition, SUB for subtraction, START LABEL etc. because of this
feature it is also known as “Symbolic Programming Language”. This language is very difficult
and needs a lot of practice to master it because very small English support is given. This
symbolic language helps in compiler orientations. The instructions of the assembly language
will also be converted to machine codes by language translator to be executed by the com-
puter
Advantages
1. It is easier to understand and use as compared to machine language
2. It is easy to locate and correct errors
3. It is modified easily
Disadvantages
1. Like machine language it is also machine dependent
2. Since it is machine dependent, there programmer should have the knowledge of he
hardware also.
31
2. High Level Language:
High level computer languages give formats close to English language and the pur-
pose of developing high level languages is to enable people to write programs easily and in
their own native language environment (English). High-level languages are basically symbolic
languages that use English words and/or mathematical symbols rather than mnemonic
codes. Each instruction in the high level language is translated into many machine language
instructions thus showing one-to-many translation.
Various high level languages are given below:
BASIC (Beginners All Purpose Symbolic Instruction Code): It is widely used, easy to learn
general purpose language. This is mainly used in microcomputers in earlier days.
COBOL (Common Business Oriented language): A standardized language used for
commercial applications.
FORTRAN (Formula Translation): Developed for solving mathematical and scientific
problems. One of the most popular languages among scientific community.
C: Structured Programming Language used for all purpose such as scientific application,
commercial application, developing games etc.
C++ and java: Popular object oriented programming language, used for general purpose.
16. Explain the Difference between low level and high level and middle level languages.
32
High level languages provide Middle level languages Low level languages
almost everything that the don’t provide all the built-in provides nothing other than
programmer might need to functions found in high level access to the machines basic
do as already built into the languages, but provides all instruction set
language mnemonic that we need to
produce the result we want
33
In POP, Most function uses Global data In OOP, data can not move easily from
for sharing that can be accessed freely function to function,it can be kept pub-
Data Access
from function to function in the sys- lic or private so we can control the ac-
tem. cess of data.
POP does not have any proper way for OOP provides Data Hiding so provides
Data Hiding
hiding data so it is less secure. more security.
In OOP, overloading is possible in the
Overloading In POP, Overloading is not possible. form of Function Overloading and Op-
erator Overloading.
Example of POP is: C, VB, FORTRAN, Example of OOP is: C++, JAVA, VB.NET,
Examples
and Pascal. C#.NET.
Class work:
1) _________ language is directly understood by the computer .
2) Object oriented language is __________ approach
3) COBOL stands for____________
4) C is ________ level language
Home Work:
1) java is ________ level language
2) FORTRAN stands for____________
3) _____________ language programs are divided into objects
Important Questions:
1) Difference between Structures oriented & Object oriented language?
2) Define high level languages and low level language?
Previous questions:
1) Difference Between high level languages and low level language?( 2016 set 1- 2
marks)
2) Explain different types of languages. (2016 set 2- 7 marks)
3) Explain procedure and object oriented languages. (2016 set 2- 7 marks)
4) Explain procedure and object oriented languages. (2017 supply apr/may 7 marks)
DAY-7
34
18. Translators in computer languages.
A program written in high-level language is called as source code. To convert the
source code into machine code, translators are needed.
A translator takes a program written in source language as input and converts it into a
program in target language as output.
It also detects and reports the error during translation.
Roles of translator are:
• Translating the high-level language program input into an equivalent machine language
program.
• Providing diagnostic messages wherever the programmer violates specification of the
high-level language program.
Different type of translators
1. Assembler
2. Compiler
3. Interpreter
4. linker
1. Assembler
Assembler is a translator which is used to translate the assembly language code into
machine language code.
2 .Compiler
The software that reads a program written in high level language and translates it
into an equivalent program in machine language is called as compiler. The program
written by the programmer in high level language is called source program and the
program generated by the compiler after translation is called as object program.
35
3. Interpreter
It also executes instructions written in a high level language. Both complier &
interpreter have the same goal i.e. to convert high level language into binary
instructions, but their method of execution is different. The complier converts the entire
source code into machine level program, while the interpreter takes 1 statement,
translates it, executes it & then again takes the next statement.
4. Linker:
A linker or link editor is a computer program that takes one or more object files
generated by a compiler and combines them into a single executable file, library file, or
another object file.
36
1 Performs the translation of a program Performs statement by statement
as a whole. translation.
2 Execution is faster. Execution is slower.
3 Requires more memory as linking is Memory usage is efficient as no in-
needed for the generated intermediate termediate object code is generated.
object code.
4 Debugging is hard as the error mes- It stops translation when the first er-
sages are generated after scanning the ror is met. Hence, debugging is easy.
entire program only.
5 Programming languages like C, C++ uses Programming languages like Python,
compilers. BASIC, and Ruby uses interpreters.
20. What is software? Explain different types of software’s.
Software is a set of programs, which is designed to perform a well-defined function.
A program is a sequence of instructions written to solve a particular problem.
There are two types of software −
System Software
Application Software
System Software
The system software is a collection of programs designed to operate, control, and ex-
tend the processing capabilities of the computer itself. System software is generally pre-
pared by the computer manufacturers. These software products comprise of programs
written in low-level languages, which interact with the hardware at a very basic level. Sys-
tem software serves as the interface between the hardware and the end users.
Some examples of system software are Operating System, Compilers, Interpreter, Assem-
blers, etc.
37
Close to the system
Fast in speed
Difficult to design
Difficult to understand
Less interactive
Smaller in size
Difficult to manipulate
Generally written in low-level language
Application Software
Application software products are designed to satisfy a particular need of a particular
environment. All software applications prepared in the computer lab can come under the
category of Application software.
Application software may consist of a single program, such as Microsoft's notepad for writ-
ing and editing a simple text. It may also consist of a collection of programs, often called a
software package, which work together to accomplish a task, such as a spreadsheet pack -
age.
Examples of Application software are the following −
Payroll Software
Student Record Software
Inventory Management Software
Income Tax Software
Railways Reservation Software
Microsoft Office Suite Software
Microsoft Word
Microsoft Excel
Microsoft PowerPoint
38
Close to the user
Easy to design
More interactive
Slow in speed
Generally written in high-level language
Easy to understand
Easy to manipulate and use
Bigger in size and requires large storage space
21. Explain about different Types of application software.
Word processing software: The main purpose of this software is to produce
documents. MS-Word, Word Pad, Notepad and some other text editors are some of
the examples of word processing software.
Database software: Database is a collection of related data. The purpose of this
software is to organize and manage data. The advantage of this software is that you
can change way data is stored and displayed. MS access, dBase, FoxPro, Paradox,
and Oracle are some of the examples of database software.
Spread sheet software: The spread sheet software is used to maintain budget,
financial statements, grade sheets, and sales records. The purpose of this software is
organizing numbers. It also allows the users to perform simple or complex
calculations on the numbers entered in rows and columns. MS-Excel is one of the
examples of spreadsheet software.
Presentation software: This software is used to display the information in the form
of slide show. The three main functions of presentation software is editing that
allows insertion and formatting of text, including graphics in the text and executing
the slide shows. The best example for this type of application software is Microsoft
PowerPoint.
Multimedia software: Media players and real players are the examples of
multimedia software. This software will allow the user to create audio and videos.
The different forms of multimedia software are audio converters, players, burners,
video encoders and decoders.
Class work:
5) Software is classified in to _______ types
39
6) Example for system software__________
7) Spread sheet is a ___________ software
Home Work:
1) A computer program that converts an entire program into machine language is called
a ____________
2) Presentation software is example for __________ software
3) MS DOS stands for _________________
Important Questions:
1) Explain the following
a) Compiler b) interpreter c) assembler d) linker
2) What is system software and application software
3) Explain about some application software?
4) What are the difference between Compiler and interpreter?
Previous questions:
1) Explain types of software’s (2016 set 2- 2 marks).
2) Explain the features and
DAY-8
22. Explain about evolution and the history of C.
C is a programming language developed at AT & T’s Bell laboratories of USA
in 1972. It was designed and written by DENNIS RITCHIE. C has the features of both
BASIC and PASCAL. As a middle level language, C allows the manipulation of bits, bytes
and addresses the basic elements with which computer functions. C’s code is very
portable, in the sense that it is easy to adapt software written for one type of operating
system to another type. C has very small keywords. Set includes extensive library
functions which enhance the basic functions.
Year Language Developed by Remarks
1960 ALGOL International Committee Too General, too Abstract.
40
1967 BCPL Martin Richards at Cambridge Could deal with only
University specific problems.
1970 B Ken Thompson at AT & T Could deal with only
specific problems.
1972 C Dennis Ritchie at AT & T Lost generally of BCPL and
B restored.
1. Problem Definition
In this phase, we define the problem statement and we decide the boundaries of the
problem. In this phase we need to understand the problem statement, what is our require-
ment, what should be the output of the problem solution? These are defined in this first
phase of the program development life cycle.
41
2. Problem Analysis
In phase 2, we determine the requirements like variables, functions, etc. to solve the
problem. That means we gather the required resources to solve the problem defined in the
problem definition phase. We also determine the bounds of the solution.
3. Algorithm Development
During this phase, we develop a step by step procedure to solve the problem using
the specification given in the previous phase. This phase is very important for program de-
velopment. That means we write the solution in step by step statements.
4. Coding & Documentation
This phase uses a programming language to write or implement actual programming
instructions for the steps defined in the previous phase. In this phase, we construct actual
program. That means we write the program to solve the given problem using programming
languages like C, C++, Java etc.,
5. Testing & Debugging
During this phase, we check whether the code written in previous step is solving the
specified problem or not. That means we test the program whether it is solving the problem
for various input data values or not. We also test that whether it is providing the desired
output or not.
6. Maintenance
During this phase, the program is actively used by the users. If any enhancements
found in this phase, all the phases are to be repeated again to make the enhancements.
That means in this phase, the solution (program) is used by the end user. If the user encoun-
ters any problem or wants any enhancement, then we need to repeat all the phases from
the starting, so that the encountered problem is solved or enhancement is added.
24. What is Pseudo code? Explain with example?
Pseudo code is a simple way of writing programming code in English. Pseudo code is not
actual programming language. It uses short phrases to write code for programs before
you actually create it in a specific language. Once you know what the program is about
and how it will function, then you can use pseudo code to create statements to achieve
the required results for your program.
Example of pseudo code is to create a program to add 2 numbers together and then
display the result.
42
Start Program
Enter two numbers, A, B
Add the numbers together
Print Sum
End Program
Example of pseudo code to compute the perimeter of a rectangle:
Enter length, l
Enter width, w
Compute Perimeter = 2*l + 2*w
Display Perimeter of a rectangle
Writing basic pseudo code is not like writing an actual code. It cannot be compiled or
run like a regular program. Pseudo code can be written how you want. But some
companies use specific pseudo code syntax to keep everyone in the company on the
same page Syntax is a set of rules on how to use and organize statements in a
programming language.
Class work:
1. History of c.
2. Explain sudocode.
Important questions:
1. What is sudocode explain.
2. Explain program development steps.
Previous questions:
1) What are the different steps for Program development (set1 2016 7 marks).
2) Why c language called middle level language (set3 2016 2 marks).
3) How c program creating and running using algorithmic approach. (Set 4 2016 7
marks).
DAY-9
25. What is Algorithm? Explain its properties.
Step by step procedure is designed to perform an operation is called algorithm.
Which (like a map or flowchart) will lead to the sought result if followed correctly.
Algorithms have a definite beginning and a definite end, and a finite number of steps. An
algorithm produces the same output information given the same input information, and
43
several short algorithms can be combined to perform complex tasks such as writing a
computer program
Properties of algorithm:
An algorithm must have five properties:
1. Input specified
2. Output specified
3. Definiteness
4. Effectiveness
5. Finiteness
1. Input specified
• The input is the data to be transformed during the computation to produce the out-
put.
• What data do you need to begin to get the result you want?
• Input precision requires that you know what kind of data, how much and what form
the data should be
2. Output specified
The output is the data resulting from the computation (your intended result)
Frequently the name of the algorithm contains the output:
“Algorithm to compute batting average”
Output precision also requires that you know what kind of data, how much and what
form the output should be (or even if there will be any output at all!)
3. Definiteness
Algorithms must specify every step and the order the steps must be taken in the
process
Definiteness means specifying the sequence of operations for turning input into out-
put
Details of each step must be also be spelled out (including how to handle errors)
4. Effectiveness
It consists of basic instructions that are realizable. This means that the instructions
can be performed by using the given inputs in a finite amount of time.
5. Finiteness
The algorithm must stop, eventually!
44
Stopping may mean that you get the expected output OR you get a response that no
solution is possible
Finiteness is not usually an issue for non-computer algorithms
Computer algorithms often repeat instructions with different data and finiteness
may be a problem
Example:
Write an algorithm to add two numbers entered by user.
Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values num1 and num2.
Step 4: Add num1 and num2 and assign the result to sum.
Sum←num1+num2
Step 5: Display sum
Step 6: Stop
26. What is Flowchart? Explain its symbols:
Flowchart is a diagrammatic representation of an algorithm. Flowcharts are very
helpful in writing program and explaining program to others.
Symbols Used In Flowchart
Different symbols are used for different states in flowchart, For example: Input/Out-
put and decision making has different symbols. The table below describes all the symbols
that are used in making flowchart
Examples of flowcharts in programming
45
Symbol Purpose Description
Class work:
1. Define Algorithm? What are the Properties of an Algorithm?
2. Define PSEUDOCODE? Explain with an example?
3. Define flowchart? What are the symbols available in flowchart?
46
Home Work:
1) Write an algorithm for sum of 5 numbers?
2) Write an algorithm to find area of triangle?
3) Draw flow chart for sum of 5 numbers?
4) Draw flow chart to find area of triangle?
Important questions
1) What is an algorithm? Write an algorithm to arrange 3 elements in ascending order.
2) What is an algorithm? List and explain the properties of algorithm.
3) List the advantages of algorithm. Write an algorithm to find the average of 3
numbers.
4) Write an algorithm for computing the sum of the series 1 + x + x 2 /2!+x 3 /3!+x 4
/4!... upto N terms.
5) Write an algorithm and C program to calculate roots of a quadratic equation and
explain how to compile and the run above program?
Previous questions:
1) What is algorithm? Explain different steps involved in developing algorithms.
Write an algorithm for sum of digits in a given number .(2016 set 4- 7 marks)
DAY-10
27. Explain software development process.
Developing a program involves steps similar to any problem-solving task. There are
six main phase in the programming process:
1) Defining the problem 2) Planning the solution
3) Coding the program 4) Testing the program
5) Documenting the program 6) maintenance
1. Defining the Problem
Suppose that, as a programmer, you are contacted because your services are
needed. You meet with users from the client organization to analyze the problem, or
you meet with a systems analyst who outlines the project. Specifically, the task of
defining the problem consists of identifying what it is you know (input-given data),
and what it is you want to obtain (output-the result). Eventually, you produce a
written agreement that, among other things, specifies the kind of input, processing,
and output required. This is not a simple process.
47
2. Planning the Solution
Two common ways of planning the solution to a problem are to draw a
flowchart and to write pseudo code, or possibly both. Essentially, a flowchart is a
pictorial representation of a step-by-step solution to a problem. The American
National Standards Institute (ANSI) has developed a standard set of flowchart
symbols.
3. Coding the Program
As the programmer, your next step is to code the program-that is, to express
your solution in a programming language. You will translate the logic from the
flowchart or pseudo code-or some other tool-to a programming language.
4. Testing the Program
Eventually, after coding the program, you must prepare to test it on the
computer. This step involves these phases:
Desk-checking. This phase, similar to proofreading, is sometimes avoided by the
programmer who is looking for a shortcut and is eager to run the program on the
computer once it is written. However, with careful desk-checking you may discover
several errors and possibly save your time in the long run.
Translating. A translator is a program that
1.Checks the syntax of your program to make sure the programming language was
used correctly, giving you all the syntax-error messages, called diagnostics, and
2. Then translates your program into a form the computer can understand. Programs
are most commonly translated by a compiler. A compiler translates your entire
program at one time.
Debugging. A term used extensively in programming, debugging means detecting,
locating, and correcting bugs (mistakes), usually by running the program. These bugs
are logic errors, such as telling a computer to repeat an operation but not telling it
how to stop repeating. In this phase you run the program using test data that you
devise.
5. Documenting the Program
Documentation is a written detailed description of the programming cycle
and specific facts about the program. Typical program documentation materials
include the origin and nature of the problem, a brief narrative description of the
48
program, logic tools such as flowcharts and pseudo code, data-record descriptions,
program listings, and testing results. Comments in the program itself are also
considered an essential part of documentation. Many programmers document as
they code.
6. Maintenance:
Companies usually implement different types of tests. An Alpha test is first
conducted, which is on-site at the company, and Beta tests are sent out to different
states or countries to ensure the program is 100% ready for use. The Alpha test
occurs before the Beta test. Once the debugging and testing are finished, the
program is now in the system and the program implementation and maintenance
phase are completed. Program maintenance still needs to be kept up, in case of
future errors. This is the most costly to organizations because the programmers need
to keep improving and fixing issues within the program.
Class work:
1) Explain software development process?
Home Work:
1) Explain different phases to develop software?
Important question:
1) Explain briefly Explain software development process.
49