Computer Programming - Unit1
Computer Programming - Unit1
1. What is a computer?
The computer is an electronic machine that takes input from the user and processes it to generate the output in the
form of useful information.
2. What is a program?
A program is a set of instructions that can be executed one-by-one in the computer.
Each program performs certain task that is created by the user.
3. What is Hardware and Software?
Hardware of the computer means, all the visible components of a computer that are needed for proper functioning.
It is the framework. Software is applied on the hardware of the computer. E.x: CPU, monitor, etc
Software of the computer means, the set of programs that can be executed one by one in a computer.
It controls all the operations of a computer. Ex: OS, games softwares, etc
4. What is the difference between application software and system software?
System softwares are inbuilt softwares that are required to start the computer.
Without system software, a computer cannot work properly. Ex : Windows OS, Linux OS, DOS, etc
Application softwares are optional softwares that are needed to perform certain task needed for user.
Without application software, a system can work. Ex: Tally, Games softwares, etc
5. What are the advantages and disadvantages of first generation of computers?
Advantages: Disadvantages:-
Based on vacuum tube technology Large space is needed.
During that time, these type of computers It takes more power
were the fastest. Very costly
Calculations are done in milliseconds. No reliability
Programming is difficult
Advantages: Disadvantages:-
Based on transistor technology Very costly
Small in size It needed AC
Less heat produced Production was difficult
Calculations are done in microseconds
Better reliability
7. What are the advantages and disadvantages of third generation of computers?
Advantages: Disadvantages:-
Based on IC (Integrated Chip) technology It needed AC
Calculations are done in nano seconds Production was difficult
Less power needed
Less maintenance cost
More reliability
8. What are the advantages and disadvantages of fourth generation of computers?
Advantages: Disadvantages:-
Based on Processor technology Production was difficult
Small in size
Portable and very much reliable
Less maintenance cost
All programming languages are supported
9. What are the advantages and disadvantages of fifth generation of computers?
Advantages: Disadvantages:-
Portable There is no program that makes the computer to
User friendly operate completely automatic.
Supports many OS
Supports parallel programming
High speed calculations
Large storage capacity.
Page 1 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar
**GE6151 – COMPUTER PROGRAMMING**
10. What are the characteristics of a digital computer?
They have large memory space
They are suitable for business
High processing speed
Discrete value outputs are got
It is versatile in nature.
11. What are the differences between analog and digital computers?
Analog computer Digital computer
Less speed High speed
Less memory More memory
Limited usage Many number of usage
Output is in the form of graph Output is in the form of discrete values
Less accurate calculation More accurate calculation
12. What are the advantages and disadvantages of micro and mini computers?
Advantages – Micro computers Disadvantages – Mini computers
Small in size Less memory capacity
Very cheap in cost, compared to Mini computers Difficult in maintenance
Highly reliable
Advantages – Mini computers Disadvantages – Mini computers
Small in size, compared to mainframe computers Calculation speed is less than mainframe computers
Cheap in cost, compared to mainframe computers Memory capacity is small, compared to mainframe
13. What are the advantages and disadvantages of mainframe and super computers?
Advantages – mainframe computers Disadvantages – mainframe computers
Many OS can be installed in mainframe It is very much costly
computer
It can be used instead of 1000s of small servers Its size is very big
It can store large amount of data
Advantages – super computers Disadvantages – Super computers
Processing speed is : trillions per second Its size is large
Many processors can work at the same time It is also very costly
It has more main memory
PART – B
Page 3 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar
**GE6151 – COMPUTER PROGRAMMING**
Education:-
It is used in education, online classrooms, online library, etc
Marketing:-
It is used in preparing advertisements
Banking:-
It is used in banking to store the account details of customers
It is used in ATM, internet banking
Video games:-
It is used in playing video games, online games, etc
Training:-
Computers are used to give training to the workers
Hospitals:-
It is used in hospitals to help the doctors to find the disease and give treatment
It stores the record of patients Ex: Scan, blood test, ECG, etc
Railways:-
It is used in online ticket reservation, see the schedule of trains, etc
Science:-
It is used in research by scientists
It helps in finding earth quake, Tsunami, etc
3. Explain the generation of Digital computers in detail. (or) Explain the Generation of computers in detail.
First Generation:-
The first generation of computers were used only for certain task.
Each computer has a machine language ( 0’s and 1’s)
They are difficult to process
They are not versatile, they have limited speed.
They used VACUUM TUBES and MAGNETIC DRUMS for data storage.
It consumed 100kW power, weight of many 1000kilos.
It performed 5000calculations per second.
Ex: EDSAC, UNIVAC, etc
Advantages: Disadvantages:-
Based on vacuum tube technology Large space is needed.
During that time, these type of computers It takes more power
were the fastest. Very costly
Calculations are done in milliseconds. No reliability
Programming is difficult
They are used in business, university, government, etc because of its success.
They used TRANSISTORS for memory storage
They are small and consume less power
Thermionic valves are used instead of heated tubes
They also contained components such as printers, tape, disk storage, memory, OS, etc
Ex: IBM 1401, 1620, UNIVAC 1108
Advantages: Disadvantages:-
Based on transistor technology Very costly
Small in size It needed AC
Less heat produced Production was difficult
Calculations are done in microseconds
Better reliability
Page 4 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar
**GE6151 – COMPUTER PROGRAMMING**
Third generation of computers:-
Integrated Chip (IC) Technology is used for memory storage
Quartz rock is used to remove the heat.
IC is a combination of three components on a small disc
Semiconductor was also introduced.
Because ICs are small in size, the size of the computers became small
In this generation of computers, many operating systems can be installed.
Ex: IBM 360 series, ICL 1900 series, CDC 1700
Advantages: Disadvantages:-
Based on IC (Integrated Chip) technology It needed AC
Calculations are done in nano seconds Production was difficult
Less power needed
Less maintenance cost
More reliability
Page 5 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar
**GE6151 – COMPUTER PROGRAMMING**
Characteristics of analog computers:-
Low speed
Limited applications
Less memory space
Not suitable for business
Output is not accurate
Digital Computers:-
They process the information digitally.
It stored and processes the data in digital form
Data is stored as 0’s and 1’s
Output produced by digital computers is in Digital form.
Ex: Palmtop, Laptop, Super computer, etc
Characteristics of a digital comouter:-
Large memory space
Suitable for business applications
Processor speed is high
Versatile in nature
Super Computers:-
They are most powerful computers than mainframe computers
The simplified form of mainframe computer is called as super computer
It is the top level computer used for high processing capacity
It can process Trillions of instructions per second ( 10,00,000 = 1million, 10,00,00,000=1trillion)
Applications of super computers:-
This computer cannot be used at home
It is used in heavy jobs such as Government use, etc
They are useful in weather forecasting.
Advantages – super computers Disadvantages – Super computers
Processing speed is : trillions per second Its size is large
Many processors can work at the same time It is also very costly
It has more main memory
Page 6 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar
**GE6151 – COMPUTER PROGRAMMING**
Cache memory
Registers
CPU
ALU
Control Unit
Basic operations of a computer:-
It ACCEPTS the data or instruction through INPUT
It STORES the data or information
It can PROCESS data as instructed by the user
It GIVES results through OUTPUT
It CONTROLS all the operations
Input Unit:-
Input devices get the data from the user and converts to the machine understandable form.
Ex: Keyboard, Mouse, Scanner, Joystick, Lightpen, Card reader, Webcam, Microphone
Keyboard:-
It is a standard input device attached to all type of computers
It contains keys arranged in the form of QWERTY
It contains many keys such as TAB, CAPSLOCK, SPACE BAR, ALT, CTRL, ENTER, HOME, END, etc
It contains 101 to 104 keys
If we press the keys in the keyboard, electrical signals are sent to the computer.
Mouse:-
It is used with personal computer
Old type of mouses have magnetic ball at the back.
Nowadays, Infrared mouses are used, that works on infrared light at the back of the mouse
We can move cursor to any direction with the help of a mouse
It is used for easy and fast operations.
Scanner:-
Keyboard can give input only the characters
Scanners can give a picture as input to the computer
Scanner is an optical device that takes a picture and gives as input to the computer
Ex: MICR, OMR, OCR
MICR – Magnetic Ink Character Recognition
They are used in bank cheques
Magnetic ink is printed on the cheque. If the cheque is passed through magnetic field, the information is read
OMR – Optical Mark reader
They are used in objective type tests
Students have to shade the rounds for the correct answer
OCR – Optical Character Recognition
Reads a paper and takes the information from it, gives as input to the computer
They are costly than MICR
Joystick:-
It is an online device
We can move the cursor fastly with the help of joystick
They are used to play games, etc
Page 7 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar
**GE6151 – COMPUTER PROGRAMMING**
Light Pen:-
It is a light-sensitive device
It is used with CRT monitor
It is used in CAD
Using light, it moves the cursor
Photo-sensor is used
Card Reader:-
It was punched cards to give information to the computer
The computer program which is to be fetched, transformed into punched cards by the process known as
card punching
After punching all cards, they are given to card reader, computer reads one by one
Webcam:-
It is a video camera that gives image or video to the computer that can be transferred online
It is connected to the system with USB cable
It us used for video chatting, video conferencing, etc using WWW
Microphone:-
It is an acoustic-to-electric transducer or sensor that converts sound signals to electric signals
They are used in Telephones, hearing aids, recording audio engineering, Radio and TV broadcasting, etc
It uses electromagnetic inductance capacitance change to produce electric signal from mechanical
vibration
CPU:-
It is called as brain of the computer
It performs taks such as arithmetic and logical operations
CPU is divided into three parts: ALU, Control Unit, Registers
ALU:-
After the system gets input data, it is stored in primary storage.
The actual processing of data takes place at Arithmetic Logic Unit (ALU)
It performs addition, subtraction, multiplication, division, logical comparison, etc
It also performs AND, OR, NOT, XOR, etc operations
Control Unit:-
It acts like the supervisor of a computer
It controls the overall activities of a computer components
It checks all the operations of a computer are going correctly or not
It determines how the instructions are executed one by one
It controls all the input and output operations of a computer
For executing an instruction, it performs the following steps:-
o Address of the instruction is placed in address bus
o Instruction is read from the memory
o Instruction is sent for decoding
o Data from that address is read from the memory
o These data and address are sent to the memory
o Again the next instruction is taken from the memory
Registers:-
They are high speed memory units for storing temporary data
they are small in size
it stores data, instruction, address, etc
ALU is also a register
Types: Accumulator, GPR, SPR( PC, MAR, MBR, IR)
Accumulator: to store the operands before execution. It receives the result of ALU operation
GPR: General Purpose Registers are used to store data and intermediate results
SPR:Special Purpose Registers are used for a certain purpose.
PC: Program counter, MAR: Memory Address Bus, MBR: Memory Buffer Register
Output Unit:-
It is a medium between computer and the human
After the CPU finishes operation, the output is displayed in the output unit
They take the input from CPU and converts to human readable form
Types of output:- Hardcopy, softcopy
Hardcopy: The output that can be seen physically using a printer is called as hardcopy
Page 8 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar
**GE6151 – COMPUTER PROGRAMMING**
Softcopy: The electric version of output that is stored in a computer or a memory card, or a hard disk
Ex: Monitor, Printer, Plotter
Monitor:-
It is the most popular output device
It is also called as Visual Display Unit (VDU)
It is connected to a computer through a cable called Video cord
It can be monochrome or color monitor
LCD: Liquid Crystal Display monitors
o They are flat type of screen. Liquid crystals are used for display in the screen
CRT: Cathode Ray Tube monitors
o They are old-fashioned TV set like monitor
Printer:-
The output of a computer can be printed using Printer, to get the hardcopy
Laser printer, Inkjet printer: Impact printers. They give fast printouts with good quality using LASER
Dot matrix printer: non-impact printers. Their quality is poor, they are used for billing purpose
Plotter:-
They are used for printing graphics
They are used in CAD/CAM
Pen plotters take printout by moving a pen across the surface of a piece of paper
Memory Unit:-
memory
Primary Secondary
memory memory
RAM ROM
Page 9 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar
**GE6151 – COMPUTER PROGRAMMING**
o We can store the important data into the ROM
o Ex: Hard disk
PROM:
Programmable Read Only Memory
They contain 1000 of fuses burnt, applying 12V to the memory boxes
These fuses say 0 or 1
EPROM:
Erasable Programmable Read Only Memory
They can be deleted
This chips have glass panel, UV rays are passed
Fuses are rearranged in UV rays (all bits become 1)
EEPROM:-
Electrically Erasable Programmable Read Only Memory
They can be erased using electric current
RAM:-
o They are used for storing programs and data that are executed
o It is different from ROM
o Random Access Memory
o It can be read and written
o It is volatile
o When the power is turned off, its contents are erased
o It is also called as RWM (Read Write Memory)
o It is faster than ROM
o Static RAM (SRAM) and Dynamic RAM (DRAM) are its types
o Its cost is high
o Its processing speed is also high
Cache memory:-
o It is a very small memory used to store intermediate results and data
o It stores the data that are more frequently called for processing
o It is present inside the CPU, near the processor
o It is used for the faster execution
Secondary Storage:-
o The speed of primary memory is fast, but secondary memory is slow
o But the memory capacity of primary memory is low. So, secondary memory is used
o It contains large memory space
o It is also called as additional memory or auxiliary memory
o Data is stored in it permanently
o Ex: Magnetic tape, Hard disk, Floppy, Optical Disc, USB drives
o Magnetic tape:-
It is used for large computers like mainframe computers
Large volume of data is stored for a long time
It is like a old tape-recorder cassette
They are cheap
They store data permanently
Its diameter is 12.5mm to 25mm, length is 500M to 1200M
It is compact, low cost, portable, unlimited storage, easy to handle
o Hard disk:-
Hard disks are disks that store more data and works faster
It can store 10GB to 2TB
It consists of platters
Two heads are there for read and write
It is attached to single arm
Information in hard disk is stored in tracks
A track location that cuts across all platters is called as a cylinder
All platters have same no.of tracks
o Floppy Disk
They can store 1.4MB of data
They are 5.25 to 3.5 inch in diameter
They are cheap, portable
Page 10 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar
**GE6151 – COMPUTER PROGRAMMING**
o Optical Disk:-
CD-ROM:
Compact Disk
They are made of reflective material
High power laser beam is passed to store data onto CD
Cost is low, storage capacity is 700MB
Its size is 4.5inches in diameter
It can only be READ, cant be written
Only a single side can be used for storage
DVD:
Digital Video Disk
It is the improved version of CD
It can store 4.7GB of data
Both the sides are used for storage
They cannot be scratched or damaged like CD
USB drives:-
They are commonly called as PEN DRIVES
They are removable storage
They are connected to the USB port of a computer
They are fast and portable
They store larger data when compared to CD, DVD (1GB to 64GB pendrives)
Page 11 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar