0% found this document useful (0 votes)
78 views

Computer Programming - Unit1

The document provides an introduction to computers, including definitions of key concepts like hardware, software, algorithms, and programming. It discusses the evolution of computers from first to fifth generations and compares characteristics of analog and digital computers. The document also contrasts types of computers like micro, mini, mainframe, and super computers. Finally, it defines programming concepts like RAM, ROM, pseudo code, flowcharts and their advantages and disadvantages.

Uploaded by

jaba123jaba
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views

Computer Programming - Unit1

The document provides an introduction to computers, including definitions of key concepts like hardware, software, algorithms, and programming. It discusses the evolution of computers from first to fifth generations and compares characteristics of analog and digital computers. The document also contrasts types of computers like micro, mini, mainframe, and super computers. Finally, it defines programming concepts like RAM, ROM, pseudo code, flowcharts and their advantages and disadvantages.

Uploaded by

jaba123jaba
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

**GE6151 – COMPUTER PROGRAMMING**

UNIT 1 – INTRODUCTION TO COMPUTERS

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

6. What are the advantages and disadvantages of second generation of computers?

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 

14. Compare RAM and ROM


RAM ROM
 It is a volatile memory  It is a non-volatile memory
 It is used for both READ and WRITE operations  It is used for READ operation only
 It has small storage capacity  It has large storage capacity
 It is temporary  It is permanent
 Its cost is high  It is cost effective
 Processing speed is high  Processing speed is low

15. What is an algorithm?


 An algorithm is defined as a step by step procedure for solving a problem.
 It is a set of rules to solve a problem.
16. What are the characteristics of an algorithm?
 It has a finite number of inputs
 Every instruction is clear and short
 It should have a proper ending
 Each step should be important.
 Overall output should be got only after the algorithm ends.
 It should contain the steps one-by-one to solve the problem
17. What is a pseudo code?
 Pseudo = copy (or) Duplicate, Code = instructions
 It cannot be compiled or executed
 It is written in natural language such as English, etc
 It is used to concentrate on algorithm
Page 2 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar
**GE6151 – COMPUTER PROGRAMMING**
18. What are the advantages and disadvantages of pseudo code?
Advantages Disadvantages
 It can be easily prepared in Word processor  It does not have pictures
software
 Easily modified  There is no rules for preparation
 It is simple because it is written in English  It cannot be compiled or executed
 No confusing symbols are used 
 No rules are followed 
 It is easy to understand the problem 

19. What is a flow chart?


 A flow chart is a diagrammatic representation that illustrates the operations to be performed one-by-one.
 It contains different symbols.
20. What are the advantages and disadvantages of flow charts?
Advantages Disadvantages
 It is easy to understand  It cannot be prepared for difficult programs
 A problem can be analysed easily with flowchart  Alterations and modifications cannot be done easily
 It gives clear idea of a program  It is not typed, so its preparation is little difficult
 It acts as a guide during the program development
 It helps to clear the errors in coding
 It helps in maintenance of code

PART – B

1. What are the characteristics of a computer?


a. Speed:-
 Computers are very fast in processing
 They solve large problems in less time
 They are faster than humans
 They do millions of calculations per second
b. Accuracy:-
 They perform calculations accurately; accuracy means, without any error
 They process large amount of data without error
c. Storage:-
 A computer can store large amount of data in primary memory and secondary memory
 Storage is calculated in BYTES. 1 BYTE = 8 BITS. 1 BIT = 0 or 1
 8Bits = 1 BYTE, 1024 Bytes = 1KB, 1024KB=1MB, 1024 MB = 1GB, 1024GB = 1TB
d. Versatility:-
 Computers are versatile; versatile means, perform many works at same time
 They are used for doing arithmetic and logical operations
e. Diligence:-
 They do not get tired even after performing many calculations
 They perform all the tasks with same accuracy and speed
f. Automation:-
 The computers perform operations without stopping.
 They do the process one by one according to the instructions
2. What are the applications of a computer?
 It is used to store, display, send and receive information
 It is used to draw graphs, pictures
 It is used in medical clinic and labs
 It is used to control rockets and aeroplanes
 It is used for banking purpose also
 It is used in horoscope
 It is used in Crime investigation
 It is used to control Robots

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

Second generation of computers:-

 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

Fourth generation of computers:-


 IBM introduced Personal Computers (PC) that can be used in home / office / schools
 The size of the computer became still smaller
 Number of personal computers doubled from 1million in 1981 to 5.5million in 1982
 After 10years, 65millions PC were used.
 Apple’s MacIntosh OS also introduced in 1984, that is user friendly design.
 Ex: Intel 400L, Apple series I and II, IBM
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

Fifth generation of computers:-


 Many advances came in science and technology in this generation
 Parallel processing is used, it means, many CPU work as one CPU
 Superconductor technology is used in this generation
 Information flow is fast because of superconductor
 Ex: Expert systems help doctors to cure the patient’s disease
 Artificial intelligence is a branch of computer science that makes the computers behave like humans
 Artificial intelligence is used in: Games, Expert systems, Natural language, Neural networks
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.

4. Write the differences between analog and digital computers


Analog computers:-
 Analog computers represent the data as physical quantities
 It performs operation based on measuring
 It is designed to process data of varying quantities
 It solves problems in voltage, current, etc
 They are useful in simulation and evaluation of dynamic situations
 It contains operational amplifier
 Computer’s capacity is determined by number of amplifiers
 They are used in speedometres, watt-hour metres
 Ex: Electronic weighing scale, patient heart beat, blood pressure

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

5. Explain about mainframe and super computers


Mainframe computers:-
 It is an ultra-high performance computer, made for high storage.
 It contains high quality computer processor, processor, hardwares
 It is used for storing large volumes of data, highly important online transaction, etc
 It is very powerful and large computer
 Its operating speed is MIPS – Million instructions per second
 Ex: IBM ES000, VAX8000, CPC6600

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

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 

6. Explain the basic organization of a computer.


The organization of a computer has four major parts:- They are
a. Input Unit
b. CPU
c. Output Unit
d. Memory unit

Page 6 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar
**GE6151 – COMPUTER PROGRAMMING**

Input Unit Memory Unit Output Unit

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

Magnetic Semiconductor Semi-random


Thin-film Serial access
memory access memory
core memory memory
memory

RAM ROM

Static Dynamic PROM EPROM EEPROM


RAM RAM
Primary storage:-
 It is a part of CPU
 Its storage capacity is limited
 It contains magnetic core or semiconductor cells
 It is used for temporary storage
 Magnetic core memory:
o It contain a small dough-nut shaped objects made of ferromagnetic material
o Current is passed through wire in one direction, magnetized in one direction
 Semiconductor memory:
o It contains IC chips on silicon
o They are small, high processing speed, low power is used, cheap, easy to assemble
 ROM:
o Major type of memory in a computer is called ROM
o Read Only Memory
o It can be read, cannot be written
o It is used for storing permanent values
o ROM does not gets erased, even after the power is switched off
o They are non-volatile ( information cannot be erased)

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)

Important example programs:-


 Example program 2
 Example program 4
 Example program 5
 Example program 6
 Example program 7
 Example program 9
 Example program 10
 Example program 11
 Example program 13

Page 11 of 11
“There is no shortcut for success; Work hard and get success” – Sachin Tendulkar

You might also like