Thursday 17 September 2020

A guess paper of computer science for Grade XI -2076

 Unit: 1

Evolution, Generation of Computer

Short Questions and Answers

Define the term computer. Explain the basic operations performed by the computer .

Ans: The term computer is derived from the Latin word computare, which means to calculate. Computer is an advanced electronic device that takes raw data as input from the user and processes these data under the control of set of instructions (called program) and gives the result (output) and saves output for the future use. It can process both numerical and non-numerical (arithmetic and logical) calculations.


The computer can store and manipulate huge amounts of data at very high speed, but a computer can not think. A computer makes decisions based on simple comparisons such as one number being larger than another.


When a computer is asked to do a job, it handles the task in a very special way.

It accepts the data from the user. This is called input.

It stored the data until it is ready for use. The computer has memory chips, which are designed to hold data until it is needed.

It processes the data. The computer has an electronic brain called the Central Processing Unit, which is responsible for processing all data and instructions given to the computer. It includes ALU (Arithmetic and Logic Unit), CU (Control Unit) and register.

It returns the processed data to the user. This is called output.

What are the advantages and disadvantages of computer? Explain.

Ans: Advantages of computers are:

a. Accuracy : Computers operate with almost 100% accurate. It follows GIGO principle and so it does not make mistakes.

Speed : Computers do calculation at very fast rate.

Reliability : Computer users can rely on functioning of computer systems as they do not have moving parts.

 


-1-

 Versatile : Computers can perform variety of tasks.


 Diligence : Computers are capable of doing required tasks again and again without affecting speed, accuracy and efficiency.


 Storage : Computer can store huge amount of data.


Disadvantages of computer are:


 Computer is an automatic device, even it requires operator to operate the computer.


 Computer is very expensive in comparison to other electronic devices, so every people can not afford it.

 Computer can not think itself to give decisions.


 Computer requires technical person for maintenance if it does not work properly.


 It can have negative effects on your social life and interactions with other people if you do not maintain the balance between time online and offline.


 It may have a negative effect on your eyesight due to radiation.


Distinguish  between  the  terms  ‘Hardware’,’  Software’


and ‘Firmware’.

Ans: Hardware:


Hardware is the physical components of which can be touched and felt. A physical component may be electronic, electrical, mechanical or optical used to perform various functions in the computer. The different types of hardware components are input devices,output devices,storage devices and processing devices.Hardware is useless without software.


It is normally affected by agent like dust, heat, humidity, etc. Hardware understands only machine language or binary. Examples:-RAM,Pen drive,CPU,Joystick etc.


Software:


Software is the collection of programs which can not be touched and felt.The main objective of software is to enhance the performance capability of hardware. It has no permanent structure but can be altered and reused.Software required licence to operate.The types of software are system software and application software.Example:-Windows XP, MS Word, MS Excel etc.


Firmware:

 

The computer programs permanently stored in ROM or PROM are called firmware.These programs are provided by hardware manufacturer along with the computers. Generally these are booting programs which help in the starting of a computer. Such programs cannot be erased or overwritten.


Explain the following terms:

a. Program b.Bug c.Device d.Debug

Ans: Explanations of the following terms are:


Program


A collection of instructions that perform certain task and is written in the form of computer language is called program. A program is used for perrforming a specific task such as finding total, percentage, division and result of students in college.


Bug


It has been observed that many successful programs fail in certain circumstances due to the presence of errors in the program. A programming error (mistake caused by faulty logic) is known as a bug.


Device


Any units or parts used in the computer system are called devices. They are mostly used for the purpose of input, output and storage. For example: Mouse, Keyboard, Light Pen, VDU, Sound System, HD Drive, Floppy Drive, CD Drive etc.

 


 


 



Debug


Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware thus making it behave as expected. Debugging tends to be harder when various sub-systems are tightly coupled, as changes in one may cause bugs to emerge in another


What do you know about data,instruction and information?Explain.


Ans: Data


Data is a collection of facts, such as values or measurements. It can be numbers, words, measurements,observations or even

 

just descriptions of things. Not only numbers, the term ‘Data’ also refers all types of text, images, audio, video etc. Text includes alphabets, numbers, special symbols like ? , . / ~ @ # $ % ^ & * ( ) _ + < > etc.


A more specific and technical meaning of data is that “Data is a Representation of facts, concepts, or instructions in a formalized manner suitable for communication, nterpretation, or processing by humans or by automatic means.”


Instruction


Instruction is the command given to the computer to perform certain operation.Without instruction,any type of operation can not be obtained.Example: Here A=60 and B=95 are data. These are added to get total.


Total=A+ B

This is an instruction.


Information


Simply speaking, ‘Information’ is the processed ‘Data’, means when we do some processing on given raw data, the result produced is referred to as ‘Information’..Examples:-150 is the information getting from the data A=75 and B=75 and instruction,i.e.,Total=A+B.


 Why PC is becoming popular now a day? Explain. Ans: PC is becoming popular because of the following reasons:


 Speed


Modern computers have incredible speed of processing. Computer speed is measured in units of millisecond (one thousandth of a second), microsecond (one millionth of a second), nanosecond (one billionth of a second), and picoseconds (one trillionth of a second). Super computers can carry out millions of instructions per second (MIPS). The speed of computer depends on nature of architecture used.


 Accuracy


Computer can ensure consistently very high degree of accuracy in computations. ~t processes data according to the sequence of instructions . Hence, if input data and procedures are correct, the output will be consistently accurate.Every computer follows the rule of GIGO.


 Diligence


Computer is free from fatigue. It does not get tired of work and never loses concentration. It can perform basic

 

arithmetic operations with the same degree of speed and accuracy for any extent of time continuously, with the same amount of efficiency as the first transaction.


Storage capacity


Computers can store enormous quantity of information. Which is expressed in terms of Kilobytes (or) Mega Bytes (MB) or Gega Bytes (GB). It is achieved through its ‘Main memory’ or ‘Primary storage’ and through ‘auxiliary storage’ or ‘Secondary storage’. The Hard disks,Floppy disk, Compact Disc(CD) and Magnetic Tape storage are examples of secondary storages.These large volumes of storage occupy much lesser space compared to paper documents and this aspect of computers makes them more powerful.


Versatility


Computers are versatile in that they can perform almost any task, provided they are given the appropriate logical steps. For example, they are capable of performing wide ranging tasks such as construction of a payroll, inventory management in a factory, hotel billing, hospital management, banking applications and any imaginable task in every walk of life.


Automatic


A Computer is an automatic machine because a task has started, a computer can proceed its own till its completion. However, computer can not start themselves or can not do any task without human assistance. A computer can be programmed to perform a number of tasks with the help of programs.


What do you mean by generation of computer? Explain the characteristics of third generation computers.


Ans: Generation of computer means change in size , cost ,architecture, speed,languages used from olden days to most modern days.


The main features of third generation computers are:


They were much smaller than second generation computer. So, it required smaller space.


They had faster primary and auxiliary memory as compared to second generation computers.

 

They consumed much less power than second generation computers.

The operating speed of computer was nanoseconds.


They were reliable, better performance and had larger storage capacity.

The size of computer became much smaller.


They were used for both scientific and commercial applications.


State the characteristics of 4th generation computers. Ans: The main characteristics of fourth generation computers are:


a.  Fourth generation computers are microprocessor-


based systems.


These computers are very small.


Fourth generation computers are the cheapest among all the other generations.

They are portable and quite reliable.


These machines generate negligible amount of heat, hence they do not require air conditioning.


Hardware failure is negligible so minimum maintenance is required.

The production cost is very low.


GUI and pointing devices enable users to learn to use the computer quickly.


Interconnection of computers leads to better communication and resource sharing.


The operating speed was in Picoseconds.

They were used for general purposes.


Distinguish between third and fourth generation of computers.


Ans: Differences between third and fourth generation computer:


Third generation computer Fourth generation

computer

a.  Duration = 1965 to 1975 a.  Duration   =1975 to

present

b.  IC  chips  with  SSI  (Small b.  Initially,  IC  chips  with

Scale Integration) and MSI LSI (Large Scale

(Medium Scale Integration) Integration)  and VLSI

were used as CPU (Very Large Scale

components in this Integration) were used as

generation. CPU components in this

 


-6-

 

generation. But, later on

microprocessors were

used.

c.  Magnetic  disks  were  used c.  Magnetic  disks became

for auxiliary memory. the common source  of

external storage media.

d.  The   operating speed of d.  The operating  speed  of

computers was in computers was in

nanoseconds. picoseconds.

e.  Time sharing operating e.  Graphic user interface

system, Cache memory and operating system, optical

virtual memory were memory and flash

introduced. memory were

introduced.

f. High  level  language  like f. 4th generation languages

PL/1, PASCAL, BASIC, and application software

Pascal etc was introduced. for microcomputers

became more popular.

g.  Initially, Magnetic core g. Semiconductor memories

memories were used for were used for main

main memory but, later on, memory.

semiconductor memories

were used for main

memory.

h.  Flexible  input  and  output h.  More advanced devices,

devices,  i.e. Keyboard i.e. Multimedia

and monitor were keyboard, optical mouse

developed. or wireless keyboard,

and Mouse and LCD or

Plasma screen were

developed for input and

output.

i. Examples: ICL 1900, i. Examples: IBM PC,

IBM 370 series, Honeywell Apple Macintosh, IBM

2200 series, CDC 7600, 3033, HP 300 etc.

STAR-100 etc.


What is an AI? What are uses of AI? Explain.


Ans: AI is the study of how to make the computers think and perform. The ability of computer to understand natural language, speak command, capacity to see surrounding and have thinking power, is called AI.

 


-7-

 

A machine with reasoning, learning and logic capability is said to possess artificial intelligence. For example, expert system posses artificial intelligence. An artificial intelligence system has a knowledge based and programming technique to probe and process the facts in knowledge base. An expert system is a software which utilizes a knowledge base collected from human specialists in a certain area and help users refer to this expertise in making their own decisions.


Uses of AI are:


Expert systems: An expert system is software based on certain concepts of AI that acts as a consultant or an expert, in a specific field, topic or discipline to solve a problem or make a decision. Expert systems are also referred as knowledge-based systems. They can offer


opinions, suggest possible diagnosis and suggest various solutions to a problem.


Robotics: Robotics is the area of study dealing with the design, construction and operation of robots. A robot is a machine that can be programmed to carry out a complex task. Robots are used for dangerous jobs, such as bomb disposal, ocean exploration, outer-space probes, cleanup of a chemical or nuclear accident etc.


Voice recognition: The computer with voice recognition accepts data or instruction by having commands spoken into the computer’s microphone.


Problem solving: Problem solving is the process of identifying a problem, recognizing its major characteristics, formulating a solution plan, dividing the problem into smaller parts, assigning those parts to be solved, solving each part and finally combining the individual solutions into the solution of the original problem


Natural language processing (NLP): It is the ability of the computer to understand and translate natural (everyday) language.


Logic and inference: AI is used to make deductions and then to draw inferences.


Search

Finding an object within a collection of objects.


Finding a preferred answer or best answer to a problem.


Finding the winning strategy in a game

 


-8-

 

Finding a sequence of operations by which to solve a problem (puzzle)


What do you know about Vacuum Tubes, Transistor and ICs? Explain.

Ans: Vacuum Tubes


The vacuum tubes were a glass device, which used filaments as a source of electronics,could control and amplify electronic signals. It was the only high-speed electronic switching device available in those days. The vacuum tubes required great amount of energy and generated much heat. Lost of space was required not only for the large number of vacuum tubes but also for housing special air-conditioning units to get rid of heat generated by tubes.


Vacuum tubes were the earliest electronic devices, which were used in the first generation computer and vacuum tubes were developed by Lee Deforest in 1908. The early television (TV) set also used such tubes. It is a device for controlling flow of electrical current.


Transistor


Transistors were made of solid materials principally called silicon and germanium semiconductor material rather than glass. Therefore they were cheap to produce. One transistor replaced the equivalent of 40 vacuum tubes. Transistors were found to conduct electricity faster and better than vacuum tubes. They were also much smaller and gave off virtually no heat compared to vacuum tubes. Their use marked a new beginning for the computer. Transistors were highly reliable as compared to tubes, since they had no part like filament, which could burnt out. They were much smaller, less expensive to produce than tubes. They could switch much faster (almost ten times faster) than tubes


The transistors were used in second generation of computer and were developed by John Braden, William Shockley and Walter Brattain in 1947 at Bell laboratories in US.


It is the basic unit in radio, television and computer circuits. It is often used to amplify the current flowing from one circuit to another. Transistor consists three connecting parts: a base, an emitter and a collector.

 





-9-

 

C


B


Symbol of transistor


E

IC (Integrated Circuit)


An Integrated Circuit (IC), also called a microchip, is an electronic circuit consisting of a large number of electronic components like transistors, resistors and capacitors placed on a single silicon chip, eliminating wired interconnection between components. IC chips are much smaller in size, faster in operation, consumed much less power, high performance and more reliable than transistor and vacuum tubes. Initially, the integrated circuits contained only up to 100 components and the technology named as SSI. Later, with the advancement in technology for manufacturing ICs, it became possible to integrate from 100 to 3000 components on a single chip and this technology named as MSI. They function as timers, amplifiers, logic units, counters, calculators, temperature sensors, and radio receivers.


The IC was used in third generation computers and was patented by Jack St. Clair Kilby and Robert Noyce in 1958.


What  are  the  advantages  of  transistor  over  vacuum

tubes? Explain

Ans: Advantages of transistor over vacuum tubes are:


Transistors could switch much faster (almost ten times) than vacuum tubes.


Transistors were used as CPU components in second generation computer where as vacuum tubes were used as CPU components in first generation computer.


They were much smaller in size. So they required less space.


They consumed almost one-tenth the power consumed by a tube.


They gave off virtually no heat compared to vacuum tubes.


Transistors were highly reliable as compared to tubes, since they had no part like filament, which could burnt out.


-10-

 

They were rugged and easier to handle than tubes, since they were made of germanium semiconductor material rather than glass.


They were less expensive to produce than vacuum tubes.


What is an IC? How IC have made radical change in computer design technology? Explain.


Ans: An Integrated Circuit (IC), also called a microchip, is an electronic circuit consisting of a large number of electronic components like transistors, resistors and capacitors placed on a single silicon chip, eliminating wired interconnection between components.


IC chips are much smaller in size, faster in operation, consumed much less power, high performance and more reliable than transistor and vacuum tubes. So the size of computer became smaller and take less space to keep and easy to handle. Due to its low cost and reliability, most of the people can afford it.


Explain the different generation of computers.


Or,Discuss the generation of computers.


Ans: The generation of computer means change in size and cost, devices used, languages used etc from olden days to most modern days. The generations of computers are given below.


First generation computer (1942-1955)


Vacuum tubes were used as CPU components, acoustic delay lines for main memory, magnetic tape and magnetic drum for secondary memory. Data and instructions were fed into system using punch card. The instructions were written in machine level language. Examples: ENIAC, EDVAC, EDSAC etc. It had low operating speed (milliseconds, i.e. 10-3 sec).


Second generation computer (1955-1965)


Transistors were used as CPU component, magnetic core for main memory, magnetic tape and disk for secondary memory. Data and instructions were fed into system using punch cards. The operating speed was increased up to the microsecond(10-6 sec).They were more reliable, accurate and had larger, faster primary and secondary storage. There was an overall

 



-11-

 

reduction in system and operating costs. Examples:-IBM 7090, , CDC 1604, IBM 1620, IBM 1401, Honey well 400 etc


Third generation computer (1965 – 1975)


Initially,ICs, i.e.SSI and MSI could replace transistors, and later on, the semiconductor memories (RAM and ROM) replaced the magnetic core memory as primary storage medium. The magnetic disk was used as secondary storage medium, keyboards and video display terminals were introduced. Cache memory was also introduced. Multiprocessing, multiprogramming, multi-user system were introduced. The concept virtual memory was introduced.


The operating speed was increased to nanoseconds, 10-9 sec.ANSI FORTRAN and ANSI COBOL and time sharing operating system was used.PL/1, PASCAL, BASIC were notable high level language of the 3rd generation. Examples:-IBM system/360, ICL 1900, IBM 370 series, Honeywell 2200 series, CDC 7600, STAR-100 etc


Fourth generation computer (1975-Present)


The fourth generation computer used LSI (large Scale Integration) and VLSI (Very Large Scale Integration) circuits for internal operations.


The microprocessor, which is the main component of fourth generation computer, the semiconductor memories (RAM and ROM) are used as primary storage and magnetic disk (floppy disk, hard disk), optical disk (CD-ROM, CD-RW, CD-R, CD-R/W) and flash memory are used as secondary storage.


As smaller computers but more powerful, they could be linked together, or network, to share memory space, software, information and communicate with each other. So, these computers are mostly used in offices, home, teaching and other organizations.


Fifth generation computer (coming generation)


These computers will use ULSI (Ultra Large scale Integration) chips and contains millions of components into single IC. Such computers will use intelligent programming, knowledge-based problem solving techniques, high performance multiprocessor system. This computer will understand natural languages. This computer will possess

 


-12-

 

Artificial Intelligence (AI), which will be similar to human intelligence


Write down major drawbacks of the first generation of computers.


Ans: The major drawbacks of the first generation of computers:


 The size of computer was larger, so it occupied large space to place.


 The working speed was very slow.


 The storage capacity of the computer was very less.


 There was no flexible input/output devices to handle the computer.


 They had heat and maintenance problem.



Long Questions and Answers


What are the application areas of computer? Explain in detail.


Ans: Application areas of computers are:


Police


The record keeping task of police work was long handled by using a diversity of manual systems. Quick nationwide or international utilization of records and files was impossible. Advances in computer networking permit the linking of many police and investigate databases and make possible development of national criminal investigation system. Interpol is an example of international computer network that coordinates the exchange of criminal intelligence to aid police agencies in searching for fugitives or missing persons or property.


Traffic control


The traffic control devices assist the driver in making safe, efficient, consistent decisions. Traffic signal controllers are electronic devices located at intersections that control the sequence of the lights. Along with computers, communication equipment and detectors to count and measure traffic, the controllers are frequently

 


-13-

 

grouped together to control a large number of traffic signals, either at intersections in a city or on ramps approaching express ways and motorways.


Education


Computers have become increasingly important in education not only as a field of study but also as reference and teaching aids. Teachers are using computers to organize and prepare course material; children are being taught to use computers at early age. When computer is used as a teaching aid it is referred to as computer-assisted instruction (CAI). In education field, Computer can be used for multimedia presentation.


Publishing


Computer is playing very important role in the field of publishing, i.e to publish the books, magazines and newspapers etc. The publishers use computer to design entire pages of the books or magazines or pamphlets. Many writers and publishers use Internet to collect information that is used for compiling a new book or magazine. Some websites allow you to download an entire book, called an electronic book (e-book).


E-Commerce (Electronic Commerce)


E-commerce is a financial business transaction conducted electronically between business partners over on Internet. Transactions can occur instantaneously and globally with e-commerce, this saves time for participants on both ends. The users can buy, sell and exchange of products via computer network. Today, many mobile can also access the internet on wireless.There are various types of e-commerce such as business-to-commerce, consumer-to-consumer, mobile commerce etc. The following services are mostly used in e-commerce or e-business.


E-Mail


It is the most popular service through which we can electronically send and receive messages anywhere in the world. It is working as online post office .It is used for both text and voice message.

 


-14-

 

Video Conferencing


A video conference is a meeting between two or more people located at different location in the world. They can watch and talk with each other but not able to touch. Internet makes it possible. Devices (i.e. video camera, speaker, microphone) and special video conferencing software are required to participate in video conferencing.


It provide normal meeting environment, enabling both parties to see, hear and present material, just as if they are in the same room.


E-Shopping (Electronic Shopping)


Many businesses now have websites that allow internet users to buy goods or services. Shopping can take place using a computer at home, or at a cyber cafe. The e-shop can be anywhere in the world and it remains open 24 hours a day. You can purchase any goods such as books, software, movies, computers, cars, airline tickets etc. on the web.


Hospital


Computer is used in every area of medical field such as laboratories, researches, scanning, monitoring etc. which are helping the doctors to diagnose diseases etc.


The main uses of computer in medical fields are:


Maintaining patient records and history


Firstly, the complete information and medical history of patient is stored into the computer before check up of patient. The complete medical history is delivered to the related doctor for the check up of patient. So time is saved for doctors.It is very easy and efficient way to organize records than paper-based records.


Diseases Diagnosis


Computer is also used in hospital for diagnosis the patients.General use of computer in hospital is to scan the body of patient. A special scanner is used for this purpose. A scanner sends electromagnetic rays

 


-15-

 

through a patient body and sensors detect that how much patient's body have affected to any type of disease(i.e. cancer). For example, the CAT (Computerized Axial Topography) scanner passes rays over the patient. A CAT scanner takes many X-rays around the body. It displays an image that enables physicians to look beneath the patient's skin. As the scanner passes over the patient, it displays image of bone and tissue structure of patient on a computer screen


Discuss how the development of the PC (Personal Computer) has extended the use of computer at present days.


Ans: The development of personal computer has taken a long period of time to extend the use of computer at present days. There were not the advanced technologies in the ancient days. So, it passed through a several phases to become this phase at present days. The development of computer from ancient days to present days is as follows:


a. Abacus


Abacus was probably the earliest of counting devices. It consists of rectangular wooden frame with two compartments and beads sliding along the steel wires for counting.Multiplication and divisions are done using repeated additions and subtractions. Even today in which cross strings are fixed. Beads are inserted on to the strings. There are a number of rows of beads.


b. Napier’s logs and bones:


John Napier, a Scottish mathematician invented logarithms. The use of logarithms enabled him to transform multiplications and division problems of addition and subtractions. In the beginning he called logarithms as artificial numbers. But later he named them logarithms.Napier also invented a computing device consisting of sticks with numbers carved on them. These sticks are called bones as they were made of bones. These bones helped a lot in multiplication involving large numbers.


c. Slide rule

 


-16-

 

As the name indicates, the slide rule has one scale sliding within the other. Suppose you want to add two numbers 3 and 5, set 3 on the fixed scale and slide the moving scale. So that its “0’ coincides with”5” of sliding scale. This is the sum of 3 and 5. The process of reading could be quick if you are trained in the use of slide rule.


d. Calculating machines and Pascal’s calculator:


A French mathematician, Blaise Pascal invented a machine based on gear wheels. He was the son of tax collector who had to do lot of calculations as part of his job. Blaise Pascal wanted to make his job easier by inventing a calculator. You might be familiar with gear wheels in use in your bicycle which meshes with a driving chain. He used similar gear wheels with ten teeth for each digit position. He fixed them together so that one wheel drives the other. When the wheel corresponding to units position rotated by ten teeth, it drove the wheel corresponding to the next higher position by one tooth. Thus one could make calculations. Pascal provided dials, which indicated numbers stored on each wheel. He also used suitable “dialing system” to operate the gear wheels. Other people also made a number of such calculators . Computer scientists honoured Pascal by naming a programming language Pascal after him.


e. Babbage difference and analytical engines. Babbage, a British National and the son of a wealthy banker wanted to correct the errors in the logarithm tables being used during his time. In 1822, he made a machine which calculated the successive difference of expressions (X2 + ax + b is an example of an expression) and prepared table which helped him in his calculations. The royal Astronomical society awarded a gold medal to him for his invention and granted a large sum of money to carry out further work. He wanted to make an accurate calculating machine called “Babbage’s Analytical Engine”. The analytical Engine was supposed to be very accurate.

 


-17-

 

So it needed lot of parts made with precision. Babbage could not make such parts. He conceived that his machine would use input devices, would have a processing part called “mill” where you can perform calculations, would also incorporate It consists of rectangular frame in which cross strings are fixed. Beads are inserted on to the strings. There are a number of rows of beads .Since he was about 100 years ahead in his ideas, he could not get parts needed for his machine. This is because there were no tools to make such precision parts. He did lot of work related to making precision parts and spend all the grants (and lot of his money too) but failed in his attempt to make a machine. He ultimately died as a frustrated man.


f. Lady Ada Lovelace


Lovelace is the daughter of the famous English poet Lord Byron. She was a mathematician. She studied the works of Babbage and wrote about them. From her account only,we can see the close resemblance of the modern day computers and Babbage’s work. Lady Ada Lovelace’s contributions are very important. Since she predicted that computers can be programmed, a language, Ada used widely in America’s Department of Defence Computers was named after her.


g. Herman Hollerith’s Machine


Governments all over the world collect details about the number of people living in their countries. This information helps the Government in planning for the future, Sometimes you find enumerators (people taking such details) coming to your house with forms to collect such details.This operation is called “census” which is normally done once in 10 years.In the United States a census was carried out in 1880 and the U S Government was processing the census data. Even as this was going on, the next census was due in 1890. To process the census of 1890 fast, the overnment announced a

 


-18-

 

competition.Dr. Herman Hollerith Produced cards out of special paper pulp, designed punching machines to punch holes in the card to count census figures and invented sorting machines to read such punched card and collect data. He could complete the job within three years, achieving a speedup of about three times.


h. ABC Computer:


In 1937, Dr. John Atanstoff with the help of his assistant Berry designed the Atanstoff Berry Computer (ABC). The machine laid the foundation for the development of electronic digital computer.


ENIAC- Electronic Numerical Integrator and Calculator


In 1947 john Mauchly and Eckart completed the first large scale Electronic Digital Computer, ENIAC. In this computer, each time a program was changed, the wiring had to be completely rearranged. It weighed


30 tons, contained 18,000 vacuum tubes and occupied a space of 30 50 feet.


EDSAC-Electronic Delay Storage Automatic Calculator:


Maurice V.Wilkes of Cambridge University completed EDSAC in 1949. EDSAC was the first computer to operate on the stored program concept.


UNIVAC-I – Universal Automatic Computers:

In 1947, after ENIAC became operational


Mauchly and Eckart formed their own


Company- The Eckart-Mauchly Computer Corporation”. Immediately after this they started the design of UNIVAC-I. This was purchased by US bureau of Census. UNIVAC was the first computer dedicated to business applications


Explain the history of mechanical calculator in chronological order.


Ans: The history of mechanical calculators are:


Pascaline

Stepped Reckoner

Jacquard's Loom

Difference and Analytical Engine

 


-19-

 

e. Hollerith Tabulator


All the explanations are in questions no. 9(B). Mechanical Calculating Device)


Explain the evolution of computer describing technologies used in different generations.


Ans: Generation of computer means change in size , cost ,architecture, speed,languages used from olden days to most modern days. The generations of computers are given below.


a. First generation computer (1942-1955)


The computer, using vacuum tubes as the electronic devices are called first generation computers. Vacuum tubes were developed by Lee Deforest in 1908.


They were huge in size and occupied a large space. It consumed more electrical power and produced more heat. So, special air conditioning arrangement was needed to get rid of heat generated by tubes


Vacuum tubes were used as CPU components, acoustic delay lines for main memory, magnetic tape and magnetic drum for secondary memory. Data and instructions were fed into system using punch card. The instructions were written in machine level language. Examples: ENIAC, EDVAC, EDSAC, IBM series-IBM 701, IBM 704, IBM 709 etc.


The first generation computers were mainly used for scientific computations.


Limitations: The storage capacity of computer was limited. It had low operating speed (milliseconds, i.e. 10-3 sec). They had limited programming capability. They had heat and maintenance problem. The system cost and working cost were very high. They were restricted to commercial applications.


b. Second generation computer (1955-1965)


Second generation computer started after the invention of transistors by Trio group (John Braden, William Shockley and Walter Brattain) in 1947 at Bell laboratories in US.


Transistors were made from materials principally called silicon and germanium semiconductor material rather than glass. Transistors were smaller, faster, cheaper

 


-20-

 

and highly reliable than vacuum tubes. These transistors had no filament, so they consumed less power and generated less heat. That is, they required less electricity and emitted less heat than vacuum tubes. The size of computer became smaller than the first generation computer.


Transistors were used as CPU component, magnetic core for main memory, magnetic tape and disk for secondary memory. Data and instructions were fed into system using punch cards.


Second-generation computer replaced machine language with assembly language to replace long difficult binary codes for giving instructions. Due to availability of large memories, some high level languages such as COBOL (Common Business Oriented Language) and FORTRAN (Formula Translator) came in common use during this time.


The operating speed was increased up to the microsecond range (10-6 sec).They were more reliable and accurate than first generation computers. They had larger, faster primary and secondary storage as compared to first generation computer. There was an overall reduction in system and operating costs.


Second generation computers were used in payroll, inventory control, marketing and production planning. Examples:-IBM 7090, IBM 7094I IBM 7094II, CDC 1604, IBM 1620, IBM 1401, Honey well 400 etc


Third generation computer (1965 – 1975)


The third generation computers replaced transistors with


“Integrated Circuits (IC)” popularly known as chips.IC was developed by Jack St. Clair Kilby and Robert Noyce in 1958.


An IC, also called microchip, is an electronic circuit with a large number of components built on a small silicon chip. That is, all the components were squeezed on a single chip, which increased the speed and efficiency of computers.IC chips, are much small in size, faster in operation, consumed much less power, high performance and more reliable than transistor and vacuum tubes. Initially, the integrated circuits contained only up to 100 components and named as SSI. Later, with the

 


-21-

 

advancement in technology for manufacturing ICs, it became possible to integrate from 100 to 3000 components on a single chip and named as MSI.


Initially,SSI and MSI could replace transistors, and later on, the semiconductor memories (RAM and ROM) replaced the magnetic core memory as primary storage medium. The magnetic disk was able to replace magnetic tape as secondary storage medium, keyboards and video display terminals were introduced. Cache memory was also introduced. Multiprocessing, multiprogramming, multi-user system were introduced. The concept of virtual memory was introduced.


The operating speed was increased to nanoseconds, 10-9 sec. Less man power was required at assembly stage. They were smaller in size but had high memory capacity.ANSI FORTRAN and ANSI COBOL and time sharing operating system was used.PL/1, PASCAL, BASIC were notable high level language of the 3rd generation. Examples:-IBM system/360, ICL 1900, IBM 370 series, Honeywell 2200 series, CDC 7600, STAR-


100 etc


Fourth generation computer (1975-Present)


The fourth generation computer used LSI (Large Scale Integration) and VLSI (Very large Scale Integration) circuits for internal operations.


A single silicon chip of LSI or VLSI has thousands of ICs built on it. This chip reduced the physical size of the computer and increased their power, efficiency and reliability. The speed of operation is measured in pico-seconds (10-12 sec). Because of the VLSI technology, it becomes possible to build many computing functions on a single chip.


The microprocessor, which is the main component of fourth generation computer, is a semiconductor device consisting of electronic logic circuits manufactured by using VLSI technique. Then in 1971, American Intel Corporation developed first microprocessor (microchip) called 4004 microprocessor. Today, such a microprocessor contains millions of transistors. It is capable of performing various computing functions and making decisions to change the sequence of program

 


-22-

 

execution. Since 1973, many American companies started to manufacture microcomputers. For examples, IBM PC, Apple/ Macintosh, Wang Laser, Letron etc. ICL 2950/10 (International Computer Limited Company) was brought in Nepal for census 2038 B.S.


The semiconductor memories (RAM and ROM) are used as primary storage and magnetic disk (floppy disk, hard disk), optical disk (CD-ROM, CD-RW, CD-R, CD-R/W) and flash memory are used as secondary storage.


The fourth generation computers are user-friendly due to development of operating system and application software. As smaller computers but more powerful, they could be linked together, or network, to share memory space, software, information and communicate with each other. So, these computers are mostly used in offices, home, teaching and other organizations.


e. Fifth generation computer (coming generation)


Up to fourth generation, the classification was based purely on hardware. Fifth generation computers are classified based on software also. VLSI technology is used in fifth generation computers. They have large main memories. The speed is also high. In addition to all this, Fifth generation computers run software called ‘expert systems’.


Characteristics of Fifth Generation computers:


i.Mega Chips:


Fifth generation computers will use Super large Scale integrated (SLSI) chips, which will result in the production of microprocessor having millions of electronic components on a single chip. In order to store instructions and information, fifth generation computers require a great amount of storage capacity. Mega chips may enable the computer to approximate the memory capacity of the human mind.


ii. Parallel Processing:


Most computers today access and execute only one instruction at a time. This is called serial processing. However, a computer using parallel processing accesses several instructions at once and works on them at the same time through use of multiple central processing units.


iii. Artificial Intelligence (AI):

 


-23-

 

It refers to a series of related technologies that tries to simulate and reproduce human behaviour, including thinking, speaking and reasoning. AI comprises a group of related technologies: expert systems (ES), natural language processing (NLP), speech recognition,vision recognition,androbotics.


State the features of first,second,third,fourth and fifth generation of computer.


Ans:        The main features of first generation of computers are: The main features of second   generation of computers


are:

They required less electricity and emitted less heat


They were smaller than first generation computer, requiring smaller space.


There was an overall, reduction in system and operating costs.


They were more reliable and accurate than the first generation computer.


They had faster and larger primary and secondary storage in comparison to first generation computers.


They were much easier to program and use than first generation computer. Hence, they had wider commercial use.


Assembly language and high level programming languages like FORTRAN, COBOL, and ALGOL & SNOBOL were introduced.


The main features of third generation computer are:

Question no.(3)


The main features of fourth generation computer are:

Question no(4)


The main features of fifth generation of computer are:


The development of the fifth generation of computer system is characterized mainly by the acceptable of parallel processing.


These computers will use super conductor technology. The two future devices are Gallium Arsenide and Biochips.


These machines will incorporate Ultra Large Scale Integration (ULSI).


The cost of hardware and software will decrease.


These computers will have artificial intelligence.

 


-24-

 

Unit: 2


Types of Computers


Short Questions and Answers


                                                                                                                         )                                                                                                                                    What are super computers ?Eexplain their applications in real life situations.


Ans: Super computers are the most powerful and fastest computers among digital computers. Super computers are multi-user, multiprocessor very large machine. Super Computers are single problem-oriented machine. These computers are capable of handling huge amounts of calculations that are beyond human capabilities. They can perform billions of instructions per second (BIPS). Some of the today’s super computers have the computing capability equal to that of 40,000 microcomputers. A Japanese supercomputer has calculated the value of PI () to 16 million decimal places. These computers cost in 15 – 20 million-dollar range (most expensive).


Most supercomputers run on a Linux or UNIX operating system, as these operating systems are extremely flexible, stable, and efficient. They need large space and temperature controlled room. Examples: CRAY–1, CYBER 205, CDC–Star 100, NEC 500, PARAM and ANURAG etc.


Among them, PARAM and ANURAG are supercomputers produced by India and are exported to many European countries.


Applications: Supers computers are typically used for number crunching including scientific oriented machine, weather forecasting, simulations, creating computer (animated) graphics, analysis of geological data (e.g. in petrochemical prospecting), structural analysis, computational fluid dynamics, electron designing, nuclear energy research and metrology.


Compare and distinguish between analog and digital computer.


Ans:  Comparison between analog and digital computer:


a) Analog computer is classified on the basis of operation where as digital computer is also classified on the basis of operation.


Features of both the computers are required to form hybrid computers.

 


-25-

 

Differences between Analog and Digital Computer



Analog Computer Digital Computer


Analog  computer  is  a.Digital  computer  is  a

one which is computer  which  stores

designed to work on data  in  terms  of  digits

numerical data (numbers) and proceeds

represented by in  discrete  steps  from

physical quantity (i.e. one state to another.


rotation or

displacement),

electrical charge

(voltage and charge),


temperature, weight

etc which varies

continuously.


It  is  single  problem  b.It is general or versatile


oriented  machine  or machine.

not versatile.


The accuracy of this  c.The  accuracy  of  this

computer is very low computer is very high.


It  has  low  storage  d.It   has   high   storage

capacity. capacity.

e. It is expensive. e. It is cheaper.

The output  is in the  f.   The output is in the form

form of graph of discrete values.

g. Have fewer g. Have  large  number  of

functions. functions

h. It    is slower    in h. It is faster in operation

operation than digital than analog computer.

computer.


Example  of  analog  i.Examples:   IBM   PC,


device is speedometer IBM compatible etc.

of an automobile.

j. The symbolic  j. The symbolic

representation of representation of digital

analog signal is signal is

 




-26-

 

3. Differentiate between “mini” and “mainframe”

computers.

Ans: Differentiation between mini and mainframe computers is

Mini Computer Mainframe Computer

a. Mini computers are a. Mainframe computers are

smaller than mainframe lager than mini computers.

computers .

b. They are cheaper. b. They are more expensive

c. They  are  slower(i.e.  2- c. They are faster(i.e. 30-100

30 MIPS) MIPS)

d. They have around 50 or d. They have around 100 or

more terminals. more terminals.

e. They have been widely used e. Mainframe computers are

asdata processing, generally used in big

engineering analysis, organization or

industrial application government for large scale

etc. data processing, credit

card processing, bank

account management,

generating life-like

animation etc.

f.  They  have lower  memory f. They have higher memory

capacity. capacity.

g.Examples:  AS 400, PRIME g.Examples:  IBM  4300 series,

Series.PDP-11, VAX ICL 39 series, CDC 6600,

7500, HCL, MAGNUM IBM 1401  and  CYBER

etc. 170 etc.


Compare and contrast between IBM PC and IBM Compatibles computers.


Ans: Comparision between IBM PC and IBM Compatible


The internal architecture of both the computers are same.


All the software designed for IBM PC can be used in IBM Compatible computers.

Both are digital computers and examples of 4th generation

computers.

Differences between IBM PC and IBM Compatible computer

IBM PC IBM Compatible

a.IBM PCs are produced a.IBM Compatibles are

by IBM company. produced by    companies

other than IBM but based on

the same principle  of IBM

 


-27-

 

PC.

b.It  is called branded or b.It  is  called  assembled  or

original PC. duplicate computer.

c.It  is  more  reliable  and c.It  is less reliable than IBM

durable than IBM PC.

Compatible.

d.It is more expensive than d.It is less expensive than IBM

IBM compatible. PC.

e.   It was specifically e. It was designed for general

designed for professional people and its parts are easily

and scientific  problem- available in the market..

solvers.

Differentiate  between  Super   Computer   and  Micro


Computer.

Ans: Differences between Super Computer and Micro Computer:


Super Computer Micro Computer

a. It is a single a. It is general purpose,single

purpose,multi-user and user and a single  processor

multi-processor computer.

computer.

b.  It is  large in  size  and b.  It  is  small  in  size  and

occupies large space. occupies small space.

c.   It is more   powerful c.  It  is  much  less  powerful

computer. computer.

d. It is expensive computer. d.   It   is   much   cheaper

computer.

e.  It can be operated  by e.It can be operated by general

experts. people.

f.   It is used in   wather f. It is used in

forecasting,petroleum schools,colleges,offices

engineering etc.Example:IBM PC,IBM

etc.Examples:CRAy- Compatible etc.

I,ANURAG etc.


Write short notes on laptop computers and palmtop computers.


Ans: Laptop Computers:


Laptop computer is also known as notebook computer. It is small size (85-by-11 inch) notebook computer and can fit inside a briefcase. The laptop computer is operated

 


-28-

 

on a special battery and it does not have to be plugged in like desktop computer. The laptop computer is portable and fully functional microcomputer.


The memory and storage capacity of laptop computer is almost equivalent to the PC or desktop PCs. It also has the hard disk, floppy disk drive, Zip disk drive, DVD-ROM drive, DVD-R/W etc. It has built-in keyboard and built-in trackball as pointing device. Laptop computer is also available with the same processing speed as the most powerful personal computer. It means that laptop computer has same features as personal computer. Laptop computers are more expensive than desktop computers. Various companies like DELL, Fujitsu, Sony, Toshiba, Acer etc produced laptops computers.


Palmtop computer:


In the mid 1990s, many new types of small personal computing devices have been introduced and these are referred to as handheld computers. These computers are also referred to as Palmtop Computers. The handheld computers sometimes called Mini-Notebook Computers. The type of computer is named as handheld computer because it can fit in one hand while you can operate it with the other hand. Because of its reduced size, the screen of handheld computer is quite small. Similarly it also has small keyboard. The handheld computers are preferred by business traveler. Some handheld computers have a specialized keyboard. These computers are used by mobile employees, such as meter readers and parcel delivery people, whose jobs require them to move from place to place. The examples of handheld computers are: Personal Digital Assistance (PDA), Cellular telephones and H/PC Pro devices


What is mobile computing?Explain.


Ans: Mobile Computing is a generic term describing your ability to use technology 'un tethered'(wireless), that is not physically connected, or in remote or mobile (non static) environments. The term is evolved in modern usage such that it requires that the mobile computing activity be connected wirelessly to and through the internet or to and through a private network. This connection ties the mobile device to centrally located

 


-29-

 

information and/or application software through the use of battery powered, portable, and wireless computing and communication devices. This includes devices like laptops with wireless LAN or wireless WAN technology, smart mobile phones, wearable computers and Personal Digital Assistants (PDAs) with Bluetooth or IRDA interfaces.


Types of mobile computing


Many types of mobile computers have been introduced since the 1990s, including the: a. Laptop computer


b. Sub notebook

c. Personal digital assistant (PDA)

d. Portable data terminal (PDT)

e. Mobile data terminal(MDT)

f. Tablet personal computer

g. Smart phone

h. UMPC


What ae the advantages and disadvantages of micro computer?


Ans: Advantages

They are small and portable.

They are relatively inexpensive.

They work as soon as they are switched on.

They have excellent graphic capabilities,

They do not occupy much space.

They do not consume much power.


Disadvantages

Micros have a limited storage capacity.

They are relatively slow.


Long Questions and Answers


Classify the computer on the basis of size,explain each of them briefly.


Ans: Classification of computers on the basis of size are:

Super Computers

Mainframe Computers

Mini Computers

Micro Computers

 


-30-

 

Explanations of each of them are:


Super computer:Question no.(1)


Mainframe Computer:


Mainframe computers are multi-user, multi-programming and high performance computers.They operate at a very high speed, have very large storage capacity and can handle the workload o f many users. Mainframe computers are large and powerful systems generally used in centralized databases. The user accesses the mainframe computer via a terminal that may be a dumb terminal, an intelligent terminal or a PC. A dumb terminal cannot store data or do processing of its own. It has the input and output device only.An intelligent terminal has the input and output device, can do processing, but, cannot store data of its own. The dumb and the intelligent terminal use the processing power and the storage facility o f the mainframe computer. Mainframes use proprietary operating systems, most of which are based on UNIX, and a growing number on Linux. Mainframe computers are generally used in big organization or government for large scale data processing, credit card processing, bank account management, generating life-like animation etc.


. Example - IBM 4300 series, ICL 39 series, CDC 6600, IBM 1401 and CYBER 170 etc.


Mini Computer:


The size of the mini-computer is in between the size of micro and main frame computers.It is more powerful than a micro computer. Mini computers are usually designed to serve multiple users. They have been widely used as data processing, engineering analysis, industrial application etc.These computers accept all high level languages.


So they are called mid-range computer. They can support 50 terminals (i.e. 50 persons can work at the same time with single minicomputer). They require area of 100 sq. ft. The first minicomputer was introduced in the mid-1960s by Digital Equipment Corporation (DEC). Minicomputers are commonly used as servers in network environment and hundreds of personal computers can be connected to the network with a minicomputer acting as

 


-31-

 

server like mainframes, minicomputers are used as web servers.Examples: AS 400, PRIME Series.PDP-11, VAX 7500, HCL, MAGNUM etc.


Micro Computer:


Microcomputers are small, low-cost and single-user, general purpose digital computer. They consist o f CPU, input unit,output unit, storage unit and the software. Although micro computers are stand-alone machines, they can be connected together to create a network of computers that can serve more than one user. IBM PC based on Pentium microprocessor and Apple Macintosh are some examples of microcomputers. It requires small space, can be placed on a table or even kept inside a briefcase.They are mainly used in offices, homes, schools, shops, stores etc. Microcomputers include desktop computers, notebook computers or laptop, tablet computer , handheld computer etc.


Classify the computer on the basis of operation,explain each of them briefly.

Ans: Classification of computer on the basis of operations are:

Analog Computer


Digital Computer


Hybrid Computer Explanations of each of them are:

Analog Computer


Analog is the Greek word, which means similar. So, in analog computers, the similarities between any two quantities are measured by electrical voltages or current. The analog computers operate by measuring instead of counting.The analog computer works on the supply of continuous electrical signals. The display is also continuous. Its output is in the form of graphs.


It is single problem oriented machine, offer low cost and ease in programming. Mathematical principles applied for data processing in analog computer are logarithm, summation, exponentiation, calculus, multiplication and division etc.


The main disadvantage of this computer is its low accuracy,limited storage capacity and lower speed

 


-32-

 

.Example of analog device is speedometer of an automobile. They are mostly used in engineering and scientific applications. Eg: Thermometer, Speedometer, Petrol pump indicator, Multimeter


The symbolic representation of analog computer is








b) Digital Computer


Digital computer is a computer which stores data in terms of digits (numbers) and proceeds in discrete form from one state to another. In digital computers, even letters, words and whole texts are represented digitally.The main advantage of digital computer is its accuracy,speed,large memory space and versatility. Digital computers are mostly used in the preparation of reports, results, tabulation and graphic representations. Thus, they help in mathematics, engineering, business, accounting etc.Examples of digital devices are calculators,digital watches, and digital thermometers etc and examples of digital computer are: IBM PC, IBM compatible etc.


The symbolic representation of digital computer is







c) Hybrid Computer


A computer, which has a combined feature of both analog and digital computers, is called hybrid computer. It helps user to process both continuous and discrete data. It can transfer data from analog to digital and vice-versa. These computers are generally used in aero planes, scientific applications, industrial control processes etc. Here are two functional examples:


During the launching of rockets, the analog computers measure the speed of the rocket, temperature and pressure of atmosphere. These

 


-33-

 

measurements are then converted into digital signals and supplied to the digital computer to analyze the data for taking appropriate steps on launching.


In an Intensive Care Unit (ICU) of hospital, analog devices measure heart function, temperature and other signs of patients. Then these measurements are converted into digital signal and fed to the digital computer that monitors the patient’s vital signs.


Classify the computers on the basis of brand,explain each of them briefly.

Ans: Classification of computer on the basis of brand are:


IBM PC (International Business Machine Personal Computer)


IBM Compatible

APPLE/Macintosh

Explanations of computers are:


a) IBM PC:


IBM PCs are microcomputers produced by IBM Company. These computers are more reliable, durable and have better quality. They are more expensive than IBM compatible computers. It was a complete system - with a built-in monitor, keyboard, and data storage .It was specifically designed for professional and scientific problem-solvers, not business users or hobbyists


b) IBM Compatibles:


IBM Compatible Computers are IBM clones or PC clones; computers that are internally almost the same as the IBM PC but the cost are less. The internal architecture of IBM compatible is similar to IBM PC. So they are called duplicate computers. They have same functional characteristics and principles of IBM PC. All the software designed for the IBM PC can be used in IBM compatible computers. These computers are cheaper than IBM PC and their parts are easily available in the market.


c) Apple/Macintosh:


This computer is manufactured by Apple/Macintosh company with totally different internal architecture from that of IBM. They have their own softwares. The OS produced by Apple Company for their Macintosh is called Mac OS. These computers are mostly used in desktop publishing.

 


-34-

 

Unit 3-Number System



Short Questions and Answers


What is a number system? Explain different types of number system.


Ans: A number system is a system concerned with the number. The distinguishing characteristic of a number system is its base or radix. The base (or radix) of a number system is defined as the number of digits. For example, the base 2 for binary system (0 and 1), base 8 for octal (0, 1, 2, 3, 4, 5, 6 and 7)


Depending on the base, the number system is divided into following four types:


Decimal Number System

Binary Number System

Octal Number System

Hexadecimal Number System


Decimal (Denary) Number System


A number system having base 10 is called denary number system. It utilizes the symbols of numbers from 0 to 9,i.e.0,1,2,3,4,5,6,7,8 and 9. It is also known as denary number system. Examples: (124)10, (101.90211)10 etc.


Binary Number System


The binary number system is base-2 number system, which uses only two digits, 0 and 1. The digits 0 and 1 are called binary digits or bits. The numbers written with base 2 are called binary numbers. For example, (101101)2.


Octal Number System


The octal number system is a base-8 number system, i.e., it has eight unique digits 0, 1, 2, 3, 4, 5, 6 and 7. The numbers written with base 8 are called octal numbers. For example, (45623)8.


Hexadecimal Number System


A number system which has base 16 is called hexadecimal number system. The symbol used in this system are the decimal digits from 0 to 9 and six additional digits which are generally represented as A, B, C, D, E and F instead of

 



-35-

 

10,11,12,13,14 and 15.It is also known as hex number system.


Examples - (2AB)16, (ABD.5C)16 etc.


How to convert binary number into decimal number system? Explain with examples.


Ans: Method for converting both fractional and non-fractional part of binary number into decimal number system is as follows:


Method-I (For Non fractional part or Numeric part)


To convert binary to decimal, firstly arrange the position of given number from right to left and starts from 0.


Multiply the given number by base with the position of number in the form of power.


Find the product of number which is in the form of power

Sum all to get desired decimal number.


Method-II (For Fractional Part)


To convert binary to decimal, firstly arrange the position of given number from left to right and starts from -1.


Multiply the given number by base with the position of number in the form of power.


Find the product of number which is in the form of power.

Find the fractional value.

Sum all to get the desired decimal number.

Examples:


(1101)2=(?)10


=Position of Binary numbers


1 1 0 1

3 2 1 0


= 1  23 + 1  22 + 0  21 + 1  20

= 1  8 + 1  4 + 0  2 + 1  1 [20 = 1]


8 + 4 + 0 + 1


13


(1102)2  = (13)10


(1011. 101)2


Position of Binary number


=   1 0 1 1 . 1 0 1

3 2 1 0 -1 -2 -3 Positions

 


-36-

 

(1 x 23 + 0 x 22 + 1 x 21 + 1 x 20) + (1 x 2–1 + 0 x 2–2 + 1 x2–3)


(1 x 8 + 0 x 4 + 1 x 2 + 1 x 1) + (1/2 + 0/4 + 1/8)


(8 + 0 + 2 + 1) + (0.5 + 0 + 0.125)


(11) + (.625)


(11.625)10


Thus  (1011.101)2 = (11.625)10


How to convert decimal number into binary number system? Explain with examples.


Ans: Method for converting both fractional and non-fractional part of decimal number into binary number system is as follows:


Method I (for non fractional part)


Divide the decimal numbers by the base of number system.


Keep a note of remainder at the right side of one column.


Repeat process till the quotient is zero.


Result is obtained by writing the result in reverse order,i.e. from MSB to LSB


Method II (for fractional part)


Multiply the decimal number by the base of number system.


Keep a note of product part in the right side of one column.


Repeat the process until the product part is zero. If there is no zero product part, then repeat the process up to 8 times.


Result is obtained by writing the result from LSB to MSB after decimal point.


Examples:

(43)10 = (?)2


= 43 R

2

2 21 –– 1 (LSB)  [... LSB = Least Significant

Bit]

2 10 –– 1

2 5 –– 0

 


-37-

 

2  ––  1


1  ––  0



0 –– 1 (MSB) [... MSB = Most Significant Bit]


(101011)2


(43)10 = (101011)2


How to convert octal number into decimal number system? Explain with examples.


Ans: Method for converting both fractional and non-fractional part of octal number into decimal number system is as follows:


Method-I (For Numeric part)


To convert octal to decimal, firstly arrange the position of given number from right to left and start from 0.


Multiply the given number by base with the position of number in the form of power.


Find the product of number which is in the form of power


Sum all to get desired decimal number.


Method-II (For Fractional Part)


To convert octal to decimal, firstly arrange the position of given number from left to right and start from -1.


Multiply the given number by base with the position of number in the form of power.


Find the product of number which is in the form of power.


Find the fractional value.


Sum all to get the desired decimal number.


Examples: a) (764)8 = (?)10


= 7 6 4





2  1  0   Position of the octal numbers.

7  82 + 6  81 + 4  80

7  64 + 6  8 + 4  1 [... 80 = 1]

448 + 48 + 4


500


(764)8 = (500)10

 



-38-

 

b)(246)8= ( ? )10 and (.563)8 = ( ? )10


Position of numbers 2 4 6





2 1 0


2  82 + 4  81 + 6  80

2  64 + 4  8 + 6  1


128 + 32 + 6 = 166  (246)8 = (166)10


and


(.563)8


5 x 8–1 + 6 x 8-2 + 3 x 8–3


5/8 + 6/64 + 3/512


0.724609375


(246.563)8 = (166. 724609375)10


How to convert decimal number into octal number system? Explain with examples.


Ans: Method for converting both fractional and non-fractional part of decimal number into octal number system is as follows:


Method I (for non fractional part)


Divide the decimal number by the base of number system, (i.e. 8 for decimal to octal).

Keep a note of remainder at the right side of one column.

Repeat process till the quotient is zero.


Result is obtained by writing the result in reverse order,i.e. from MSB to LSB


Method II (for fractional part)


Multiply the decimal number by the base of number systems


Keep a note of product part in the right side of one column.


Repeat the process until the product part is zero. If there is no zero product part, then repeat the process up to 5 times.


Result is obtained by writing the result from LSD to MSD after decimal point.


Examples:

a) a. (70)10 = (?)8

Ans:

 


-39-

 

8 70

R


8  ––  6


1  ––  0


0 –– 1 = (106)8


 (70)10 = (106)8


(958.640625)10 = (?)8


= First Part Second Part

8 0.640625x 8 = 5.125 = 5

958

8 119 – 6 0.125x8 = 1.0 = 1

8 14 – 7 = (.51)

8 1 – 6

= (1676)8

=(.51)8



Thus,(958.640625) = (676.51) 8


How to convert hexa-decimal number into decimal number system? Explain with examples.


Ans: Method for converting both fractional and non-fractional part of hexa-decimal number into decimal number system is as follows:


Method-I (For Numeric part)


To convert hexadecimal to decimal, firstly arrange the position of given number from right to left and starts from 0.


Multiply the given number by base with the position of number in the form of power.


Find the product of number which is in the form of power

Sum all to get desired decimal number.


Method-II (For Fractional Part)


To convert hexadecimal to decimal, firstly arrange the position of given number from left to right and starts from -1 at the position of decimal point.


Multiply the given number by base with the position of number in the form of power.


Find the product of number which is in the form of power.

Find the fractional value.

Sum all to get the desired decimal number.

 


-40-

 

Examples:


(2AC)16 = (?)10


Ans: 2  162 + A  161 + C  160 [ A = 10]

2  256 + 10  16 + 12  1


512 + 160 + 12


(684)10


(2B6D. 5A6B)16 =(?)10


=First Part


2B6D


=2 x 163 + B x 162 + 6 x 161 + D x 160 =8192 + 2816 + 96 + 13


=(11117)10

Second Part

.5A6B

= 5 x 16–1 + A x 16–2 + 6 x 16–3 + B x 16–4

1 1 1 1

=5 x + A x + 6 x + B x

16 162 163 164

=0.3125 + 0.0390625 + 0.0014648437 + 0.0016784667 =(0.35319519)10


Thus (2B6D . 5A6B)16 = (11117.35319519)10


How to convert decimal number into hexa-decimal number system? Explain with examples.


Ans: Method for converting both fractional and non-fractional part of decimal number into hexa-decimal number system is as follows:


Method I (for non fractional part)


Divide the decimal number by the base of number system, (i.e. 16 for decimal to hexadecimal number).

Keep a note of remainder at the right side of one column.

Repeat process till the quotient is zero.


Result is obtained by writing the result in reverse order,i.e. from MSB to LSB


Method II (for fractional part)


Multiply the decimal number by the base of number system.


Keep a note of product part in the right side of one column.

 





-41-

 

Repeat the process until the product part is zero. If there is no zero product part, then repeat the process up to 5 times.


Result is obtained by writing the result from LSB to MSB

after decimal point.

Examples: a) (679)10 = (?)16


=


16 679

R

16 42 –– 7

16 2 –– 10   = A

0 –– 2



= (2A7)16


(679)10 = (2A7)16


(165.75)16= (?)10

= First Part Second Part

165 .75

16 165

= 6 10 – 5 =.75 x   =  12.0 12

0 – 10 =A = C

= (A5)10


(165.75)10 = (A5.C)10


How to convert binary number into octal number system? Explain with examples.


Ans: Method for converting both fractional and non-fractional part of binary number into decimal number system is as follows:

 


Method-I (For Numeric Part)


As 8=23, for converting binary to octal number, separate group of 3-binary bits from right to left.


Check all the separated


bits are the combination of three digits or not. If not,

 



Decimal Octal Binary

0 0 000

1 1 001

2 2 010

3 3 011

4 4 100

5 5 101

6 6 110

7 7 111

 


-42-

 

then add 0s to make the combination of 3-bits at the left side of left end.


After making the combination of three bits, put the octal equivalent value from the table.


Method-II (For fractional Part)

As 8=23, for converting binary to octal number, separate group of 3-binary bits from left to right at the position of decimal point.


Check all the separated bits are the combination of three


digits or not. If not, then add 0 to make the combination of 3-bits at the right side of right end .


c. After making the combination of three bits, put the octal equivalent value from the table.

Examples:


(11101)2 = (?)8


Ans: (11) (101) [Arrange the 3 - binary bits from right to


left side]


(011)  (101)  [If there is no 3 bits at the left side of left


end, then add 0s to make 3-bits and put


octal equivalent values from table]


5


(35)8


(11101)2 = (35)8



(1011.1011)2 = (?)8


First Part 1011


Making 3-bits from right to left 1 (011)


Add 0s to make 3-bits at the left side


(011)


13


Second Part


.1011


Make 3-bits from left to right


(101)1


Add 0 to make 3-bit at the right side


(100)


(.54)


Thus (1011.1011)2 = (13.54)8

 


-43-

 

How to convert octal number into binary number system?


Explain with examples.


Ans: Method for converting both fractional and non-fractional part of octal number into binary number system is as follows:


Example: a.(7341)8 = (?)2


= 7 3 4 1



111 011 100 001  Take the binary equivalent


number from the table.


= (111011100001)2 Combine all bits


(7341)8 = (111011100001)2


How to convert hexa-decimal number into binary system? Explain with examples.


Ans: Method for converting both fractional and non-fractional part of hexa-decimal number into binary number system is as follows:


Method


To convert hexadecimal number to binary number, put the binary equivalent values of given hexadecimal number from the table.


Combine all to get binary number.

Example:


(CAFE)16 = (?)2


Ans: C A F E



(1100) (1010) (1111) (1110) [Put binary equivalent


values]


= (1100101011001110)2    [Combine all to get binary numbers]


How to convert binary to hexa-decimal number? Explain with examples.


(11011)2 = (?)16


Ans: (1) (1011)  Arrange the 4-binary bits from right to left

= (0001) (1011)


B [Convert the equivalent hexadecimal number]


(1B)16

 



-44-

 

11. How to convert hexa-decimal number into octal number

system? Explain with

Decimal Octal Binary

examples.

0 0 0000

Ans: Method for converting both

1 1 0001

fractional and non-fractional

part of hexa-decimal 2 2 0010

number  into octal number 3 3 0011

system is as follows:

4 4 0100

Method –I (for non-

5 5 0101

fractional part)

6 6 0110

a) To convert hexadecimal 7 7 0111

8 1000

to octal number system,

9 1001

put the binary

equivalent values   of A (10) 1010

given hexadecimal B (11) 1011

number from the table. C (12) 1100

b) Combine all

D (13) 1101

c) Separating the group of

E (14) 1110

3-binary bits from right

F (15) 1111

to left end.

d) If there is no 3-binary bit at the left side of left end, add

0s to make 3-binary bits.

e) Put  octal  equivalent  values  from the  table to  get  the

desired octal number.


Method –II (For fractional part)


To convert hexadecimal to octal number system, put the binary equivalent values of given hexadecimal numbers from the table.


Combine all.


Separating the group of 3-binary bits from left to right end at the position of decimal point.


If there is no 3-binary bit at the right side of right end, add 0s to make 3-binary bits.


Put octal equivalent values from the table to get the desired octal number.


Examples:

(5A3)16

Put binary equivalent values from the table and take the 4-

binary bits from right to left side

5 A 3


 


-45-

 

(0101) (1010) (0011).

=  (010110100011)  combine all the numbers

= (010) (110) (100) (011)  Arrange the 3-bits

from right to left

= 2 6 4 3  Take octal-equivalent

value

(2643)8


How to convert octal number into hexa-hexadecimal number system? Explain with examples.


Ans: Method for converting both fractional and non-fractional part into decimal number system is as follows:


Method –I (for non-fractional part)


To convert octal to hexadecimal number system, put the binary equivalent values of given octal number from the table.


Combine all


Separating the group of 4-binary bits from right to left end.


If there is no 4-binary bit at the left side of left end, add 0s to make 4-binary bits.


Put hexadecimal equivalent values from the table to get hexadecimal number.


Method –II (For fractional part)


To convert octal to hexadecimal number system, put the binary equivalent values of given octal number from the table.


Combine all


Separating the group of 4-binary bits from left to right end at the position of decimal point.


If there is no 4-binary bits at the right side of right end, add 0s to make 4-binary bits.


Put hexadecimal equivalent values from the table to get hexadecimal number.


Examples:


a(7470)8 = (?)16

Ans: 7 4 7 0

(100)(111)(000)    Take  3-binary

digits

from the table

= (111100111000)  Combine all the bits

 


-46-

 

= Arrange 4-binary bits from right to left and put hexa-equivalent values from the table.

(1111) (0011) (1000)

F 3 8


(F38)16

What is data code? Explain different types of data code.


Ans: The codes used to represent the digits; alphabets and special characters in computer are called computer data codes. Some of the popular data-codes are:


BCD (Binary Coded Decimal)


BCD is a binary coded notation in which each of the decimal digits are expressed as binary digits. It is a four-bit code to represent all decimal numbers. For example, BCD of 12 is 0001 0010 as opposed to 1100 in pure binary form. Some of the old computers used BCD. BCD numbers will only from 0000 to 1001. BCD does not contain numbers from 1010 to 1111.


EBCDIC(ExtendedBinaryCodeDecimal


Interchange Code)


It is an eighth bit binary code for large computers, i.e., mainframes. An EBCDIC code contains two points: for ‘numeric’ bit on the right and four ‘zone’ bits on the left. For example, EBCDIC of 1 is 1111 0001 and 2 is 1111 0010.


ASCII (American Standard Code For Information Interchange):


ASCII is a common computer code used for data communication, developed by American National Standard Institute [ANSI]. The standard ASCII code uses 7- bits to represent 128 different symbols or characters.


The ASCII value of ‘A’ is 65 and ASCII code is 1000001 and ASCII code for ‘a’ is 1100001.


Perform the following binary calculations:


10010 + 111 + 1000


b.11011 + 11101  11


Ans

 




-47-

 

a. 10010 + 111 + 1000


Ans: 1 0 0 1 0

+   1 1 1

Now, 1 1 0 0 1

1 1 0 0 1


1 0 0 0


0 0 0 0 1


b.11011 + 11101  11


Ans: 1 1 0 1 1


+  1 1 1 0 1


1 1 1 0 0 0


Now,


1 1 1 0 0 0


 1 1


1 1 1 0 0 0


1 1 1 0 0 0


1 0 1 0 1 0 0 0


What is 1’s complement? Mention the method of subtraction. Subtract (1101)2 from (11011)2 by using 1’s complement.


Ans: 1’s complement of a binary is formed by changing all 0s to 1s and all 1s to 0s.


e.g. given number =1010

Then 1’s complement of 1010 is 0101.


Method


Make both numbers to have same number of bits.


Find 1'S complement of the number to be subtracted.


Add this complement to the first number.


If there is any end around carry add it to the sum to get final answer.


The presence of end around carry indicates that the answer is positive and true binary form.


The absence of end around carry indicates that the answer is ‘–ve’ and is in 1's complement form.


A.To subtract smaller number from larger

To subtract a smaller from larger number

Make both numbers to have same number of bits.


Find 1’s complement of smaller number to be subtracted.


Add this complement to the first number.


-48-

 

If there is any end around carry add it to the sum to get final answer.


The presence of end around carry indicates that the answer is positive and true binary form.


Examples

11011 11011

01101   +10010 (1’s complement of 01101)

01110 101101



End around carry

Add end arounf carry to the result ,i.e., 01101

result + 1

01101+ 1

01110


B.To subtract the larger from smaller number


Make both numbers to have same number of bits.


Find the 1’s complement of larger number to be subtracted.


Add 1’s complement to the smaller number.


If there is no end around carry, the answer is in negative form with its 1’s complement.


For examples

1001 1001

1110  + 0001 (1’s complement of

1110)


1010


Here is no end carry. So the answer is in negative form with its (1010) 1’s complement.


Ans = - (1’s complement of 1010)

- 0101


What is 2’s complement? Mention the method of subtraction with examples.


Ans: 2’s complement= 1’s complement+1


i.e. 2’s complement of binary number may be formed by changing each 1s to 0s and each 0s to 1s plus 1.For example:

Given number = 101101

1’s complement = 010010

2’s complement = 010010+1

= 010011


Method

 


-49-

 

Subtraction using 2’s complement

Make both numbers to have same number of bits.

Find two complement of the number to be subtracted.


Add this 2'S complement with the minuend. Add if there is end around carry, then ignore the carry. And rest is the final answer.


If there is no end carry the answer is ‘-ve’ and will be in

1'S complement form of the answer.


If both the numbers are ‘-ve’ then the answer is ‘-ve’ and will be in 1'S complement form of answer. In this case, find 1'S complement for both and add 1 for answer.


Case A: To subtract smaller from larger number

Make both numbers to have same number of bits.


Determine the 2’s complement of smaller number to be subtracted.


Add 2’s complement to the larger number,i.e.minuend

If there is an around carry, then ignore the carry. And

rest is the final answer

For example:


11011 1’s comp 11011 2’s comp 11011

-01011 10100 +10101

110000

Ignore end around carry

Then the answer is 10000.



Case B: To subtract larger from smaller using 2’s mplement


Make both numbers to have same number of bits.


Determine 2’s complement of the larger number to be subtracted..

Add the smaller number with 2’s complement.


If there is no carry, then the answer is in negative

form with its 2’s complement

For example:

 









-50-

 

10001 1’s Comp 2’s comp 10001


11101    00010   +00011

10100


Here is no end carry. Therefore, the answer is in negative form with its (10100) 2’s complement.

So, 2’s complement of 10100 = 1’s complement

of 10100 + 1

= 01011 + 1

= 01100

Therefore, answer = -(01100)


Case C: If both the numbers are negative.

Example: – 01101 – 11011


2'S

–  00001110 2'S 11110010

– 00001001 11110111 1'S 2'S

111101001 00010110 00010111



end around carry (ignore carry)


Perform subtraction by using.1’s complement.


(a)110111 – 11011 (b) 1101 – 11011

Ans:   a)1 1 0 1 1 1 1 1 0 1 1 1

– 0 1 1 0 1 1   + 1 0 0 1 0 0

1'S

1 0 1 1 0 1 1


+ 1

end around carry

0 1 1 1 0 0 -

(b)  0 1 1 0 1 1'S 0 1 1 0 1

– 1 1 0 1 1 + 0 0 1 0 0

1 0 0 0 1


There is no around end carry, then answer is (-ve) and ones complement of (10001)2 = (01110)2


Perform subtraction by using 2’s complement.

11011 – 1011

1110000-110000


Ans:

(a) 1 1 0 1 1  1'S   1 1 0 1 1  2'S 1 1 0 1 1

–  0 1 0 1 1   1 0 1 0 0   + 1 0 1 0 1


1 1 0 0 0 0  1 0 0 0 0


-51-

 

end around carry (ignore carry)



(b) 111000 1'S 111000  2'S 111000

– 110000   001111  +010000


 1001000



end around carry (ignore carry)


What is 9’s complement? Mention the method of subtraction with examples.


Ans: Each digit of decimal number is subtracted from 9 to obtain

the 9’s  complement. of decimal number. Example:


i.9’s complement of 54 is (99-54) =45


ii.9’s complement of 234 is (9999-234) =765 etc


Examples:


i. Subtract (425 – 321) using 9’s complements.


9’s complement of 321 is 678.


Then add 4 2 5

6 7 8

1 1 0 3



1



1 0 4


If there is end around carry, that will be added to get final answer.

The final result is 104.


Subtract (425 – 581) using 9’s complements

= 9’s complement of 581 is 418

Then add 4 2 5

+ 4 1 8



If there is no end carry the answer is ‘-ve’ and will be in 9'S complement form of the answer.


9’s complement of 843 is 156 and the final answer -156.


What is 10’s complement? Mention the method of subtraction with examples.


Ans: The 10’s complement of a decimal number = 9’s complement of number + 1


i.e. The 10’s complement of a decimal number is equal to 9’s complement of decimal number plus one. e.g.

 



-52-

 

10’s complement of 16 = 9’s complement of 16 +1


= (99-16) +1


= 83+1


= 84


Examples:


Add (-24) and (-35).


Ans: The 9’s complement of 24 = 75

The 10’s complement of 24  =75 +1 = 78

The 9’s complement of 35 = 64


The 10’s complement of 35 = 64+1 = 65


78


65 (10’s complement of 78)

143



Ignore end around carry


9’s complement of 43 = 56

10’s complement of 43 = 56 +1=57 .The correct result is -57.

ii. Add (34) and (56)

Ans: 34

56 (10’s complement of 78)

90


If both the number is positive, these are simply added .10’s complement is not required. The result is positive and correct.

 





















-53-

 

Unit 4-Logic Function and Boolean Algebra


Syllabus


Key points to be remembered


From previous guess


Short Answers and Questions


Define Boolean functions. Construct truth table for AND operation of Boolean algebra.


Ans: A Boolean function is an expression which is formed with



binary variables. Example: C=X+ Y .Z


Here the variable C is a function of X, Y, Z. This can be written as C=f(X, Y, Z) and the right hand side of equation is called an expression.


Truth table of AND Operation


AND operation has two or more than two inputs to produce an output. AND operation is the logic circuit which produces output 1 when all the combination of inputs are 1.If any one of the input is 0, then the output will also be 0. ‘ . ’ or ‘^’ is used to represent AND operation. If X and Y are two input variables,then it can be written as X.Y.


Truth Table Graphical symbol

Inputs Output

X Y Z=X.Y

0 0 0

0 1 0

1 0 0 The boolean expression is

1 1 1 Z=X .Y


The venn diagram is






The shaded part is true part.


Construct the truth table of the AND and OR operations of Boolean algebra.


Ans: Truth table of AND and OR operations are:


Truth table of AND Operation [Question no 1of this unit.] Truth table of OR Operation

 


-54-

 

OR operation has two or more than two inputs to produces an output. The output of OR operation is 1 only when any one or all the combination of inputs is 1. “+” or “U” or “^” is used to represent OR operation.It produces output 0 when all the combination of inputs is 0. If X and Y are any two inputs, then it can be written as X+Y. It is also known as Inclusive-OR operation.


Truth Table Graphical symbol

Inputs Output

X Y Z=X+Y

0 0 0

0 1 1

1 0 1 The Boolean expression is

1 1 1 Z=X+Y


The venn diagam is






The shaded portion is true,


Construct truth table for NOR operation of Boolean algebra.


OR, Define NOR gate and draw its logic symbol.

OR, What is NOR gate and construct its truth table.

Ans: NOR operation is the combination of OR and NOT operation.

It has two or more than two inputs to produces an output. The

output of NOR operation is 1when all the combination of


inputs are 0. If X and Y are two input variables, then it can be

–––—

written as F = X+Y or (X+Y)’.

 


Truth Table



Inputs


X Y


0 0


1


0


1

 



Graphical symbol

Output

Z= X  Y

1

0

0 The boolean expression is

0 Z=

X  Y


 

The venn diagram is

A B



-55-

 


Write truth table for NAND operation of Boolean algebra


OR, Construct truth table for NAND operation.

Ans: NAND  operation  is  the  combination  of  AND  and  NOT

operation. NAND operation can have two or more than two

inputs to produce an output. The output of NAND operation

is 1 only when any one or all the combination of inputs is 0. If

X and Y are two input variables, then the output Z can be

written as  F = X .Y or (X.Y)’.

Truth Table Graphical symbol


 


Inputs


X Y


0 0


1


10


11

 


Output


Z= X .Y


1


1


1


0

 







The boolean expression is Z= X .Y


 

The venn diagram is


A B

NAND Operation



The shaded portion is true


What do you know about XOR and XNOR operations?Explain with truth table.


Ans: XOR operation


An XOR(Exclusive-OR) has two or more than two input variables to produces an output. The output of XOR operation is 1 if all the combinations of inputs are different and 0 when both or all the combinations of inputs are same.If X and Y are two input variables,then it can be written as F = X  Y, Here


denotes the XOR operation. X  Y and is equivalent to X.Y' + X'.Y. Truth table and symbol of the XOR gate is shown in the figure below.


-56-

 

Truth Table Graphics symbol

Inputs Output

X Y Z= X = AB' + A'B

X Y

or

0 0 0

The Boolean X = A  B

0 1 1

Algebraic

expression

1 0 1

Operation

is Z= X Y

1 1 0

The venn diagram is

A B



XOR Operation


The shaded portion is true.


XNOR operation


An Exclusive-NOR (XNOR) operation has two or more than two input variables to produces an output. It produces output 1 when all thecombination of inputs are same. It produces output 0 when all thecombination of inputs are different.If X and Y are two input variables, then it can be written as F =


X Y .  X Y is equivalent to X.Y + X'.Y'.


Truth Table Graphical symbol


 


Inputs Output

X Y Z= X Y

0 0 1

0 1 0

1 0 0

1 1 1



The venn diagram is



A

 


X


Z

Y



The Boolean expression is


Z= X Y




B

 



= XY +X'Y' Or


Z= X Y



Algebraic

Operation

 







XNOR Operation

 


-57-

 

What are logic gates? Differentiate between “NAND” and


“NOR” gate with truth tables.

Ans: Logic gates


A logic gates is an electronic circuit which has one or more inputs to produce an output. Input and output values are the logical values 1and 0.The value of the output depends only on the current value of the inputs. The different types of gates used in circuits of computer is AND, OR, NOT etc. Logic gates are the building blocks of any digital circuit.


Differences between “NAND” and “NOR” gate:


NAND gate NOR gate

a. NAND gate is the a.   NOR gate is the

combination of combination of OR

AND and NOT and NOT gates.

gates.

b. The   output of a b. The output of  NOR

NAND gate is 0 gate will  be 1, if  all

when all the the inputs are 0.

combination of

inputs are 1.

c.If X and Y are two c. If  X  and  Y  are  two

input variables, then input variables, then it

it can be written as can be   written as

X .Y . ––––

X+Y.

d. Truth Table d. Truth Table

X Y X .Y X Y X  Y

0 0 1 0 0 1

0 1 0

0 1 1

1 0 1 1 0 0

1 1 0

1 1 0

e. The Boolean e. The Boolean expression

expression is ––––

is  Z=X+Y.

Z= X .Y


 






-58-

 

f. The graphical f. The graphical symbol is

symbol is



Explain with truth tables about NOT gate.


Ans: It has only one input and one output. When a HIGH level is applied to an inverter, a LOW level appears on its output and vice versa.If X is the input, then output F can be written as F


X', Here apostrophe (') denotes the NOT (inversion) operation.


Truth Table Graphical symbol

Input Output

X X=X’=Y

0 1

The equation is Z=X’=Y

1 0



State and prove De Morgan’s theorem.

Ans:    Statements:


1’s Theorem


The theorem states that the complement of a sum (of the binary variables) is equal to the product of the complements


(of the variables).

(A + B)' = A'. B' (for 2 inputs)

(A + B +C)' =A'. B'. C' (for 3 inputs)

A B A+B (A+B) ' A B A' B' A'. B'

0 0 0 1 0 0 1 1 1

0 1 1 0 0 1 1 0 0

1 0 1 0 1 0 0 1 0

1 1 1 0 1 1 0 0 0

(A + B)' A'. B'

A X = A X

B B

NOR gate Bubbled AND gate

2’s Theorem


 


-59-

 

The theorem states that the complement of a product (of the binary variables) equals to the sum of the complements (of the variables).


(A . B)' = A'+ B' (for 2 inputs)

(A . B .C)' =A'+ B'+ C' (for 3 inputs)

A B A.B (A.B)' A B A' B' A'+ B'

0 0 0 1 0 0 1 1 1

0 1 0 1 0 1 1 0 1

1 0 0 1 1 0 0 1 1

1 1 1 0 1 1 0 0 0

(A . B)' A'+ B'

A A X

B X   = B

NAND gate Bubbled OR gate



State Duality theorem with example.

Ans: In Boolean algebras the duality Principle can be obtained by

Changing each OR (+) sign to an AND ( . ) sign

Changing each AND ( . ) sign to an OR (+) sign, and

Complementing each 0 and 1


Example: X (Y + Z) = XY + XZ By applying duality relation X + (Y.Z) = (X+Y) . (X + Z)


Explain the laws of boolean algebra. Ans: The laws of Boolean algebra are:


Another type of mathematical identity, called a "property" or a "law," describes how differing variables relate to each other in a system of numbers. One of these properties is known as the commutative property, and it applies equally to addition and multiplication. In essence, the commutative property tells us we can reverse the order of variables that are either added together or multiplied together without changing the truth of the expression:


Commutative Law


The commutative law of addition for two variables is algebraically expressed as


A + B = B + A

 



-60-

 

The commutative law of multiplication for two variables is expressed as


AB = BA

















Associative Law


The associative law of addition of three variables is expressed as

A + (B + C) = (A + B) + C


The associative law of multiplication of three variables is expressed as


A (BC) = (AB)C




















Distributive Law


The distributive law of three variables is expressed as follows:

A (B+C) = AB + AC


A + (B·C) = (A+B) · (A+B)

 


-61-

 

This law states that ORing several variables and ANDing the result is equivalent of ANDing the single variable with each of the variables in the grouping, then ORing the result.















Identity Laws

A+0=1 A.0=0


A+1=1 A.1=0


Complement Laws


 


A+ A



A.  A

 


=1


=0

 


What do you know about universal gates? Differentiate between ordinary algebra and Boolean algebra.


Ans: Universal gates are the ones which can be used for implementing any gate like AND, OR and NOT, or any combination of these basic gates; NAND and NOR gates are universal gates. But there are some rules that need to be followed when implementing NAND or NOR based gates


A universal gate is a gate which can implement any Boolean function without need to use any other gate type. The NAND and NOR gates are universal gates. In practice, this is advantageous since NAND and NOR gates are economical and easier to fabricate and are the basic gates used in all IC digital logic families. In fact, an AND gate is typically implemented as a NAND gate followed by an inverter not the other way around. Likewise, an OR gate is typically implemented as a NOR gate followed by an inverter not the other way around.


Differences between ordinary algebra and Boolean algebra:

 


-62-

 

Boolean algebra does not have operations equivalent to division and subtraction.


Ordinary algebra deals with real numbers, which contains an infinite number of elements (1, 2, 3…). But


Boolean algebra has only a finite set of elements. That is, it deals with only two elements 0 and 1.


The distributive law [(A +B). (A+C)= A +BC] does not hold on ordinary algebra.


Differentiate between AND and OR operations with truth


tables.

Ans: Differences between AND and OR operations is



AND operation OR operation

a. AND operation a. OR operation gives

gives output 1 when output 1 when any one

all the combinations or all the combination of

of inputs are 1. inputs are 1.

b. AND operation can b. OR operation can be

be represented as ‘.’ represented as “+” or

OR  ‘^’.f  X  and  Y “U” or “^”.If X and Y

are two input are two  input signals,

signals,  then it  can then it can be written as

be written as X.Y. X+Y.

c. Truth Table c. Truth Table

X Y X.Y X Y X+Y

0 0 0 0 0 0

0 1 1

0 1 0

1 0 0 1 0 1

1 1 1

1 1 1

d. The Boolean d. The Boolean expression

expression is is Z=X+Y

Z=X.Y

e. Graphical symbol is e. Graphical symbol is


 



-63-

 

Simplify the following Boolean expressions:


 


x .

 


y

 


.Z+

 


x

 


.Y.Z+X.

 


z

 


b) X

 


.

 


Y

 


.Z+

 


X

 


.Y.Z+X.

 


Y

 


Ans: Simplifications of the above Boolean expressions are:



a) x . y .Z+ x .Y.Z+X. z


 


= x .Z ( y +Y) +X. y



  x .Z(Y+ y )+X. y


  x .Z.1+X. y


x .Z+X. y


X . Y .Z+ X .Y.Z+X. = X .Z( Y +Y) +X. Y



= X .Z( Y +Y) +X. Y = X .Z.1+ X. Y = X .Z+ X. Y


 










Y


 

Prove the following Boolean expressions:


 


a. (A+B)(A+C)= A + BC b. (A+B).( A.B

Ans: proof of the booean expressions are:


a.(A + B)(A+C)


AA +AC + BA + BC


A + AC + BA + BC

A (1 + C) + BA + BC

A.1 +BA + BC


A + BA + BC

A (1 + B) + BC

A.1 + BC

A + BC Proved



b. (A+B).( A.B )



A.  A. +A .B +B .A +B .B


0+ A .B + B .A +0


A .B + B .A Proved


Draw the circuit diagram of the expressions:

a)


 


)=A. B + B.A




















following boolean

 


-64-

 


Ans: a.


A


B


C


A


B


A


B


C




b.

 


Y= (A + B) C + AB + A B

A+B (A+B) C

C

AB Y

A BC

Y= (A + B) C + AB + A B

Y=ABC + A BC + A  B C

A ABC

B

C

A A BC

B Y

C

A A BC

B

C


Y= (A + B) C + AB + A B

 























-65-

 

Unit 5: Computer System and Architecture

 


Short Questions and Answers


What is a computer system? Explain briefly the functions of input unit and control unit of a computer.


Ans: Computer system


The interconnection of input devices,output devices,storage devices and processing devices which is used for performimng certain operations is called computer system. Functions of input unit and control unit are:


Input Unit


Data and instructions are entered into computer through input devices.Input devices is used to convert data and instruction into binary form.The most commonly used input device is keyboard. Several input devices which do not require typing of information also have been developed i.e. joystick, light pen, mouse, trackballs etc. and these are called pointing device. Data and instruction can be entered into computer through input device in the form of typing, voice and picture. Keyboard is used for typing of information, microphone is used for voice input and scanner is used for entering data in the form of picture.


Control unit

Functions of CPUs are:


To control the use of primary memory to store data and instructions.

To control the sequence of all the tasks.

To carry out processing.


To carrying out commands to all parts of the computer system.


Explain the functions of CPU.


Ans: It is an electronic brain of a computer. A central processing unit (CPU) or processor is an electronic circuit that can execute computer programs. The CPU controls the operation of all other devices such as memory, input, storage and output devices. Under its control, programs and data are stored in the memory and displayed on the screen or printed through printer. This device receives, decodes, stores results and manages execution of data that flows through the CPU.


-66-

 

The CPU of small computer has a single processor but larger computers (i.e. Super Computers, Mainframe Computers and


Mini Computers) have a number of CPU called microprocessors, performing separate tasks. Some newer microprocessor (i.e. dual core processor) contains multiple chips and is encased in their own cover which fits into a special socket on the motherboard.


The CPU comes in different sizes; the very old ones were the 80386, or 80486. More recently the word Pentium I(80586),Pentium II,Pentium III,Pentium IZ,Dual Core,Core 2 Duo,i3,i5 and i7 have been given to denote the size.


The speed it carries out these tasks is calculated in Megahertz (Mhz) or GigaHertz(Ghz).


Some examples of CPUs are: Intel, AMD, CYRIX and Motorola.

Operations of CPUs are:


(a) To control the use of primary memory to store data and instructions.


To control the sequence of all the tasks.

To carry out processing.


To carrying out commands to all parts of the computer system.


What is a memory?Why RAM is called volatile and ROM


is called nonvolatile memory of computer system?


Ans: Memory is essential component of computer system used for storing data,instruction,programs, software etc either temporary or permamently.


RAM


RAM is called volatile memory of computer system because all the contents of RAM are stored in it as long as power supply is on.As the power supply goes off,all the contents of RAM are lost.


ROM


ROM is called non volatile memory of computer system because all the contents of ROMs are not lost even if power supply goes off.The contents are stored in the ROM at the time of manufacturing.


Explain the work done by ALU,CU and register. Ans: Work done by ALU,CU and register are:


ALU


It is the component of CPU where all the calculations are performed.It also does comparison and takes decision.

 


-67-

 

The ALU can perform basic operations such as addition, subtraction, multiplication,division, etc and does logic operations viz, >, <, =, ‘etc. Whenever calculations are required, the control unit transfers the data from storage unit to ALU once the computations are done, the results are transferred to the storage unit by the control unit and then it is send to the output unit for displaying results.


CU

Question No(1) of this unit


Register


Register is a temporary storage locations in the CPU that are designed for storing data temporarily during program execution. Register quickly accept, store and transfer data and instruction that are used immediately. The number of registers differ from processor to processor. The various types of registers are 8-bit, 16-bit, and 32-bit and 64-bit registers.


Differentiate between


RAM and ROM

SRAM and DRAM

SIMM and DIMM

Hardcopy output and Softcopy output


Ans: A. Differences between RAM and ROM:

RAM ROM

a.  RAM is volatile memory a.  ROM  is  non-volatile

because  the information memory  because  the

written into it is stored in information stored

it  as  long as  the  power into it is not lost even

supply  is  on,  and  as if power supply goes

power  supply  goes off, off.

its stored information is

lost.

b.  RAM is a R/W memory b.  ROM  is  read  only

of a computer. The users memory. The

can write information contents of ROMs are

into RAM and read directed by

information from it. manufactures.  ROMs

are not  accessible to

users.

c.  The types of RAMs are c.  The  types  of ROMs

 


-68-

 

SRAM (Static Random are  PROM,  EPROM

Access Memory)   and and E2PROM.

DRAM (Dynamic

Random Access

Memory).

d.  RAMs are expensive d.  ROMs are much

compared to ROMs. cheaper  compared to

RAMs when

produced in large

volume.

e.  It  store  programs,  when e.  ROMs store monitor,

computer is running. assembler, function

tables such  as sine,

cosine, logarithm,

square root,

exponential and code

conversion table  in

microprocessor based

systems.

f.Ram  has high memory f. Rom has less memory

space. space.

Differences between SRAM and DRAM:


SRAM DRAM

a.  A  static  RAM  retains a.  It  loses  the  stored

stored data and programs information in a very

as long as power supply short time even though

is on. the power supply  is

Refreshing circuit is not on. So refreshing

needed circuit  is needed for

refreshing the  circuit

to leakage away the

data in every 2

milliseconds.

b.It   is   more   expensive Cost  of  DRAM  is  less

(Cost is high) (low price)

Made up of flip flops and it Made up of transistors

stores the bit as a voltage. and logic gates, and

stores the bit as a charge.

Speed is high. Speed is lower than

SRAM.

Produce more heat. Produce less heat.

Larger than DRAM Smaller than SRAM.

 


-69-

 

Differences between SIMM and DIMM

SIMM DIMM

a.  SIMM (Single Inline a.  DIMM (Double  Inline

Memory Module) Memory Module)

circuit cards  contain circuits cards  memory

anywhere 3 to 9 chips  and contacts are

memory. Memory placed on both sides of

chips soldered on one printed circuit card.

side of the card. The

complete module is

organised as byte-

wide memory module.

b.  Used in PI, PII b.  Used in PIII, PIV

computer. computer.

c.  It is slower. c.  It is faster.

d.  Less pins (30, 70 pin). d.  More  pins  (168,  184

pins).

D. Differences between Hardcopy output and Softcopy output:


Hardcopy output Softcopy output

a.Hardcopy output a. Softcopy output refers

refers to recording to the output

letters, graphics or displayed on the

pictures on the screen. The output on

permanent medium the screen is lost

such  as paper. The when the computer is

output can  be read turned off.

later as the user’s

requirement.

b. The  most  commonly b.  The most  commonly

used hardcopy output used softcopy output

devices are printer device is monitor.

and plotters. Sound produced by

voice output device

(speaker) is also

softcopy output

c. Hardcopy can not be c. Softcopy output can be

edited or modified. edited.


 







-70-

 

d.  Generally hard copy d. The data,programs

output can be stored  in  the  form  of

submitted everywhere soft copy can be

for their assignment or submitted  in  s/w field

thesis or any other for their assignment.

purpose.

e.Hard copy can be e. Soft  copy can not  be

touched. touched.

f.  Hard  copy  can  be f. Soft copy output can

looked when computer not be looked when

is   switched off or person is not using

person is not usong computer.

computer.


What do you know about cache memory and backup memory? Explain.


Ans: Cache Memory


The word ‘cache’ is pronounced as cash. Data and program instructions are moved from RAM to CPU's registers during data processing. It is most time consuming method and CPU has to waste a lot of time to access data from memory.


Cache memory is similar to RAM but it is extremely fast than RAM. It is normally used between RAM and CPU. Cache speeds up processing speed of computer because CPU stores frequently used instructions and data in it. When the program is running and the CPU needs a specific data or program instructions, the CPU first checks it in cache memory. If the data is not there, the CPU reads the data from RAM into its registers, but it also loads a copy of the same data or instruction in cache memory. The next time the CPU uses it if required again and saves the time needed to load it from RAM. It is 5 to 10 times faster than main memory.


Cache memory is placed at two levels. The first level called, internal cache or L1, is included in the microprocessor chip. The second level called, external cache or L2, is included on special circuit board.


Cache Main

CPU Memory



Fig: Cache memory

 


-71-

 

Cache Hit: At first, processor send address of desired data to cache, if data is available then the event is called cache hit.


Cache Miss: When processor sent address of data, if data is not present in cache, event is called cache miss. After cache miss, data of main memory is copied to cache for next cache hit.


Backup Memory:


Backup memory is used to store copy of important data, programs, operating system, application software etc. Floppy disks, optical disks, magnetic tapes, hard disk, flash drive etc can be used as backup memory. Backup memory can be reloaded into the secondary memory in the case the programs stored in the secondary memory gets lost due to the problem of power supply or due to any other reason.


What is an output device?List the features of hard copy

output and soft copy output.


Ans: Output is the action of getting information from computer. The computer sends information to an output device in binary form. An output device converts it into a suitable form convenient to users such as printed form, display on screen, voice output etc.

Output can exist in two forms:

a. Hard copy output:


Hard copy output devices produce a physical form of output.For example, the content of a fi le printed on paper is a form of hard copy output. The features of hard copy output include the following:


A computer is not needed to see the output.


Editing and incorporating the edits in the hard copy is diffi cult.


Hard copy output can be easily distributed to people who do not have a computer.


Searching for data in a hard copy is a tiring and diffi cult job.


Distribution of a hard copy is not only costly but slow as well.

Soft copy output


Soft copy output devices produce an electronic version of an output—for example, a fi le that is stored on a hard


-72-

 

disk, CD, or pen drive—and is displayed on the computer screen (monitor).

Features of a soft copy output include the following:

The output can be viewed only when the computer is on.


The user can easily edit soft copy output.


Soft copy cannot be used by people who do not have a computer.

Searching for data in a soft copy is easy and fast.


Electronic distribution of material as soft copy is cheaper.

• It can be done easily and quickly.


What is a ‘bus’ in computer architecture?


OR, What is a bus in computer architecture? Explain

Ans: A bus is collection of wires or slots through which data can

be transmitted from one  location  to another in computer


system. It is often compared to a highway (the pathway in the

computer on which data travels).


A bus connects different components like memory, input/output to the processor.


There are three types of bus in computer system are:


Data Bus


It is the path through which data can be transmitted from one location to another in the computer sytem.It is a collection of wires or slots through which data are transferred In and Out of the CPU. The data lines can be 8 in 8085, 16 in 8086, 32 in 80386 etc. These lines are bi-directional (data flow in both direction between processor and memory or peripheral devices).


Address Bus


It is the pathway that transmits the storage locations for data or instruction. The address lines can be 16 in 8085, 20 in 8086, 32 in 80386 etc. These lines are unidirectional (from processor to memory and peripheral devices).


Control Bus


It is the pathway to transmit all timing and controlling signals sent by control unit to the other units of the system. The control lines are used to control the access and use of data and address lines.

 


-73-

 

Address





CPU Memor Input Outpu



Data


Control


Fig: Bus Structure in a computer system


What is a port? Explain different types of port available in computer system.


Ans: Interface is defined as a connection point on the computer where we connect processor to peripheral devices that passes data In and Out of a computer. Most personal computers have at least one serial port, one parallel port and two USB ports. For example, a printer is typically connected to a parallel interface and a mouse is typically connected to serial interface. Computers have a few built-in interface called ports.


Serial ports


Serial port sends and receives one bit data at a time through a wire. Normally serial interface are found in 9 pins. It is used for slow speed peripherals such as terminals. The mouse, keyboard, modem etc. are connected to serial port. Modem is connected to the serial port because data through telephone line is communicated in a specific frequency.


Parallel Port


A parallel port allows the transfer of sets of bits(i.e.8 bits) at a time. The devices that are connected to the parallel port have a data cable with eight parallel separate data lines. To send more bits at a time, more pins are required in parallel port as compared to serial port. Normally parallel ports are found in 25 pins. A parallel port is used



-74-

 

to transfer data at faster rate for high speed Peripheral.


The printer is connected to the parallel port.


USB Ports


The most popular standard port used in PCs of both IBM compatible and Apple computers is USB (Universal Serial Bus) port. Today all the PCs have at least 2 to 4 USB ports either two on the front or two on back of the system unit. The USB hub is also available to connect multiple devices with a computer and have a single USB port. A USB hub is a device, which is plugged into a USB port on the system unit and contains multiple USB ports into which you can plug multiple devices.


USB port also supports hot plugging and plug & play. It means that you can attach devices with a computer while computer is running.


SCSI


Small computer system Interface (SCSI, Pronounced Scuzzy) takes a different approach from standard parallel or serial ports. Instead of forming user to plug multiple cards into computer's expansion slots, a single SCSI adapter extends the bus outside the computer by way of cable. SCSI is like an expansion cord of data bus. Like plugging one extension cord into another to long then a circuit, you can plug one SCSI device into another to firm a chain. Fast, high end hard disk driver often have SCSI interfaces, as do scanners, tope drivers and optical storage devices such as CD-ROM drivers.


IEE1394(FireWire port)


A very fast external bus standard that supports data transfer rates of up to 400Mbps and 800Mbps (in 1394b). Products supporting the 1394 standard go under different names, depending on the company. Apple, which originally developed the technology, uses the trademarked name FireWire. Other companies use other names, such as i.link and Lynx, to describe their 1394 products.


A single 1394 port can be used to connect up 63 external devices. In addition to its high speed, 1394 also supports isochronous data -- delivering data at a guaranteed rate.

 


-75-

 

This makes it ideal for devices that need to transfer high levels of data in real-time, such as video devices.


Like USB, 1394 supports both Plug-and-Play and hot plugging, and also provides power to peripheral devices.


Differentiate between


Impact and Non-impact printers


Compiler and Interpreter

System software and application software

Magnetic disks and Optical disks

Ans: A.Differences between Impact and Non-impact printers:


Impact printers Non-impact printers

a.  Impact printers use a.  Non-impact printers

electromechanical use thermal, chemical,

mechanism that causes electrostatic, laser

hammers or pins to beam or inkjet

strike against ribbon and technology for

paper to print text. printing the text.

b.  Impact printers are b.  It isn't noiser.

noiser.

c.  Impact printers produce c.  It produces single

multiple copies of text. copy of text.

d.  Impact printers are d.  It is expensive  and

cheaper and slower. faster.

e. Print  quality of  text  or e. Print quality of text or

graphics is lower. graphic is higher.

f. Impact printers are f. It is generally used in

generally used in small big organization

organizations.

g.  Examples:  Dot Matrix, g.  Examples: Laser

Line printers, etc. Printer,  page printer,

etc.

B.Differences between Compilers and Interpreters

Compiler Interpreter

a.  Compiler is a a. Interpreter is a  program

program which which translates a

translates a high level statement of high level

language program to language program to

machine language at machine language.

once.

b. It is difficult to detect b. It detect error after

 


-76-

 

error  after compiling translating a line  of

the whole program. program at a time.

c.  It occupies larger part c. It  occupies less memory

of memory space because it is smaller

program in comparison to

compiler.

d.  It is faster because it d. It  is  slower  because  it

runs executable repeats  the process  from

programs. the beginning.

e.It creates object e.  It  does  not  create  object

code.Examples:C,C+ code.Examples : BASIC,

+,FORTRAN etc. LISP etc.


C.Differences between System software and Application software


System Software Application Software

a. System software is a.  Application software  is

a group of programs, designed to fulfill user's

languages which allow requirements.

the user to

communicate with

computer equipments.

b.  System software creates b.  Application software

the suitable depend on system

environment to run software to run.

application software.

c.  A special kind of c.  A  special   training  is

training is required  in enough for its

specific sector for its construction.

construction. d.   Types of application

d. Types of system software are:Packaged

software are:Operating software and tailored

System,Translator and package.

Utility software. Examples: Word, Excel etc.

Examples: LINUX,

UNIX, Windows, etc.


D.Differences between Magnetic disks and Optical disks

Magnetic Disks Optical disks

a.  Data  can  be  stored  in a.  Data can be stored in

magnetic   disk   in   the optical  disks  in  the

form of circular tracks. form of spiral tracks.

 


-77-

 

b. Magnetic disks have b. Optical disks have

higher storage lower storage

capacities. capacities.

c.  Data extraction speed of c. Data extraction of

magnetic disk is higher. optical disks is

lower.

d.  Magnetic disks have d. Optical disks do not

mechanical read/write have mechanical

head. read/write head.

e.  Magnetic  disks  can  be e. Optical disks can not

used as virtual storage. be  used as virtual

storage.

f.   It is suitable for both on- f.   It can be used as

line   and   off-line   storage off-line storage

media. nedia.

g. It can be damaged from g.It can not be damaged

water,magnetic material etc. from water,magnetic

material etc.

Write short notes on:


MICR

Laser Printer

Scanner

Joystick

Modem

Touch Screen

Trackballs

Digital camera

Pen drive

Expansion slots

Deadlock

Keyboard

Mouse

Ans: a) MICR

MICR  is  an  input  device,  which  reads  the  characters


printed using magnetic ink. Magnetic ink is a

special type of ink containing iron-oxide particles,


which is used to write characters. MICRs are mostly used in banks for processing cheque. MICR reads the cheque by first magnetizing the magnetic characters printed on the cheque and then sensing the signal induced by each passing character under a reading head.

 


-78-

 

Laser Printer


Laser printer uses a laser beam to produce an image on a drum, coated with photosensitive material. With this, certain parts of the drum surface get electrically charged and special ink (ink + developer) is sprinkled on the drum, which sticks electrostatically to the charged area of the drum, forming the image. As the drum rotates, the image is transferred onto the paper through a combination of heat and pressure (i.e. developer dry out and only ink remains there)


Print resolution ranges from 300 to 2400 dpi. So, laser printer produces extremely high quality text and graphics (including colors). They are expensive than other printers. The speed of laser printers can be upto 10 – 15 pages per minute.


Scanner


Scanner is an input device that can read text or illustration printed on paper and translates the information into a form that the computer can use. The resulting image (text or illustration) can be stored in a file as Bit Map or JPG (Junction Photographic (Exports) Group), displayed on a screen, and manipulated by programs. User cannot directly edit text that has been scanned.


Joystick


A joystick is also pointing device. It is used to move the cursor on a CRT screen. A joystick is a stick which has spherical ball at its lower end as well as upper end. The lower spherical ball moves in a socket .The joystick can be moved right or left, forward or backward. The electronic circuitry inside the joystick detects and measures the displacement of the joystick from its central position; the information is sent to the processor. Joystick is used in playing games.


Modem


MODEM (Modulation-Demodulation) is a device that allows a computer to transmit information over a telephone line. The modem translates between digital signals that the computer uses, and analog signals suitable for transmission over telephone lines. When transmitting,

 


-79-

 

the modem modulates the digital data onto a carrier signals on telephone line. When receiving , the modem performs the reverse process and demodulate the data from carrier signals. It is mostly used in telecommunication/internet browsing.


Touch Screen


Touch screen enable the user to select an option by pressing a specific part of the screen with finger. A matrix of beams covers the screen in the horizontal and vertical dimensions. If the beams are interrupted by a finger, then the position is determined by the interrupted beams. Touch screens are commonly used as tourist information terminals or shopping guides.


Trackballs


It is a pointing device that uses a ball to control cursor movement. The trackball is held stationary and the ball is manually rotated by hand in any direction. It does not require more space to use it. It is mostly used in portable computers.


Digital camera


Digital camera is a portable, handheld devices that capture images. The digital camera digitizes the image, compress it, and store it on a special memory card. The user can then copy information to a PC, where image can be edited, copied, printed,embedded in a document, or transmitted to another user.Moving digital images from a digital camera to a computer is a simple process that uses standard cables, disks or even infrared networking capabilities. Digital cameras have become standard equipment for designers of all kinds.


Pen drive


The flash drive is the smallest device that can be used for storing data, backup, and file transfer etc.You have


simply to plug your device into the USB 2.0 port of your computer and use it as well. They are portable and reliable.


Usually very small, you could put them into your pocket and taken with you anywhere you go. Besides, you’ll find

 


-80-

 

sufficient memory for storing many computer programs, books, songs,texts, etc.Generally flash drives are cheaper but the more capacity flash drive is more expensive.


The main advantage of flash drives is that they are not liable to scratching or erasing by magnets. You also have to make sure that the drive is write-protected in order to prevent random erasures. If privacy is important, the drive should be able to be password protected.


The different sizes of flash drives are available in the market like 128 MB, 256 MB, 512 MB, 1 GB, 2GB, 4GB, 8GB and more etc.


Deadlock


A system is said to dead lock state if there exists a set of transactions such that every transaction in the set is waiting for another transaction in the set. More precisely, there exists a set of waiting transactions {T0, T1, ....., Tn} such that T0 is waiting for data item that is held by T1, and T1 is waiting for a data item that is held by T2, and


......., and Tn–1 is waiting for data item that is held by Tn,

Tn is waiting for data item that is held by T0.


Keyboard


A keyboard is an input device which is used for entering data and instructions into computer and it is attached to a microprocessor or, the terminal of mini or large computer. A keyboard looks like similar to the keyboard of typewriter. It contains alphabets, digits, special character, functional keys and control keys. When user type a character, an electronic signal is produced which is detected by an electronic circuit, i.e. keyboard encoder. They travel to buffer and when they appear in buffer, the CPU sends into RAM. At the same time CPU instructs monitor to display character on the screen.


The different types of PC keyboard are: A. Wired Keyboard


  Serial Port  connector


  PS/2 connector


  USB connector

B. Wireless Keyboard :Infrare,Radio frequency,

[Bluetooth]

 


-81-

 

Compact: It is very light and rolls up for easy travel or storage.


Ergonomic: to keep your hands and wrists in a natural, comfortable position to help prevent carpal tunnel syndrome and aid in preventing problems due to poor posture. Most ergonomic keyboards have a split center that separates the keys and are indented slightly where the letter keys are.


Special keyboard,i.e. Gaming,Multimedia,Internet etc


m) Mouse


A mouse is a pointing device which is held in one hand and move across a flat surface. A mouse may have two or three buttons on the top and a ball at the bottom which rolls on a flat surface. The movement and direction of movement of mouse is detected by two rotating wheels on underside of the mouse. Each wheel is connected to shaft encoder which emits electrical pulses for every intermental movement of wheel.


When a user moves the mouse across a flat surface, the cursor on CRT screen also moves in the direction of mouse’s movement. We can select menu, draw picture, edit text etc.by pressing the mouse button. Types are


Mechanical mouse: It has a rubber or metal ball on its underside able that can roll in all directions.


Optomechanical mouse: It uses optical sensors to detect motion of ball


Optical mouse: It uses a laser to detect mouse’s movement.


Wireless mouse: It contains transmitter to send information to a receiver itself connected to the computer. The wireless mouse is usable from 2m to


10m of the computer.


The port used in computer to connect mousses are:


a. Serial port: cotains 9-pin connector


PS/2 contains 6-pin connector


USB:


Write short notes on webcam and flash memory . Ans: Webcam

 


-82-

 

A popular and inexpensive type of PC video camera - called a webcam can sit on top of a PC monitor or be placed on a stand, so the user can 'capture' images of himself or herself while working at computer. The video camera used with computers digitizes images by breaking them into individual pixels. Each pixel's colour and other characteristics are stored as digital code. This code is then compressed (video image


can be very large) so that it can be stored on disk or


transmitted over a network. The arrangement is handy for videoconferencing, where multiple users see and talk to one another in real time over a network or internet.


Flash memory


It is a special type of non-volatile memory. It is often used in portable digital devices for storage Digital camera, MP3 players, USB and game consoles all use flash memory. The flash memory works by having actual switches store binary values that make up the data. Thus, on a camera with flash card, the picture is stored on card turning millions of tiny switches on and off expansion ports.


Write short notes on Hard Disk and Floppy Disk.


Ans: Short notes are:


Hard Disk


Hard disk is also called fixed disk. A hard disk is a set of disks called platters made up of aluminum that are coated with iron oxide on both sides which allows data to be magnetically recorded. The main components inside the hard disk are platter stack, read/write head assembly and motors that spin that platters and move the arms.


Each platter is connected to a common centred spindle, to form a single assembly that spins as one piece. Each platter ‘surface’ has an associated magnetic head and all the heads are mounted on the same actuator shaft so all of them more together. The distance between the head and platter can be as small as 5 m


The movement of heads is controlled by head actuator. Each head is mounted on its own arm and all arms are connected to a common spindle. The arms of the actuator have a spring on one side that pushes them towards the other side. The actuator has a solenoid that works against the spring to the position the heads.

 


-83-

 

Upper surface Comb

not used


 





Surface 0


Surface 1

 


Direction of

movement arms

assembly

 


Read/write

Surface 2 head

Surface 3



Platter  

Lower surface


not used


Figure: Magnetic disk with three platters


The last major component inside the HDA is the spindle motor. Spindle motors spin the disk assembly at different speed from 5000 rpm to 7200 rpm.


The circuitry mounted on the casing of HDA covers four major functions. The spindle motor and actuator control keep the disks spinning at the right speed and head positioned accurately. The surface of disk is divided into a number of evenly spaced concentric circular tracks. Modern drivers have 10,1000 of tracks per radial inch. Each disk is divided into a sector. The set of all tracks at a given radius on all surfaces are known as cylinder.


When data are to be written, the controlling circuitry positions the head over the track that has to be read. As the disk spins, the required sector parses under the head. Each bit is encoded as a magnetic pattern on surface. To write data, the head is magnetized by parsing through a coil.







-84-

 


Track numbred

0 e.g 00 to 79

1 000 to 199 or 000 to 799

2

a sector



Figure: Magnetic disk tracks and sectors


Disk capacity = No. of bytes per sector x No. of sectors per track x No. of track per cylinder x No. of cylinder

512 x 32 x 12 x 400

78643200 Bytes

76800 KB

75 MB

Disk capacity = 512 x 96 x 12 x 800 [800 CYL , 12

HEADS and 96 SEC]

471859200 Bytes


460800 KB

450 MB


#Calculate the storage capacity of Hard disk having 4092 CYL, 16 HEADS and 63 SECTORS.

Disk Capacity = 512 x 63 x 16 x 4092


2111864832 Bytes

2062368 KB

2014.03 MB

2 GB (approx.)


Floppy disk


Floppy disk is used to transfer data from one computer to another, increase hard disk space by saving information to floppy, backup storage media. The disk is cheap, easy to handle and less storage capacity.


The floppy disk (also called a diskette) gets its name from the fact that it is made of flexible plastic material. A disk actually consists of two parts: a plastic disk coated with magnetic material, and a protective plastic jacket or hard shell. Data are recorded as tiny invisible magnetic spots on this coating. The diskette are available in 31/2", 51/4" or 8" diameters. The disk is covered with cover, disk jacket. The hub of disk is used for mounting disk drive. It has a small hole to right of

 


-85-

 

larger centre hole called index to locate disk sector. The read/write head makes the disk to the driver's head to read and

write the information.



Jakcet



Hub ring




Index hole



Read/Write Area



Alignment notches


Figure: 5.25 "Floppy Disk


The surface of each disk is divided into number of tracks. Data is recorded on the disk in concentric tracks by electric pulses with storage capacity contingent on density of tracks per inch (TPI) and number of per inch (DPI) on the track. Each track is divided into sectors. The capacity of each sector to store data is 512 characters. Two or more sectors make up a cluster. Each cluster contains about 256 bits.


Floppy size and storage capacities


Floppy disk Disk Disk No. of No. Capacity

size type sectors of

tracks

(a) Mini 5.25" DSDD 9 40 360 KB

Floppy

(b) Mini 5.25" DSHD 15 80 102 BM

Floppy

(c) Micro 3.5" DSDD 9 80 720 KB

Floppy

(d) Micro 3.5" DSHD 18 80 1.44

Floppy MB


Disk capacity= No. of bytes per sector x No. of sector per


track x No. of tracks x No. of side


#Calculate the storage capacity of a 3.5” double-sided double density disk (number of bits that can be stored per inch is the density).


No. of bytes per sector = 512


No. of sector per track = 18

 


-86-

 

No. of tracks = 80


No. of side = 2

Disk capacity = 512 x 18 x 80 x 2

=1474560 Bytes


=1440 KB

=1.44 MB (approx

Advantages

Direct information encoding onto disk

No handling of bulky media


Error correction is easier than in cards and paper tapes


It can be re-used many times.


Disadvantages


Floppy disks are to be handled very carefully.


What is a printer? Write down the features of printers.


Ans: Printer is a peripheral device for producing text, images on paper for present and future use.


Features of printers are:


Quality of type


The letter quality should be good as typewriter and near letter quality. Examples: Laser,Daisywheel etc.


Speed


The speed of printer is measured in character per second (CPS) or pages per minute (PPM).For example: Dot matrix: up to 500 CPS,Laser:4–20 text page per minute


(c) Graphics

Some printers print both text and graphics but some


printers (i.e. line printer, Daisywheel) print only text. (d) Font


Some printers can print various font but some printers (dot-matrix) have limited to one or few fonts.


Impact or Non-impact printer


Impact printers use electromechanical mechanism that causes hammers or pins to strike against a ribbon and paper to print text. Print quality of text or graphics is lower. Impact printers are generally used in small organizations. It is noiser and slower in comparison of non-impact printers.e.g. Daisywheel, dot matrix, line


printers etc.


Non-impact printers do not use electromechanical print head to strike against ribbon and paper. They use thermal,

 


-87-

 

chemical, electrostatic, laser beam or Ink-Jet technology for printing text. Usually non-impact printer is faster than impact printer. Example: Laser, Ink-Jet Printers etc


What is a plotter? Explain different types of plotter.


Ans: Plotter is a device that draws pictures on paper based on commands from a computer. Plotters differ from printers in that they draw lines using a pen. As a result, they can produce continuous lines, whereas printers can only simulate lines by printing a closely spaced series of dots. Multi color plotters use different colored pens to draw different colors.


-Plotters are more expensive than printers -They are used in engineering applications.

Types of plotter


Flat bed type: Paper is held horizontally on a flat bed. The flat bed pen is moved across the surface in the orthogonal (x and y direction). In addition, pen can be raised or lowered onto the paper, during drawing operation. The pen holder can be equipped with up to four different pens to allow for multi-color plots.


Drum plotter: A drum plotter contains a long cylinder and a pen carriage. The paper is placed over the drum (cylinder). The drum rotates back and forth to give up and down movement. The pen moves horizontally along with carriage left to right or right to left on the paper to produce drawings. Under the computer control both drum and pen move to produce desired drawings.


Describe the term spooling and buffering.


Ans: Spooling (Simultaneous Peripheral operation on Line)


From early days of computer system, the execution speed of CPU has always been faster than other I/O devices .If no special techniques are applied, the CPU remains idle most of time as it has to wait for other peripheral devices to solve this issue, technique like spooling was introduced. It is mostly widely used in printing technology.


Since the processor is fast enough, it sends the data to be printed, to some better an intermediate space where data


are kept temporarily. This part is done by spooler program. Whenever printer becomes free, then it fetches those buffered data, which is done by de-spooling program.


Buffering

 


-88-

 

Every I/O device has some memory area, which is


used for temporary storage of input and output data is

called buffer. The I/O device interacts with its buffer and


when the buffer is full or when an input operation is over, then the CPU operates on it and instructs the input device to begin the next input immediately.Similarly, in case of output, CPU sends output information to the buffer and when the buffer is full or output device is able to accept it, the information is passed to the output device. This technique of processing is called buffering.


Differntiate between CRT and LCD monitor. Ans: Differences between CRT and LCD:


CRT LCD

a.  It uses vacuum tube and a. It uses liquid crystal.

electron guns

b. This type of monitor is b. This type of monitor is not

harmful for eyes. harmful for eyes.

c. Picture quality of CRT c.  Picture  quality  of  LCD

monitor is high. monitor is low.

d. The cost of CRT monitor d. The cost of LCD monitor is

is low. high

e. CRT monitor require e. LCD monitor require less

more power to operate. power to operate.

f. It occupies large area. f. It occupies small area.

g. Screen is flicking. g. Screen is not flicking.

h. CRT monitor is slowly h. LCD monitor is becoming

getting outdated. popular day by day.

Explain impact printers with examples.


Ans: These printers print characters by striking an inked ribbon against the paper. Examples of impact printers are: dot matrix printers, daisy wheel printers, and most types of line printers.


Advantages

These printers enable the user to produce carbon copies.


They are cheap.


Disadvantages

Impact printers are slow.


They offer poor print quality, especially in the case of graphics.


They can be extremely noisy.

They can print only using the standard font.

 


-89-

 

Explain non-impact printers with examples.


Ans: These are much quieter than impact printers, as their printing heads do not strike the paper. They offer better print quality, faster printing, and the ability to create prints that contain sophisticated graphics. Non-impact printers use either solid or liquid cartridge-based ink, which is either sprayed, dripped, or electrostatically drawn onto the page. Examples of non-impact printers are inkjet, laser, and thermal printers.


Advantages


Non-impact printers produce prints of good quality, and hence render sophisticated graphics.


They are noiseless.

They are fast.

They can print text in different fonts.


Disadvantages

These printers are expensive.


The ink cartridges used by them are also costly.


Differentiate between hardware and software Ans: Differences between hardware and software:


Hardware Software

a. It is a physical component. a.  It   is instruction for

computer.

b.  Hardware  can  be  touched b.  It can not be touched and

and seen. seen..

c.  According to the function, c.  There  are  two  types  of

there are different types of software, i.e. system

hardware devices like input, software and  application

output, memory and software.

processor.

d. Same hardware devices are d. Generally software is

used for different types of deigned to perform only

operation,  so  we  can  say one task or a few similar

that hardware is task.

multipurpose.

e. Examples: e. Examples: Windows

Keyboard,Monitor,CPU etc XP,Photoshop,Maya etc.


What is computer virus?Explain the method of transferring virus.

 



-90-

 

Ans: Computer viruses are small software programs that are designed to spread from one computer to another and to interfere with computer operation. A virus might corrupt or delete data on your computer, use your e-mail program to spread itself to other computers, or even erase everything on your hard disk.


Method of transferring virus:

(i) E-Mail


Now-a-days, most of the viruses spread due to receiving e-mail messages that contains viruses. When a user opens such an infected message, the virus is also loaded into the computer memory and attaches copies of it-self with many other program files loaded into the memory. This virus is also transferred to other computers when e-mail messages are sent from the infected computer to them.


(ii) Networks


Another way of spreading virus is by using Internet and other networks. For example, when you download some executable file or data on the Internet or from a shared disk on the Network, the infected files may be attached with the downloaded data that ultimately infects the computer.


(iii) Removable Storage Media


One important means of exchanging data is through the use of removable media like floppy disks, CDs and flash devices. So, when you copy the data from one computer to another by using a removable media, the infected files can be transferred to your computer.


(iv) Pirated Software


The virus can also infect your computer by using pirated software. The software, which is installed into your computer without license is referred to as pirated software. Some companies may intentionally attach some virus programs into their software. This program will only activate when it does not find some special file like license file on your computer.


What are symptoms of virus? Ans: Symptoms of virus

The size of files is changed by adding unnecessary bytes.

The speed of computer is reduced.

The instruction of programs is changed.


Data may be lost in the database.

 




-91-

 

Virus transfers from one file to another and the infected file may make copies of itself. This behavior may use up all the free space on the hard disk.


The computer stops responding.

Disk drives or disks are inaccessible.


Antivirus software can not be installed on the computer or antivirus program will not run.


Unclear menus and dialog boxes.


Explain the process to computer from virus. Ans: process of protecting the computer from virus


Be sure to install an anti-virus software program (see the next section) to guard against virus attacks. Also, be sure you turn on the scanning features. It can't protect you if it's not enabled.


Practice caution when working with files from unknown or questionable sources. Do not open e-mail attachments if you do not recognize the sender (though you may also receive viruses from people you know). Scan the attachments with anti-virus software before opening them.


Download files only from reputable Internet sites, and be wary when exchanging diskettes or other media with friends.


Scan your hard drive for viruses monthly.


Long Questions and Answers


Discuss the term computer architecture. Draw block diagram and explain the main components of a computer system.


OR, Explain  main  components  of  a  computer  system  with

block diagram.

OR, Draw block diagram and explain the main components of

a computer system.

Ans: The  theoretical  concept  behind  the  design  of  a  computer


system is known as computer architecture. It in fact describes

how different parts having different functionality are

organized  to  make  them  work  in  a  common  principle.  It

defines the style of construction of a computer system.


Block diagram of computer system

 




-92-

 


CPU

ALU

Input Device Registers Output Device

CU







Memory


Primary Memory



Secondary Memory




Fig. Block diagram of a computer system


Main components of computer system and its explanations are:


Input device


CPU (Central Processing Unit) Components of CPUs are:

ALU (Arithmetic and Logical Unit)

CU (Control Unit)


It controls the overall operation of the computer system. It is considered as the heart of the computer system. It controls all the other units, directs them to operate in a proper way and co-ordinates various operations performed.It instructs the input device to transfer the data and instructions to the main memory and then to the arithmetic and logic unit (ALU). Then, it sends the processed result from ALU to the memory unit for storage and transfers it to the visual display unit or to the ' printer.The control unit coordinates the various parts of the computer system - the arithmetic logic unit, the memory unit and the


-93-

 

peripheral units. Besides, it controls the flow of data into,from and within the main storage as per the program instructions.


c. Register


Register is a special purpose temporary storage location in the CPU that is designed for storing data temporarily during the program execution. They are quite differing from the locations in main memory, although they can similar in structure. Register quickly accept, store and transfer data and instruction that they are used immediately. The number of registers differs from processor to processor. The various types of registers available in the market from previous days to today’s are 8-bit, 16-bit, and 32-bit and 64-bit registers.


Memory


Memory is an essential component of a digital computer. The function of the memory is to store information. It stores program, data, result or any other kind of information. Different types of memories such as main memory, secondary memory and cache memory are provided in a digital computer.


Types of memory are:


Primary Memory


The main or primary memory is a fast memory which stores programs along with data that are required to execute user's program. When we launch our program, it is loaded into and run main memory. The main memory is directly addressed by CPU. A computer contains two types of memory (a) RAM and (b) ROM


RAM (Random Access Memory)


RAM or Random Access Memory is the place in a computer where the operating system, application programs and the data in current use are kept temporarily so that they can be accessed by the computer’s processor. It is said to be ‘volatile’ since its contents are accessible only as long as the computer is on. The contents of RAM are no more available once the computer is turned off. RAM is a

 


-94-

 

R/W memory of a computer. The users can write information into RAM and read information form it. RAMs are expensive in comparison to ROMs. Types of RAMs are

(i) SRAM (Static RAM)


SRAM retain stored information only as long as power supply is on. SRAM is costlier and consume more power. They have higher speed,i.e.10-100 ns and do not need refreshing circuit. It requires large space. They have low density


(iii) DRAM (Dynamic RAM)


DRAM loses its information in a very short time even though power supply is on.It require less space In a DRAM binary state is stored for refreshing the circuit in every 2 milliseconds to leakage away the data. They consume less power. They are used where large capacity of memory is needed. DRAM is cheaper and has high packing density. The refreshing and control circuitry for a DRAM may be either itself or on separate IC controller. They have lower speed, i.e.40-70 ns


ROM (Read Only Memory)


It is non-volatile memory i.e. the information stored in it is not lost even if power supply goes off. It is used for permanent storage of information. Information can't be written into ROM by users /programmers. The contents are permanently stored in a ROM at the time of manufacture. ROMs are cheaper in comparison to RAMs.


The three types of ROMs are:


PROM


It is programmable Read Only Memory. The contents are decided by the user. The user can store permanent programs, data or any other kinds of information in a PROM. PROMs are once programmable. PROMs are cost effective if small number of chips are to be produced to store certain fixed program with the help of PROM

 



-95-

 

programmer the user stores his programs in a PROM.


EPROM


An EPROM is an Erasable PROM. The stored data in a EPROMs can be erased by exposing it to high intensity short wave ultraviolet light for about 20 minutes. This types of memory is used in product development and experimental projects.


EEPROM


EEPROM is an Electrically Erasable PROM. The chip can be erased and reprogrammed on board easily on a byte by byte basis. Either a single byte or the entire chip can be erased in one operation. It requires much shorter time, a few milliseconds. It also has limited life span i.e. the number of times it can be reprogrammed is limited to tens or hundreds or thousands of times.


Secondary Memory

The secondary memory is employed for mass storage of data, programs and other informations. It has much larger capacity than main memory. Secondary memory is also known as auxiliary memory. The information which is not being currently processed resides in secondary memory. The information needed by CPU for current processing is transferred from secondary memory to main memory. Hard disk,floppy disks etc.are used for secondary memory.


Output Device

Output is the action of getting information from computer. The computer sends information to an output device in binary form. An output device converts it into a suitable form convenient to users such as printed form, display on screen, voice output etc.

Output can exist in two forms: a. Hard copy output:


Hard copy output devices produce a physical form of output.For example, the content of a fi le printed on paper is a form of hard copy output.


b. Soft copy output

 


-96-

 

Soft copy output devices produce an electronic version of an output—for example, a fi le that is stored on a hard disk, CD, or pen drive—and is displayed on the computer screen (monitor).


With a logical structural diagram, explain functions of

elements of computer system. [HSEB-2059]

OR, Show with reference to a block diagram, the structure of a

digital  computer system showing inter-connection of data

flow and instruction flow. Explain the functions of various

units briefly.

Ans: Logical structural diagram of computer system is

 








































-97-

 














Input Devices

(Accept data

and


instruction;

e.g. Mouse,

Keyboard,


Joystick etc)

 

CPU



Arithmetic and

Logic Unit

(Performs

arithmetic and


logical

operations)



Control Unit (Control and monitor all the devices of computer

system)





Register

(Temporary

storage

location in


CPU)




Main Memory (Holds data, instructions and results of processing)

 














Output

Devices

(Provides


information

s; e.g.

Monitor,

Printer  etc)











Data/Instruction


flow


Command/Signal flow

 


Secondary

Memory

(To supplement


main storage; e.g.

Hard disk, pen

drive etc)


Functions of various elements of a computer system are as follows:


[Question no: 1, Computer System and Architecture]

 



-98-

 

Explain the role of memory in a computer and differentiate between main memory and auxiliary storage.


Ans: Memory is an essential component of a digital computer. The function of the memory is to store information. It stores program, data, result or any other kind of information either temporary or permanently.


The main memory (or primary memory) is a fast memory and stores programs along with data, which are to be executed. It also stores necessary programs of system software, which are required to execute the user’s program. The CPU directly addresses the main memory. Secondary memory stores operating system, data files, compilers, application programs etc. The CPU does not read information directly from the secondary memory. The programs and data, residing in secondary memory, if needed by the CPU, are first transferred from the secondary memory to the primary memory. Then the CPU reads them from the primary memory.


Cache memory is a high-speed memory placed in between CPU and the main memory to increase the speed of processing. It is much faster than the main memory; having access time about 10ns. It stores instructions and data, which are to be currently executed by the CPU. It is much expensive than the main memory. So, its capacity is much less than that of the main memory.


Differences between primary and secondary storage:


Primary Memory Secondary storage

a.  Primary  memory  is  also a.  Secondary memory is

known asmain or also known as magnetic

semiconductor memory. or auxiliary memory.

b.  Primary memory is faster, b.  Secondary memory is

compact and lighter. slower and heavier.

c.  Primary memory c.  Secondary memory

consumes less power. consumes more power.

d.  There is no rotating part d.  There is rotating part or

in primary memory. tape in secondary

memory.

e.  Primary memory is e.  Secondary memory is

expensive than secondary cheaper than primary

memory. memory.

f.  Primary  memory  is  not f.  Secondary memory is

used as backup storage. used as backup storage

for present and  future

use.

 


-99-

 

g.  Primary memory is g.  Secondary memory is

volatile; when the non-volatile memory.

computer is switched off

all the contents of

memory are lost.

h.  RAMs  and  ROMs  are h.  Hard disks, Floppy

used as primary memory. disks,   magnetic tapes

etc. are used as

secondary memory.

i.  Primary memory can not i. Secondary memory can

be used as virtual be used as virtual

memory. memory.

j.  Primary memory is j. Secondary memory can

directly   placed on the be placed in and out of

system board. using  but  data  cable  is

connected between

secondary memory and

system board.


What are main types of memory in a computer system, and explain how do they differ from one another?


Ans: Memory is an essential component of a digital computer. The function of the memory is to store information. It stores program, data, result or any other kind of information. Different types of memories such as main memory, secondary memory and cache memory are provided in a digital computer.


The different types of memories are:


Primary Memory


The semiconductor memory is employed as the main memory (or primary memory) of the computer. It stores programs and data, which are currently needed by CPU. It is a memory that is directly associated with the CPU. Random Access Memory (RAM) and Read Only Memory (ROM) are used as the main memory of the computer.


Random Access Memory (RAM)


The read and write memory (R/W memory) of a computer is known as RAM (Random Access Memory). The users of the computer can write information into RAM and read information from RAM. It possesses random access property. In RAM

 


-100-

 

any memory location can be accessed in a random manner without going through any other memory locations or preceeding locations. The access time is same for each memory location. RAM is a volatile memory. That means it stores information as long as power supply is on. When the power goes off or interrupted, the contents of RAM gets erased. The programmer has to reload his program and data into RAM when power supply is resumed. RAM is the temporary storage of data or programs during processing. So, the information must be saved in secondary storage device (hard disk or floppy disk) for future use.Increasing RAM capacity improves system performance. For example, a computer with 8 MB RAM has approximately 8 million bytes of memory that programs can use.


Read Only Memory (ROM)


Many computers have another type of primary storage called ROM – Read Only Memory. ROM is non-volatile storage. This means that when the power to the computer is turned off, the content of the ROM is not lost. ROM can store preset programs that are always put by computer manufactures. When you turn on a PC, you will usually see a reference on BIOS (Basic Input output System). This is part of the ROM chip containing all the programs needed to control the keyboard, monitor, disk drive and so on. There are different types of ROM, including PROM EPROM and EEPROM.


PROM


The Read Only Memory (ROM) is a memory unit that performs the read operation only; it does not have write capabilities. The information stored in a ROM is made permanent during the hardware production. The user cannot write his/her information into it. ROM is a non-volatile memory, i.e. information stored in ROM is not lost even if the power supply goes off.ROM is much cheaper compared to RAM when produced in large volumes. ROM is used for storing the programs to boot the computer handling the operating system and monitor

 


-101-

 

program controlling a machine. The program or information stored permanently in a ROM chip is called firmware.


There are various types of ROM, which are given below.


PROM (Programmable Read Only Memory)


A PROM is a memory chip on which data can be written only once. Once a program has been written onto a PROM, it remains there forever and cannot be changed.


They are manufactured as blank memory. To write data onto a PROM chip, you need a special device called a PROM programmer or PROM burner. The process of programming a PROM is sometimes called burning the PROM.


EPROM (Erasable Programmable Read Only Memory)


EPROM is a special type of memory that retains its contents until it is exposed to ultraviolet light for 10 to 20 minutes. The ultra-violet light clears its contents, making it possible to reprogram the memory. For erasing purpose, the EPROM chip has to be removed from computer.


iii. EEPROM (Electrically Erasable Programmable Read Only Memory)


It is a special type of PROM that can be erased by exposing it to an electrical charge. The time required to erase this type of PROM is very short (few seconds). Unlike EPROM chips, EEPROMs do not need to be removed from the computer to be erased.


B. Secondary Memory (Storage Device or Auxiliary Memory)


The secondary memory (computer media) is a non-volatile mass storage memory. It is used to store data, information and programs permanently for further use. The information, which is needed by the CPU for current processing, is transferred form secondary memory to the

 


-102-

 

main memory. Comparatively, secondary memory is cheaper with high storage capacity than primary memory; but it is slow. The common secondary or auxiliary memories used in computer are magnetic tape, magnetic disk (floppy disk) and optical disk (CD-ROM, CD-R, CD-R/W and CD-DVD).


What do you mean by the term ‘virtual memory’? How does it differ from ‘main memory’ and ‘secondary memory’? Discuss


Ans: The technique which allows a program to use main memory than what a computer really has is known as virtual memory. It gives an illusion that they have main memory available more than what is physically provided in the computer. The entire program and its data are not placed in the main memory. Only the instructions and data which are to be currently executed are brought from secondary memory into main memory. The remaining part of programs resides in secondary memory. The address which are used in programs are called logical addresses. The address indicate the position of instructions and data in the program. The logical addresses are translated into physical addresses by memory management unit (MMU).


For example, if you load operating system, an email program, a web browser, Movie Player and word processor into RAM simultaneously, 128MB of RAM are not enough to run all of program that most users except it run at once. If there were so no such thing as virtual memory, then once you filled up available RAM, your computer would have to say “Sorry, you can not load any more applications. Please close another application to load a new one”. With virtual memory, what the computer can do is look at RAM for areas that have not been used recently and copy them onto the hard disk. This frees up space in RAM to load the new application.


Virtual Memory differs from Primary and Secondary Memory:


Virtual memory enables the execution process on system whose main memory size is less than the total memory required by the process. Where as main memory is the memory of the computer which is used to run the

 



-103-

 

program. And, secondary memory is the memory of the computer which is used to store the program.


Virtual memory is not fixed memory of computer i.e. illusion even it helps to run the program on the system. But main memory is a type of memory of the system which is used to store program. And, secondary memory is also type of memory of system which is used to store program, data and instruction.


Virtual memory has no type but primary memory has two types i.e. RAM & ROM. And, secondary memories are hard disk, floppy disk, CD ROMs, etc.


Virtual memory is not required if the capacity of program is less than primary memory. Secondary memory is not in used.


Virtual memory gets its memory from secondary memory but not from primary memory.


Virtual memory is not used as backup or permanent storage where as primary memory is also not used as backup but secondary memory is used as backup .So data and program can used as present and future reference.


The capacity of virtual memory is always less than secondary memory. And does not deal with primary memory.


Virtual memory is used as on-line memory where main memory is also used as on-line memory but secondary is used as online and offline memory.


Capacity or size of virtual memory can be increased /decreased by increasing of its size in secondary memory. But capacity of primary memory and semiconductor memory can be increased by adding primary and secondary storage device.


What is an optical disk? Explain different types of optical disk.


Ans: An optical disk is a secondary storage medium from which data is read and to which it is written by lasers. These storage devices work on a principle similar to magnetic storage devices, however, they use laser technology to read and write data. An optical disk is random access storage media made up of glass and impressed with a series of spiral groove in a flat surface. Information is written to or read from an optical disk using laser beam or light. An optical disk has very high

 


-104-

 

storing capacity. Only one surface of optical disk is used to store data. An optical disk is relatively inexpensive, and has a long life of at least 20 years. Its devices are inherently simple and inexpensive. The greatest drawback of optical disk is its slow average access time of drive.









Figure: Track Pattern on optical disk

Types of optical disks are:


CD-ROM (Compact Disk Read Only Memory) CD-ROM is a type of optical disk capable of storing large amount of data. It contains pre-recorded data that can be read out only (i.e., it can not be erased and modified). A laser beam is used to write into and read data from CD-ROM. The head of CD-ROM drive does not touch the disk surface.


The disk is made up of resin, such as polycarbonate. It consists of aluminium located plastic, which reflects light differently for lands or pits, which are smooth or pitted area.


For reading, the digitally coded data are tracked by a optical laser scanner. The variations in the intensity of laser light reflected from the pits are detected by a photocell that converts them into electric signals.


CD-ROM disks are plastic disks coated with aluminium on the surface. A layer of thin transparent plastic is further deposited on the disk. Information on a CD-ROM is written in a single continuous spiral groove in the form of pits and lands.


These disks are specially used for software and multimedia system (to store data, sound and pictures) etc.


Advantages

It has high storage capacity.

The storage cost is low

It is reliable

It has high life span up to 20 years


Disadvantages

(i) The data can't be erased or modified.

 


-105-

 

(ii) WORM


Some optical disks can be recorded once.The information stored on the disk cannot be changed or erased. Generally the disk has a thin reflective film deposited on the surface. A strong laser beam is focused on selected spots on the surface and pulsed. The energy melts the film at that point, producing a non-reflective void. In the read mode, a low power laser is directed at the disk. and the bit information is recovered by sensing the presence or absence of a reflected beam from the disk.The most popular size is 5.25'' which can store 200 to 800 MB of data.


Read and Write Optical Disk/CD RAM


CD-R/W disk is an optical disk that enables the users to read and write data many times. (The disk contents can be erased and new data can be rewritten.) With CD-R/W drives and disks, user can treat the optical disk just like magnetic disk, writing data onto it again and again. So,it can serve secondary memory of computer.


DVD R


DVD-R is a recordable DVD format similar to CD-R . A DVD-R can record data only once and then the data becomes permanent on the disc. The disc cannot be recorded onto a second time. There also are two additional standards for DVD-R disks: DVD-RG for general use, and DVD-RA for authoring, which is used for mastering DVD video or data and is not typically available to the general public.


DVD R/W


DVD-RW is a re-recordable format similar to CD-RW. The data on a DVD-RW disc can be erased and recorded over numerous times without damaging the medium. DVDs created by a R/W device can be read by most commercial DVD-ROM players.


Define the term computer architecture. Explain different levels of computer architecture.


Ans: The theoretical concept behind the design of a computer system is known as computer architecture. It in fact describes how different parts having different functionality are organized to make them work in a common principle. It defines the style of construction of a computer system.

 


-106-

 

Levels of computer architecture


The whole computer system can be considered as a “many layered machine” consisting of several layer of software on the top of several layer of hardware.


Levels of Hardware

Electrical and electronic component level


Almost all modern computer devices are built from simple electronic components such as transistors, capacitors, resistors and these components rely on suitable power supplies and operating environment.


Digital logic level


Almost basic operations of the machine are provided at this level. The basic elements at this level can store, manipulate and transmit data in the form of simple binary representations. These digital logic elements are called gates. A gate is normally constructed from small number of transistors and other electronic components. Many gates may be combined into a single chip. The standard digital logic devices are combined together to form computer processor or computer memories.


Micro programmed level


This layer interprets the machine language instructions from the machine layer and directly causes the digital logic elements to perform the required operations. It is, in effect a very basic inner processor and is driven by its own primitive control program instructions held in its own private inner ROM. These program instructions are called microcode and the control program is called micro program. These are one example of firmware (i.e. software in ROM). There was no micro-programmed layer in the early generation of computers nor is there one in some of the small microprocessors of today. In machines without a micro programmed layer the processor is constructed directly from a combination of digital logic components. The use of micro programmed layer enables a manufacturer to produce a family of processors all of which process the same set of machine instructions at the machine layer which differs in terms of construction and speed.


Machine level

 



-107-

 

Several hardware levels are presented in machine level. These are the basic elements of computer. They are processor, input/output device, main memory, auxiliary storage etc.


Level of software

System software


The programs that direct the internal operations of a computer system such as controlling input and output devices or managing storage areas within the computer are called system software.


This layer controls the way in which all software uses the underlying hardware. It also hides the complexities of the hardware from other software by providing its own facilities which enable software to use the hardware more simply. It also prevents other software from bypassing these facilities so that the hardware can only be accessed directly by the operating system. It therefore, provides an orderly environment in which machine language instructions can be executed safely and effectively.


Application software


The program that directs a computer to solve a user-oriented problems, such as preparing bills, calculating efficiency of engine, preparing mark-sheet, etc are called application software.


What is a memory? Differntiate between primary and secondary memory. Why hard disk is popular than floppy disk? Explain.


Ans: Memory is essential component of a digital computer system. It is a storing device which stores programs, data, instructions, results etc either temporary or permanently.


Differences between primary and secondary memory:


[Question no: 3, Computer system and Architecture] Hard disk is popular than floppy disks because of the following reasons:


Hard disk can be used to store huge amount of data (i.e.softwares, compilers, operating system, games etc) but floppy disk can be used to store fixed amount of data.


The data extraction speed of hard disk is more than floppy disk.(i.e. hard disks have 5400rpm to 15000 rpm but floppy disks have 360 rpm)

 


-108-

 

Hard disks can be used for fixed and removable storage media (i.e. internal for fixed and external storage for removable) but floppy disk can be used for only removable storage media.


Comparatively, hard disks have higher life span than floppy disks.


Hard disks can also be used as virtual storage.


Due to its higher storage capacity, hard disks can be used as back up storage but currently floppy disks can not be used as backup storage because there is no floppy drive in the new system.


What is software? Explain different types of software with

examples.

Ans: A set of instructions given to the computer in machine code


that tells the computer what to do and how to perform the

given task of the user is known as computer software.


The main objective of software is to enhance the performance capability of hardware. Example:-Windows XP, MS Word, MS Excel etc.


There are two types of software and these are:


System Software


The system software is collection of programs designed to operate , control and extend the processing capabilities of the computer itself. System software are generally prepared by computer manufactures.These software products comprise of programs written in low-level


languages which interact with the hardware at a very basic level. System software serves as the interface between hardware and the end users. Types of system software are:


Operating system


An operating system is a collection of programs that controls the overall operation of the computer system. Operating system controls and co-ordinates the use of hardware among the various application programs for the various users, i.e., when an application program runs, the operating system also works with hand. Most commonly used operating systems include Windows 95, Windows 98,n Windows 2000, Windows XP, Unix, Linux etc.

 


-109-

 

b. Language Processors/Translators


The programs, which translate the program written in any programming language by the user into a machine language, are called language processor. Types of language processor are compilers, interpreters and assemblers.


Source Program:-A program which is in the form of original program that may be in assembly or in high level language is called source program.e.g.first.cpp Object Code: The language which the computer works, is called object program or object code or machine language. When a source program is converted by assembler or compiler, it is known as object program.


I. Compilers: A compiler is a program, which translates a program written in high-level language into machine language program that can be understood by the computer. It translates entire program at a time. After compilation, the source code or program (HLL program) changes into machine code or object code. It (compiler) tabulates a list of errors found during compilation. (A compiler will list all the errors in the last).




Source Comp Object



Interpreter: An interpreter is a program, which converts a high-level language program to machine language line by line and simultaneously executes it line by line. In other words, interpreter executes source code by reading it one line at a


time and performing each instruction immediately. It is different from a compiler, which does not execute the source code but translates it into machine language that is stored in a file and execute later. An interpreter will check for error in each instruction and if any error

 


-110-

 

found, it immediately prints the error for messages and terminates the execution.


Assemblers: A program, which translates an assembly language program into a machine language is called an assembler, i.e. it translates mnemonic code or abbreviated code or symbolic form into machine code.


Utility programs


System utility programs perform day-to-day tasks related to the maintenance of the computer system. They are used to support, enhance, and secure existing programs and data in the computer system. They are generally small programs, having specific tasks to perform:


i) File Management:


These utilities make it easier to manage data files. Many programs are written to help users to find the files, create and organize directions, copy, move, and remove files.


ii) Backup:


It may happen that sometime data files are corrupted, or accidentally deleted. In such a case, data backups become very useful. A backup system utility is essential for those organizations, which want to keep their data intact.


iii) Data Recovery:


It is the process of retrieving deleted or inaccessible data from failed electronic storage media such as computer hard disk drives, removable media, optical devices, and tape cartridges.


iv) Virus Protection:


Anti-virus programs are essential system utilities for a computer system functioning in a network. They provide the security to the system form viruses that can damage the computer system.


v) Disk Management:


Disk management program includes various system softwares like disk defragmenter,data compressor and disk formatting tools. De-fragmentation implies putting fragments of files in a sequential order onto the disk which reduces the time to access the file.


vi) Firewall:

 


-111-

 

It is commonly used to protect information such as e-mail and data files within a physical building or organization. Essentially, a firewall is designed to protect a computer from unauthorized access, especially via network.


vi) Disk Cleanup:


To keep a computer running smoothly, regular maintenance is vital. Therefore, one should use the disk cleanup utility, which easily determines which files on hard drive are no longer needed, then delete those files.


B. Application software


The softwares, used to do specific jobs such as solving equations, producing bills, result publication, accounting etc. are called application software, also known as end-user programs.


They are of two types and these are:.


Tailored software (Special Purpose Package)


The software, which is designed specially to carry out specific (particular) job or task, is called tailored software. They are made on the basis of specific requirement. High-level language such as COBOL, BASIC (Beginners All purpose Symbolic Instruction Code), FORTRAN, PASCAL, and C etc. is used to prepare tailored software. For example, result processing of HSEB, printing of result, software using in NRB, NTC etc.


Packaged software (General Purpose Package) The application software, which can be used a variety of similar problems. For example, spreadsheet packages (Ms Excel) may be used for different purposes by different companies in different ways, i.e., one company may use this package for accounting and another company for result publishing. Examples:


Word processing package: Word Perfect, Word Star, Ms Word etc.


Database mangement package : dBASE, FoxPro, Oracle etc.


Graphical Package: Auto CAD, Photoshop, Freehand, Power point Presentation etc.

 


-112-

 

Spreadsheet Package:Lotus,MS Excel etc.


Define the term peripheral .Discuss about different types of printers with their merits and demerits.


Ans: The input, output and storage devices, which can be connected to the system cabinet, are termed as peripheral devices or computer peripherals. They are called peripheral devices because they are at the periphery of the computer system. Some of the peripherals are Printers, Plotters, OCR, MICR, Bar Code Reader, Scanner, Card Reader etc.


Types of printers with their merits and demerits are:


Question no.(18) and (19) of this unit

 








































-113-

 

Unit 6: Operating System (OS)


Syllabus


Key points to be remembered


From previous guess


Short Questions and Answers


What  is  interrupt  ?  Differentiate  between  hardware


interrupt and software interrupt.


Ans: The interruption of normal program execution of microprocessor caused by external events is called interrupt. When an I/O device wants to transfer data, it informs microprocessor by sending a signal to the microprocessor. Thus, the microprocessor is interrupted by an external device. The microprocessor can also be interrupted by internal abnormal conditions. An interrupted caused by an abnormal condition is called exception.


Types:


Software Interrupt: The microprocessor can also be interrupted by inserting a special instruction in a program. This type of interruption is called software interrupt.


OR,The interrupt signal generated by programmers are called software interrupt.


e.g. power failure, automatically restarting the computer etc.


Hardware interrupt: The interruption which is caused by external device in called hardware interrupt. e.g. keyboard error,printer error etc..


Define the term interrupt.What is the role of OS in interrupt handling? Explain with example.


Ans: The interruption of normal program execution of microprocessor caused by an external events is called interrupt. When an I/O device wants to transfer data, it informs microprocessor by sending a signal to the microprocessor. Thus the microprocessor is interrupted by an external device. The microprocessor can also be interrupted by internal abnormal conditions.

 



-114-

 

Interrupt handling is one function of Kernel when an interrupt occurs, control is passed to the Kernel, which determines the cause of the interrupt and transfer control to the most appropriate program. Some sources of interrupts are:


An interrupt caused by power failure: The Kernel saves vital information using the dying power supply so that it can be restarted when power is returned.


Arithmetic or logic errors: When ALU detects that an errors has taken place it generates a signal that causes the interrupt.


Hardware malfunction: I/O control for each device and its associated hardware normally takes care of parity checking. If a parity error is detected, the Kernel is notified by interrupt and so on.


External interrupts: Caused by events such as operator passing an interrupt key in console or caused by signals from other process in a multiprocessor or machine.


Write short notes on


Bootstrap

LINUX

MS DOS

Booting

File and directory

Windows

UNIX

Ans: Short notes are:


a) Bootstrap


When a computer is turned on, the operating system must be brought into the computer’s memory from the hard disk memory. This process is normally started by a small program called bootstrap or bootstrap loader. This program resides in a ROM as a firmware. It is a very simple program sufficient to direct the CPU to look for a specific file (i.e. operating system file) on the disk memory and execute the instructions stored in the file. The first part of instructions in the file contains codes to direct the CPU to continue loading the rest of the operating system into the memory. When the operating system is fully loaded into the memory, the computer is ready to accept application programs.

 


-115-

 

b) LINUX:


Linux is a multitasking, multi-user operating system. It is a version of UNIX. It has been developed by hundreds of programmers scattered around the world. The aim was to develop UNIX clone free of any commercially copyrighted software, which the entire world can use. It was started by a computer science student, Linus Torvolds, in 1991. It includes most of the commands of UNIX. It includes several computer science concepts, which were available in MINIX (operating system developed by Prof. A. Tannenbaum.) It runs on widely available IBM PCs, DEC’s Alpha processors SUN’s SPARC processor, PowerMac computers etc.


MS DOS or PC DOS:


Microsoft Disk Operating System (MS- DOS) is a single user operating system developed in 1981 by Microsoft Company, USA. It is the most popular operating system for 16-bit micro- computers. It is still used because some available software (Turbo C, C++) have been written in DOS. DOS itself does not support multitasking and limit the size of a programming memory upto 640 KB. DOS is itself a command drive and is a text oriented user interface (CUI = Character User Interface, i.e. a user types commands using keyboard to get computers response). It does not provide graphic facility but some application programs, which run under MS DOS, may provide graphic facilities (GUI = Graphical User Interface). It can present GUI by using Microsoft windows, a highly popular GUI cell that runs in conjunction with the DOS.


The IBM version of this operating system is known as PC DOS (for IBM PC, PC/XT, PC/AT).


Booting


The process of loading the system files into the computer’s main memory is called booting the computer system. The main files necessary to startup a computer are IO.SYS, MSDOS.SYS and COMMAND.COM.


COMMAND.COM is a command interpreter. It displays the prompt on the screen and interprets the commands typed at the keyboard. It consists another two system

 


-116-

 

files: CONFIG.SYS (Configuration System File) that provides the default values for the computer hardware components (memory, keyboard, mouse, printer etc) and AUTOEXEC.BAT (Automatically Execute Batch File) that tells the system which directories to search for programs to run, loads the mouse driver, configures the serial ports and load the programs included in the batch file.


There are two types of booting: Cold Booting and Warm Booting.

a) Cold Booting


If we are starting the computer directly by the means of switch on, is known as Cold Boot. In this process, all hardware components will be checked by the system like checking of memory, disk, display etc. In general, a process of getting ready to our computer from dead mode is called Cold Boot.


b) Warm Booting


In few cases, computer being switched on but doesn’t perform function due to over load, long time use or infected program or software. At that moment, we have to press Alt + Ctrl + Del or Reset so that the computer restart is known as Warm Booting.


File and directory


File


File is the collection of related information saved in computer. A file name can be up to 8 characters and it is divided into two groups. The first group is the file name and second group is its extension. Extension help to identify the type of file occur in the computer.


Rule for naming a file


You can give name of file up to 8 characters long.


File name contain letters(i.e. uppercase or lowercase character), number and underscore but not semicolon, space, comma etc


Directory


It is table of contents for a disk. It organizes the file on disk and makes easy to handles files in the computer. Types of directory:

 




-117-

 

a. Root directory: It is the main or parent directory of


the computer. It contains sub-directory and files in the computer.


Sub-directory:A directory inside another directory is called sub-directory.


Windows


Windows is a new operating system environment (for PCs) developed by Microsoft Corporation. It provides graphical interface to users. Windows has challenged to IBM’s OS/2 operating system. There are different versions of Windows like Windows 3.1, Windows 95, Windows 98, Windows 2000, Windows NT, Windows ME, Windows XP etc.


Windows 3.1:( 1992)


It is a 16-bit operating system, which can run MS-DOS based and Windows based programs in an easy environment. It adds three features to IBM compatible PCs.


GUI: - using mouse to click icon/object instead of entering commands line by line.


Networking facility: - connecting computers together for data transmission and communication.


Multitasking- to work with more than one application simultaneously but not so efficient performance.


Windows 95:(1995)


It is a 32-bit operating system designed to remedy (care) many of deficiencies of windows running under DOS. It provides GUI that arranges ICONs to provide instant access to common task. It is also multitasking OS and has powerful networking capabilities. It can also run program that takes more than 640 KB memory. It features


multitasking, multiprogramming and powerful networking capabilities to integrate Fax and E-Mail. It is


a single-user operating system.


UNIX


UNIX is a multitasking and multi-user operating system developed by Bell lab in 1969. UNIX was one of the first operating systems to be written in a high-level programming language, namely C. This meant that it could be installed on virtually any computer for which a

 


-118-

 

C compiler existed.It was developed for larger machine. It runs on mini, mainframe and super computers. It is also used with powerful 32-bit microcomputers. UNIX was designed for engineers and programmers. For non-technical persons, it is an extremely difficult operating system. On the other hand, for technical persons it is very strong and powerful operating system. It connects various machines together and is highly supportive of networking. It permits many users to share a CPU. If multiple programs or tasks are to be processed by a CPU, a schedule must be prepared so that they can be processed properly. The part of the operating system, which performs the task of scheduling, is called scheduler or supervisor.


XENIX is a version of UNIX and has developed by Microsoft. It is widely used multi-user operating system.


Differentiate  between  random  access  and  sequential

access.


Ans: Differentiation between sequential access and random access file:


Sequential access


Sequential access is one in which records are stored and accessed one after another. All preceding records must be read first to access a particular or individual records. Magnetic tape is a storage medium that is sequential in nature. Sometime this methods is also used synonymously with serial access.

Record 1 Record 2 Record 3 Record 4

Figure: Sequential Access Method


Records are stored and accessed sequentially when accessing a record, all preceding record in first must be accessed. Here, to access Record 4, Record 1, 2, 3 must be accessed first.


Direct access


It is one in which a record is read directly from a disk without reading all preceding records. In direct access method, the order of storage of record is immaterial. Direct access is the faster method. Magnetic disk is the most commonly used direct access storage.

 



-119-

 


R

5

R

1 R

2

R R

3

4


Figure: Direct Access Method


What do you know about open software?Explain.


Ans: Linux is ‘open software’. That means the software is free (you don’t have to pay for it) and you have permission to make your own changes to the source code. You do have to pay for some versions which have been packaged and are supported, but it’s still much cheaper than other operating systems. For more information on open software visit the Opensource.org website at: http://www.opensource.org/.


There are now several examples of groupware and integrated suites for the Linux platform, including:


Cliq Office Suite (includes word processor, spreadsheet, personal database and scheduler)


StarOffice (word processor, spreadsheet, graphics, and more). See next.


Long Questions and Answers


What is an operating system? Explain its major functions.

OR, Define an operating system? List its functions.

OR, What is an operating system? Explain the functions of an

operating system.

OR, What is an operating system? Explain its major functions.

Ans: An operating  system  (OS) is  an organized collection of

programs that controls the over all operation of the computer

system. Since it is responsible for computer system operation

management, it is called as system software. OS controls and

co-ordinates  the  use  of  the  hardware  among  the  various


application programs for the various users. So it acts as an

interface between the user and the computer hardware.

Without an operating system, no computer can be operated.

For a computer system, it is regarded as the heart of living

beings. When an application program runs, the OS also works


with  hand.  That  is,  operating  systems  provide  a  software

platform on top of which other programs, called application

programs  can  run.  So,  the  operating  system  is  sometimes

 



-120-

 

called as platform. Examples of OS are MS-DOS, Windows 98, Windows 2000, Windows XP, Unix, Linux, CP/M etc.


In early generation of computer, there were several problems such as requirement of more set-up time (e.g., changing tape reels on tape units takes long time & the computer lies in idle), needed of manual intervention (people who use to operate computer had to interact directly with machine to do any work), and imbalance between processor and peripherals. The increased processing speed of the processor and its massive problem solving capacity created the need for more sophisticated (highly developed and complex) modes of operating computers. This thought brought the development of OS.


The complexity of operating system varies from those that support single user microcomputers to those that handle multi-user mainframes. A stand-alone microcomputer will have relatively simple operating system, whereas a mainframe that supports hundred of users accessing the system simultaneously will have one that is far more complex. Whatever the operating system is, the primary goal of an OS is to maximize the productivity of a computer system by operating it in the most efficient manner and minimizing the amount of human intervention.



User



Application software



System software


(Operating System)



Computer Hardware


(CPU, I/O device, memory)









Functions of operating system


a. Interrupt handling

 


-121-

 

An interrupt is a signal generated or request raised by a source such as Input/Output devices. Interrupts are always given priority in computer system and occurs as soon as the device requires service. Operating systems (kernel: controlling part of OS) have one special routine to serve the interrupts, Interrupt Service Routine in which each hardware component is identified by its own IRQ number. When an interrupt is raised, Interrupt Service Routine checks that interrupt request from where it occurred with the help of IRQ number and transfer to the processor. If the processor is performing some important tasks, then interrupt request may be ineffective. The interrupt, which can be masked off (made ineffective), is called maskable Interrupt.


I/O control


Computer systems include a wide variety of Input/ Output devices such as printers, mouse, keyboard, hard disk etc. The speed of one I/O device is different from another. OS handles such different speed I/O devices.


Operating system also manages the input to and output from a computer system. This applies to the flow of data among computers terminals and other devices such as printers. Application programs use the operating system to handle input and output devices as needed.


The operating system is also responsible for security, ensuring that unauthorized users do not access the system.


Managing resources


There are various other resources in computer system (for example, printer).They must be distributed efficiently between the programs without any conflicts. For example, if program “A” captures hard disk and asks for printer to print, and program “B” captures printer and asks for hard disk to write ,then such condition creates “Deadlock” and system becomes unstable. Such conditions are avoided by operating system and resources are efficiently distributed.


Memory management


Operating system governs the way loading, accessing and removing the data from memory devices.

 



-122-

 

The most common data (which are accessed most frequently) resides in registers and cache memory. Whenever, processor needs some data or instruction, it is first searched in registers and then after cache memory. If it is not available there, then it looks into the main memory (RAM).It still not available, then data is brought into main memory from hard disk. This process is governed by operating system.


Paging


As the entire job can not be loaded at once inside the memory due to large size of programs (in multiprogramming, more than one jobs are loaded in main memory at same time),operating system follows different strategy to manage such problems. The most common widely used mechanism is paging. In paging, primary memory is partitioned into fixed size called page frame and the job is also partitioned into same size called page. Instead of loading entire job at one, few pages are loaded into the page-frame of memory. After the execution of such pages, they are kept back into secondary storage and remaining part is again loaded in main memory.


Security


One of the major tasks of operating system is to secure the data and program space of each job while loaded into the memory. One program is not allowed to capture the program or data space of other program, for that operating system maintains the boundary of each job in the memory and each job are memory where DOS is loaded (i.e. first 640 KB of memory) must not be allowed to capture by user programs.


g. File management


The operating system manages the different files in the computer system. It provides following facilities.

Creation and deletion of files.

Access to files for reading and writing

Protect files against system failure

Sharing of files between various users

 



-123-

 

Why operating system was developed? Explain different types of operating system.


Ans: In early generation of computer, there were several problems such as requirement of more set-up time (e.g., changing tape reels on tape units takes long time and the computer lies in idle), needed of manual intervention and imbalance between processor and peripherals. The increased processing speed of the processor and its massive problem solving capacity created the need for more sophisticated (highly developed and complex) modes of operating computers. This thought brought the development of OS.


The complexity of operating system varies from those

that support single user microcomputers to those that handle

multi-user  mainframes.  A  stand-alone  microcomputer  will


have relatively simple operating system, whereas a mainframe

that supports hundred of users accessing the system

simultaneously will have one that is far more complex.

Whatever the operating system is, the primary goal of an OS

is  to  maximize  the  productivity of  a  computer  system by

operating it in the most efficient manner and minimizing the

amount of human intervention.


Types of operating systems are:


Single user


Single-user operating system provides an environment where single user can work in an interactive conversational mode. All the resources of the system are available to the user. MS-DOS is a single user operating system.


Multi user


Multi-user operating systems allow two or more users to run programs at the same time. This system divides the total time into a number of time slices and schedules the tasks one after another in a given priority. Examples: UNIX, XENIX etc


Multi tasking


A multitasking operating system is one that allows a PC to perform more than one task at a time, a task being a program. It refers to simultaneous working of two different tasks inside computer. In multi-tasking, only one

 


-124-

 

CPU is involved, and it switches from one program to another so quickly that it gives the appearance of executing all of the programs at the same time. Examples: Windows 95, Windows 98 etc.


A multi-tasking operating system provides the ability to run more than one program at once. For example, a user could be running a word processing package, printing a document, copying files to the floppy disk and backing up selected files to a tape unit. Each of these tasks the user is doing appears to be running at the same time.















Multi processing


Multiprocessing system is one in which more than one processors are linked together sharing main memory and other input/ output devices. These processors can execute


different independent programs simultaneously. Examples: MVS [Multiple Virtual Storage] , UNIX.


Time-sharing


If a computer allows interactive access to more than one user at one time then the operation is called multi access and the process of dividing the time for each user is called time-sharing. A mainframe computer may support hundreds of terminals users simultaneously where as a mini computer support up to twenty to thirty users.Multi access operating system use multiprogramming and often employ virtual memory to improve the performance. All controlling features and better in this system.


Real-time

 


-125-

 

Real time operating systems are on-line systems that respond to input immediately. These operating systems are designed for the purpose of controlling and monitoring external activities with time constraints. Examples: CCP [Communications Control Program] and BLMX [Broad–Level Multitasking Executive]


What is an operating system? Why GUI based operating

system is more popular than   text based operating

system? Justify clearly.

OR, What is an operating system? Explain why GUI based OS

is more popular than text based OS.

OR, Why graphical user interface (GUI) operating system is

more  popular  than  character  user  interface  (CUI)

operating system? Justify

OR, ICON  based  operating  system  is  more  popular  than

command based operating system. Why? Give examples

of icon based operating system.


Ans: An operating system (OS) is an organized collection of programs that controls the over all operation of the computer system. Since it is responsible for computer system operation management, it is called as system software. OS controls and co-ordinates the use of the hardware among the various application programs for the various users. So it acts as an interface between the user and the computer hardware. Without an operating system, no computer can be operated. For a computer system, it is regarded as the heart of living beings. When an application program runs, the OS also works with hand. That is, operating systems provide a software platform on top of which other programs, called application programs can run. So, the operating system is sometimes called as platform. Examples of OS are MS-DOS, Windows 98, Windows 2000, Windows XP, UNIX, Linux, CP/M etc.


GUI and text based OS


The GUI provides picture-oriented interface. Instead of typing commands, it provides menus and icons (small representative pictorial images) which the programmer can select by pointing to with a mouse and then clicking one of its buttons. The user interacts with the computer by manipulating the graphical symbols and menus instead of typing commands. GUI based OS needs more memory to run. A user

 


-126-

 

can easily operate the computer with the help of GUI based OS. Windows call a program running under it. Creating folder, copying files, deleting folder etc. are easily done in GUI based operating system. Examples: Windows 95/98/2000/ME, UNIX, LINUX etc.


Text based or CUI based OS allow user to type their commands using keyboard to get computer's response. The response is displayed on the screen. CUI based OS is not provided the facility as GUI-based. CUI based OS is not easy for everyone because everybody requires knowledge of OS commands to give the instruction. CUI never calls a program running under it we have to give command to create folder, copying files, deleting folder etc. Examples: MS DOS, PC DOS etc


GUI based OS is more popular than CUI based OS because of the following reasons:


The window program waits till it receives a message from windows OS about occurrence of an events, like say, hitting, a key from a keyboard or clicking a mouse button.

DOS-based program does a job step at a time calling the OS as and when required.


DOS never calls a program running under it. But windows calls a program running under it.


Window is plug and play but DOS is not.


Windows programmers are not bothered by change in hardware because it is the windows OS itself which takes care of this change. But DOS programmer are under the constant fear that if hardware on which the programs are running changes them the program may crash.


Windows support dialog box but DOS does not.


Creating folder, copying files, deleting folder etc. are easily done in windows program but in DOS program, we have to give command to create folder, copying files, deleting folder etc.


Colors are easily changed in windows but not in DOS.


Operators/users use mouse when operating windows but not in DOS.


What is general and house-keeping work of operating system? Explain.


Ans: Housekeeping is a work of garbage collection by operating system  or  system  software.  Garbage  refers  to  data  or

 


-127-

 

programs, which are not required to further use. So garbage collection is a method of keeping programs or data for certain period even after it has no further use i.e., those data or programs which are no longer required are deleted. Though they are deleted, they do not disappear altogether and remain in the computer in some space. These data or programs can be utilized till they are in the computer. This storage place is called Recycle Bin. Sometimes it happens that we delete some files or folders, which do not have direct use but are being used indirect. In such case we can retrieve them from the recycle bin and use again. With the help of operating system, we can remove such garbage from the computer system.


The following are few such services of operating system


Disk utilities


This suite includes a collection of programs, which help in efficient handling and troubleshooting of secondary storage devices. For example, dangling/lost clusters are managed by such utility. Again, scattered files are also brought into a group and space can be created by such utility (also called as defragementation).This saves the seek-time (time required to find the data in disk) of disk and increases the efficiency.


Plug and play device manager


These days, operating system are intelligent enough to identify the new devices (e.g. memory card, web-camera, modem etc) on the fly and does not better to trouble user for installing device drivers. While computer is running, user can directly insert a new device and work with it.


Memory resident antivirus software


This kind of software is very much important these days as various viruses, worms and trojans get transmitted between computers due to internet communication. The antiviral program is memory resident, i.e. it always resides in the memory and continuously monitors the presence of any such malicious program. If any, it informs the user promptly and helps to remove such things. As antiviral programs must contain some identification code to identify such malicious program, it

 


-128-

 

updates such identification code definition in its record (also called antiviral updating).


File compression utilities


The file compression becomes important while transmitting it from one place to another (especially in the Internet).Sometimes the program size gets bigger and can not be accommodated in floppy drive, and then file compression cab be very good solution for that.


Various file compression utilities are provided by third party vendors, for example: WinZip, Tar Gunzip, Rare etc. Depending upon the nature of file, compression can be up to 60% or even more. Text based files and drawing image file can be compressed more than photographic images. The whole idea behind compression is to replace


the similar kind of pattern by different symbols.Generally, same tool is needed for decompress the compression files.


Backup programs


The notion of backup is to store the present data in some other reliable storage so as to prevent the loss of data. If data is stored periodically somewhere else, then at the case of loss of data(such as system crash or storage crash),the original data can be restored. There are various technique to have backup. One technique is to copy the entire data ever, time where as in other one, changed data is needed to be stored (also known as incremental backup)


Explain different types of operating system languages.


Ans: Different types of operating system languages are:


Command Language

Most  of  operating system  provides  an  interface called


“console” or “shell”. This interface provides the user to interact with operating system through some well – defined set of commands. The size of command varies from single line command to set of commands called batch command. The example of such is “dos-shell” or “command line” in windows and “Bourn-shell” in UNIX.


The example of commands are “copy” ,”mkdir” ,”move”, ”xcopy”etc.This interface acts as command interpreter

 


-129-

 

and interprets the meaning of command to operating system. Some operating system also provides facility to write programs using command language (for example, shell script in shell).


b). Job-control language


The notion of job control language is almost extinct and now-a-day, most of operating system does not use this kind of language(as it was widely developed for batch program execution).This idea has been extended in present operating system as shell-language in UNIX system.


To execute a series of batch programs,JCL defines the status and the working order of each job and tells the system “what is to be done” during error state.


c).  Language of writing OS


From the efficiency point of view, assembly language is the nearest to fastest execution. Moreover, operating system is the most critical system. For that reason, Assembly language becomes the first choice for writing the operating system code. However, now a day, just writing program does not sever the purpose and debugging and continuous maintenance also plays equal role. Now it becomes quite difficult to debug and maintain programs written in assembly language. So high level language are also used to write the operating system. For example, UNIX was completely written in ‘C’ programming language.


If the operating system is open-source (like LINUX) ,then it is mandatory that everybody should be allowed to view the source code of program. At that time, program must be readable to everybody and which is only possible if it is written in high level languages.


What do you know about thread and process.Explain.


Ans: Process


So far, we have used the term “job” or “program” that is loaded in the memory for execution. But to be true with terminology, from here onwards,” Process” will be used instead of those. There is a significant difference between “program” and “process”. For simplicity, we can define

 


-130-

 

program as a job that is resided into the secondary storage (Which is not loaded into the main memory).A process is a program which currently in a ready/running state (i.e. currently loaded in main memory).


Having said that there can be only one program but there may be multiple process of same program. For example, there is only one program of Microsoft Word in hard disk, but we can open two different Microsoft word in simple words, a process contains a copy of programs along with some more state information. In the above example, both Microsoft word document must have different data that the user writes.


As we said earlier, a process is a copy of program with state information, it can be in three different states, i.e. ready, running and blocked (suspended).


A process is said to be in running state if it’s currently running in the processor.


A process is said to be in ready state (also called runnable) it it is temporarily stopped to let other process run in the processor.


A processor is said to be in blocked state if it’s unable to run until some external event (or I/O happens).





Running


1 2


3



Blocked            Ready


4


Process suspend for input


Scheduler (Part of operating system) picks another process to run.

Scheduler picks this process


Input is available and now this suspended process is ready to run.


Thread


In multiprogramming with time-slicing mode, multiple processes are loaded in memory at once, when one process

 


-131-

 

goes in blocked state (for doing I/O operation) or in ready state (after finishing the allocated time),another process is chosen by operating system to be in running state. During that phase, the current state of previous process must be stored somewhere, so that it can resume from that state at the next time. This mechanism is known as context switching.


Context switching is a very much costly operation and it reduces the efficiency if the process does I/O very much frequently. To solve such problem, newer operating system provides a concept of thread (also known as lightweight process).A single process is divided into multiple sub-process starts executing, which minimizes the burden of context switching to a larger extent.


There are two types of threads: first one is kernel level thread and next one is user-level thread. In the former one operating system itself manages to create threads from process and in the later one, user (programmer) itself determines how to create multiple threads inside a single process.


 





























-132-

 

Unit 7: Programming Concept

 


Short Questions and Answers


What are the features of good programming language? Explain.


Ans: A good programming language should have the following characteristics.


a. Simplicity


The Language should be simple and easy to understand and use. Simple and easy to learn and use languages like BASIC are very popular. b. Naturalness


Most languages are developed for some area of

applications.A language should be natural to the application

area for which it was developed. That {s, it should provide


appropriate operators, data structures, control structures and a

natural language syntax to facilitate easy coding by

programmer .

c. Efficiency


The programming language should facilitate efficiency in coding and execution of programs. It should take minimum resources like computer memory and coding and execution time etc.


d. Structured ness The language should have constructs for

controlling sequence, selection and iteration to facilitate

structured programming.

e. Compactness


The user should be able to concisely code applications without being too verbose. f. Extensibility


A good programming language should allow extension through simple and natural mechanisms. g. Suitability to Environment


The programming language should be suitable for the environment for which it is designed. For example, a language designed for developing real-time applications should be" interactive. A real-time application system developed in a language designed to support batch processing cannot be efficient and robust.


Differentiate between 3GL and 4GL. Ans: Differences between 3GLs & 4GLs

 


-133-

 

Third-generation Fourth-generation

Language Languages

1. Intended  for  use  by 1. May  be  used  by  a  non-

professional programming end user as

programmers. well as a professional

programmer.

2. Requires specification 2. Requires specification of

of how to perform what   task   is   to   be

tasks. performed (system

determines how to perform

the task.)

3. All alternatives  must 3. Default alternatives are

be specified. built in; an end user need

not specify these

alternatives.

4. Require  large number 4. Require far fewer

of procedural instructions.

instructions.

5. Code may be difficult 5. Code is easy to understand

to read, understand and maintain because of

and maintain. English-like commands.

6. Language developed 6. Language developed

for batch operation. primarily for on-line use.

7. Can be difficult  to 7. Easy to learn.

learn.

8. Difficult to debug. 8. Easy to debug.

9. Typically file- 9. Typically database-

oriented. oriented.


What  do  you  about  variables,  constants  and  literals?

Explain with examples.

Ans: Constants and variables


A constant is an identifier, which is always associated with the same data value i.e. constant doesn't change during execution of the program. For example : #define PI 3.14


A variable is an identifier, which is allowed to change its


associated data value.

For example : int r, a;


Literals


When referring to letters or names in programs, we must be careful to specify whether they are literals or identifiers. The string

 


-134-

 

(a group of characters of any length) enclosed within double quotation marks is known as a literal. For example, "Hello" is literal.


The statement, cout<< "radius"; means print the string radius and here radius is treated as literal.


But the statement, cout<< radius; means print the value associated with radius and here radius is treated as identifier. Similarly, statements cout<< "A+B"; and cout<< A + B; have different meanings.


Distinguish  the  terms  “Operation”,”Operands”  and

“Operators”.

Ans: Differences between operaion, operands and operators :


An operation is defined as action upon data. For example, the addition 4+6 is an arithmetic operation on two integers. The result of the operation 4+6 is 10.


The variables which is operated by any operator is called


operands.Example:A+B

Here A and B are operands.


Operator is a symbol used for operating the operands . Without operator any types of operations can be obtained. Example:A+B


Here ‘+’ is an operator


What is a data type? Explain different types of data types


with their representation.


Ans: Data types means to identify the type of data. Data can be of many types.


Integer: Numbers without fraction

Real: Numbers with fraction

Character: Letters, symbol etc.

Boolean: Logical Yes/No


Values and representation


Integer


Integers are numeric data items, which are either positive or negative including zero, i.e.1, 488, -22, 0, 456. Some programming languages put restrictions on the magnitude of integers which may be used in program instructions. These restrictions are usually dependent on the size of the memory location of the computer in which the language may run.

 


-135-

 

Real Numbers


There are two types of real numbers, Fixed-Point and Floating Point.


Fixed Point


Fixed point data items are numbers which have embedded decimal point i.e. 1.5, 458.4589, -0.569.


Floating Point


Floating point data items are numbers, which are, held as binary fractions by a computer.The numbers are expressed in a form where you have a


mantissa and an exponent, for example

Number Mantissa Exponent

12.3 = 0.123 * 102 0.123 2

123000 = 0.123 * 106 0.123 6

0.000123 =0.123 * 10-3 0.123 -3

Floating point representation of data is used to overcome the restrictions placed on the magnitude of numbers by the size of computer’s memory locations.


Character


Character data, sometimes referred to as “string” data, may consist of any digits, letters of the alphabet or symbols which, the internal coding system of the computer is capable of representing. Many programming languages require character data to be enclosed by quotation marks when used in program instructions, for example PRINT “HAPPY NEW YEAR”.


Boolean


Boolean data items are used as status indicators and may contain only one of two possible values: True or False.


What is a program? Differentiate between program and software.


Ans: A collection of instructions that perform certain task and is


written in the form of computer language is called

program. A program is used make computer perform a

 


-136-

 

specific task such as finding total, percentage, division and result of students in college.


Differences between program and software


Program Software

a. A collection of a. A set of instructions given

instructions that to the computer in

perform certain task machine code that tells

and  is  written  in  the the computer what to do

form of computer and  how  to  perform  the

language is called given task of the user is

program known as computer

software.

b. The  main  objective  of b. The main objective of

program is to make software is to enhance the

software for general or performance capability of

specific purpose. hardware.

c. It  is developed by  a c. It is developed by a group

programmer. by programmer.

d. It can not be categorized. d. It can be categorized into

two types.

e. License is not required to e. Software is licensed by a

buy a program. software company .

f. Examples: Finding total, f. Example:-Windows XP,

percentage, MS Word, MS Excel etc

division and result  of

students in college.


Explain  the  differences  between  syntax and  semantics.


Ans: Differences between syntax and semantics:

Syntax Semantics

a.   The   syntax   is   the a. It  is the meaning attached to

grammatical   rule that individual  words  or  symbols  in

govern the ways in which programming.E.g.

words,symbols, -Ram eats banana.(both

expression and statement syntactically   and semantically

may   be   formed and correct).

 


-137-

 

combined. -Ram eats chair.(Syntactically

E.g.  in  formal  English correct but semantically incorrect)

language: SUBJECT + :– indicates logical error.

VERB + OBJECT

=> sentence

b.It does not posses error. b.It posses errors.

c.It is understand by c. It is understand by human.

computer.

d.Takes more time and d. Takes less time and easy to

hard to learn. learn.

e.Example: Syntax of e.Semantics of If…Else statement

If…else statement: :If  the  condition  is  true,  the  do

IF <Condition> THEN statement1,else do statement2

Statement1 .Hence either statement1   or

ELSE statement2 will be executed,

Statement 2 depending  upon  on  whether  the

END IF specified  condition  is  true  or

false.xample:


Distinguish between Batch Processing and On-line processing.


Ans: Differentiation  between  Batch  Processing  and  On-Line


Processing:


Batch Processing: Batch processing means that data is collected up over a period of time and all the data is processed at certain point of time. The time of processing is predetermined and depends mainly on the operational role of batch of transactions within one organisation. Batch processing is referred to as off-line processing.


Example: In a payroll system all the records and details pertaining to each employee are collected and processed together at the end of the month to generate pay slips.


Online processing


Each transaction is processed and related record is updated instantaneously. The user can directly interact with the computer at any time through I/O devices which are under direct control of the processor.

 


-138-

 

On-line processing requires direct access storage devices in order to access and update the data.


Example: Bank balance enquiry, Airline reservation made at one point is immediately processed and updated information is made available.


What is modular programming ? Mention its advantages and disadvantages.


Ans: When a program becomes very large and complex, it becomes very difficult task for the programmer to design, test and debug such a program. Therefore, a long program can be divided into a smaller programs called modules. As the modules can be designed, tested and debugged separately, the task of programmer becomes easy and convenient. The division of a long program into a smaller programs (or modules) is called modular programming.


Advantages

(a) It is easier to design, test and debug a single modules   as

compared to an entire program.

(b) Usually, a module of general nature is prepared so that

it can be used elsewhere.

Disadvantages

(a) Since separate modules map repeat certain functions,

the modular programming often need extra time

and memory.


What is error? Explain different types of errors.


Ans: The bugs in a program can be occurred because of many reasons. Some are:


Syntax error


Each programming language has a character set and certain rules for programming. For example, each language has certain rules for combining characters into words, for variable types and names etc. If these rules are violated, they result in syntax errors. When an error is encountered, the computer rejects the program and print out an error message. These errors are very easy to correct. In many cases, these errors arise due to spelling mistakes, missing commas, missing semicolons etc.


x=a + b

 


-139-

 

In the above assignment statement, there is missing semicolon ( ; ) at the end.


(b) Run-time error (Execution Errors)


These errors occur only when the program is executed. So,they are called run-time errors. For example, a program may try to open a file which is not created. Since it needs that file for input or output operation, the program cannot complete its execution.


(c) Logical errors


This type of errors occurs due to error in processing data. For example, to find the value of a purchase by a customer, the program must find the product of the unit price and the number of units purchased by the Customer. If the program finds the sum of these two numbers, it results in logical error.


Logical errors are due to the mistake made by the programmer while coding his/her problem.Logical errors are difficult to predict than syntax errors because the computer will not print any error message and will produce some wrong results.


for(num =1; num<=5; num++)


{

sum =0;

sum=sum +num;

}

cout<<”sum=” <<sum;


The above example is syntactically correct but does not

give correct answer.


Draw a diagram showing semantics of case statement and

syntax in structured English.

Ans: Syntax and semantics of Case statement:

Syntax>

SELECT CASE

Expression

CASE case 1

Do operation 1

CASE case 2

Do operation 2

….

….

 


-140-

 

Default

Do Operation N

End select


Drawing of semantics of case statement



Start

Case 1 Statement

Case 2 yes Statement

Case 3 yes Statement

Stop

Flowchart of SELECT CASE Statement


What are advantages and disadvantages of flowcharts?


Explain.

Ans: Advantages and disadvanataes of flowcharts:


Advantages of flowchart:

It is a convenient method of communication

It indicates very clearly just what is being done.

It is a key to correct programming


It is an important tool in planning and designing a new system


It avoids many inconveniences that may arise in future and serves the purpose of documentation for a system


It provides an overview of the system and also indicates the relationship between the various steps.


It facilitates trouble shooting.

It promotes logical accuracy.


It makes sure that no logical path is left incomplete without any action being taken.


Disadvantages of flowchart


Flowcharts are waste of time and slow down process of software development.


Flowchart are quiet costly to produce,difficult to use and manage.

Flowcharts   are   not   meant   for   man   to   computer

communication

 


-141-

 

What is program logic? What are symbols to draw flowcharts?


Ans: Program logic is the way to solve a specific problem.


Algorithm, flowchart,pseudocode etc can be used to solve the problem.

Symbols used for drawing flowcharts are:


Symbol Name Function

TERMINAL To indicate beginning or

POINT termination of the flowchart

(process)

Process To indicate any processing,

computation and arithmetic

or replacement (assignment)

operations.

Decision To indicate decisions

(questions) and

consequently the branch

points  or  the  paths  to  be

followed based on the result

of the question.

Input / Output Used for input  / output of

data or information from /to

any device  i.e. it  indicates

the operations  of reading

and writing.

Connector To connect the various

portions of a flowchart.

arrows To show flowchart direction

and to connect the various

symbols

Pre-defined To  show  a  procedure  that

process has been already defined by

another flowchart. A

reference to the appropriate

flowchart is written  inside

such a symbol.

Visual To denote any output that is

Display obtained on screen/ console.

This is normally used in


 

-142-

 

query programs.


Direct access To show storage of


storage information in magnetic disk. E.g. hard disk, floppy or magnetic drum


What  is  Programming?Differentiate  between  flowchart

and algorithm.


Ans: A programming is a series of commands written by a programmer in a systematic order which can perform work easily and in higher speed.


Differences between flowchart and algorithm:


Flowchart Algorithm


a. It is pictorial a.It   is   a   sequence   of

representation of a instructions of a program.

program.


It takes more time b. It takes less time because because we nedd to draw we need to write sequence

symbols. of instructions.

c. Require special c. Special knowledge is not

knowledge about flowchart required to write algorithm

to draw it. because it can be written in

human language.

d.Maintaining  a flowchart d.Maintaining an algorithm

is very difficult. is not difficult as flowchart.

e.Flowchart has two types. e. Algorithm has no type.


Example:An algorithm f.Example: A flowchart for for finding the biggest finding the biggest number


number  among  and  two Start

numbers.

Sol:i.Read two numbers A Input A, B

and B.

ii. Is A greater than B ?

iii.If yes, then display "A is No IS Yes

the biggest." A > B ?

Otherwise, display "B is the

biggest." Print "B is greater" Print "A is greater"

iv.Stop

Stop

 


-143-

 

among and two numbers.



What is flowchart? Differntiate between system flowchart


and program flowchart.


Ans: A flowchart is the symbolic representation of the step by step solution of a given problem, and it indicates the flow of the entire process, the sequence of data input, operations, computations, decisions, results and other relevant information, pertaining to a particular problem. It uses different shape boxes to denote different types of instructions. The actual instructions are written within these boxes using clear and vivid statements. These boxes are connected by lines having arrow marks to indicate the way of operation, the exact sequence in which the instructions are to be executed.


Differences between system flowchart and program


flowchart:

System flowchart


It is used by system analysts to describe the data flow and operations for a data processing cycle.


It defines the broad processing in the organizations, showing the origin of data, filing structure, processing to be performed, output that is to be generated and necessity of any offline operations.


It gives broad overview of overall system.

It shows data flow of a system.

Lots of symbols have to be remembered.


Program flowchart


It is used by the programmers to describe the sequence of operations and decisions for a particular problem.


Plans the program structure and also serves the purpose of documentation for a program which is to be retained and used at a later date by either the original programmer or others.


It gives specific view of of control flow of programs.

It shows the instruction flow of a program.

Less symbols have to be remembered.


What  is  program  debugging?  Differentiate  between


‘syntax error’ and ‘logical error’.


Ans: Debugging is a methodical process of finding and reducing


the number of bugs, or defects, in a computer program or a piece of electronic hardware thus making it behave as


-144-

 

expected. Debugging tends to be harder when various subsystems are tightly coupled, as changes in one may cause bugs to emerge in another


Differences between syntax error and logical errors:

Syntax error Logical error

a.  This  type  of  error a. It is a type of progra m’s

occurred because of logic errors

misuse of a programming

language, i.e., syntax

occurs when we have

violated the rules of

programming language.

b.Syntax error is located b.Logical errors are not

by translator during identified by compilers and

translating. interpreters during

translation.

c.Users of a program can c.   Logical   errors   can   be

correct syntax errors. solved only by specific

programmers.

d.Cost is low ,since d. Cost is high in correcting

normal users can solve logical errors,since program

this problem. development team are needed

to be involved to solve.

e.Example: e.Example:

x=a + b for(a =1;a>=5; a++)

In the above assignment {

statement, there is Printf(“%d\n”,a);

missing semicolon ( ; ) at }

the end. Infinite loop causing no

output

Define flowchart and algorithms with examples.


Ans: Algorithm


Algorithm can be defined as a sequence of instructions designed in a manner that, if the instructions are executed in the specified sequence, the desired results will be obtained. It is named after its Arabian inventor Musa Al-Khowarizmi of Baghdad (Iraq) means recipe, procedure,

 


-145-

 

technique etc. A sequence of instructions must posses the following characteristics:


Example: Write an algorithm and draw a flow chart to find the biggest number among and two numbers. To solve the questions,


Read two numbers A and B


Is A greater than B ?


If yes, then display "A is the biggest." Otherwise, display "B is the biggest."


Stop


Flowchart


A flowchart is the symbolic representation of the step by step solution of a given problem, and it indicates the flow of the entire process, the sequence of data input, operations, computations, decisions, results and other relevant information, pertaining to a particular problem. It uses different shape boxes to denote different types of instructions. The actual instructions are written within these boxes using clear and vivid statements. These boxes are connected by lines having arrow marks to indicate the way of operation, the exact sequence in which the instructions are to be executed.

 

Examples: Draw a flow


among any


two numbers.

 

chart to find the biggest number



Start

 


Input A, B



No IS Yes


A > B ?



Print "B is greater" Print "A is greater"




Stop


What is an algorithm? Explain the advantages of an algorithm.

 



-146-

 

Ans: Algorithm can be defined as a sequence of instructions designed in a manner that, if the instructions are executed in the specified sequence, the desired results will be obtained. It


is named after its Arabian inventor Musa Al-    Khowarizmi of Baghdad (Iraq) means recipe, procedure, technique etc. A sequence of instructions must posses the following


characteristics


Advantages of algorithm:

It is a convenient method of communication.


It saves the inconveniences in future and serves the purpose of documentation for a system.


It provides facility for troubleshooting.


It provides an overview of the system and also demonstrates the relationship between various steps.


It promotes logical accuracy.


It makes sure that no logical path is left incomplete without any action being taken.


Draw a flowchart to test condition ‘if-then-else’ in program design process.


Ans: Flowchart of if-then-else statement

yes Condition? No

Statement 1 Statement -2





If the condition is true, then do statement1, else do statement2.Hence either statement1 or statement2 will be executed, depending upon on whether the specified condition is true or false.

Example: Write an algorithm and draw a flow chart to read name, class and marks for five different subjects. Find the average. If average is greater or equal to 40 print "PASS" else print "FAIL”.

 








-147-

 

Start

Read N$, E, M, S, C, N

Avg = (E+N+M+S+C)/5

IS Y

Avg > = 40 ?

N

Print "Pass"

Print "Fail"



Stop



What do you mean by 4GL? Give examples.


Ans: Problem–oriented languages or fourth generation languages are high–level language designed to solve specific problems or develop specific applications by enabling the user to describe what he wants rather than step by step procedures, i.e. it simply describes the necessary input/output requirements. Sometimes these languages are called non-procedural languages, as the programmer need not provide the logic to perform a task. They are mostly database-oriented language.


Examples of 4 GL are: d Base III, Oracle, FoxPro, SQL (Structured query language), QBE (Query By Example) etc.

Advantages:

Machine independent.


Programmer need not provide the logic to perform a task.


Define report on the screen and form layouts including format to be printed

Define input data and validation check


Disadvantage:

Requires more memory as compared to 3 GL.


Write down the syntax and semantics of ‘while’ statement.Also, represent the syntax by drawing.

 


-148-

 


False


true

Ans: Syntax of while statement Flowchart of while

statement

initialization

Initialization

while (expression)

{

statement1 Logical F

statement2

expression

…………..

increment or decrement T

}

Statements

Semantics:  The  condition for Increment or decrement

looping   is   checked   at   the

beginning of the loop.Hence, if the condition is found to be

false when the loop is first encountered, the processes in the

loop will not be executed at all.

22. Write down the syntax of ‘for’ statement. Also represent

the syntax by drawing.

Ans: Syntax of ‘for’ statement

for (initialization; condition; increment/decrement)

{



statement1

statement2

……………

}


Representation of ‘for’ statement by drawing




Initialize




Condition? Statements Increment/

Decrement

 






-149-

 

Write an algorithm and draw a flow chart to find the


greatest number among three numbers.

Ans: Algorithm:

Read three numbers and store them in A, B and C.


Compare A and B. If A is greater than B then, go to step V or step III.


Compare B and C. If B is greater than C then print "B is greater" and go to step (vii) otherwise go to step (iv)


Print "C is greater" and go to step (vii)


Compare A and C. If A is greater than C then print "A is greatest" and go to step (vii) otherwise go to step (vi)


Print "C is greater" and go to step vii.

Stop.


Flow chart:



Start

Input A, B, C

N IS Y

A > B ?

IS N N IS

B > C ? A > C ?

Y Y

Print "B is greater" P rint "C is greater" P rint "A is greater"

Stop


Computer scholarships are given to be on the following basis:


Marks Scholarship

Less than equal to 90 40%

Greater than equal to 70 and less than 90 35%

Greater than equal to 60 and less than 70 25%

Less than 60 0%

 




-150-

 

The computer fee for a course is 20,000. Draw a flow chart which inputs the marks and computes the fee a student has to pay.


Ans:



Start

Input M

IS Y

M > = 90 ? S = (20000  40)/10

N

IS Y

M > = 70 AND S = (20000  35)/10

M < = 90 ?

IS Y

M > = 60 AND S = (20000  25)/10

M <  70 ?

N

Fees = 20000 – S

Print fees

Stop



Write an algorithm and a draw a flowchart to find sum of

first 10 natural numbers.

Ans: Algorithm:

Step 1 : Start


Step 2 : Store 1 to A

Step 3 : Print A

Step 4 : Store A in sum

Step 5 : Add 1 in A

Step 6 : Is A less than 10?


If yes, repeat 3 onwards

If no, go to step 7

Step 7 : Print sum

Step 8 : Stop

 


-151-

 

Flow chart:



S t a r t

A =  1

P r i n t  A

S u m = S u m +  A

A = A   + 1

Y e s I S

A < =1 0 ?



N  o


P r i n t S u m



S t o p



Write  a  pseudo  code  to  find  sum  of  first  10  natural

numbers.


Ans: Pseudo code for finding sum of first 10 natural number Initialize number to 1.


Initialize sum to 0

REPEAT

Add number to sum.


Increase number by 1.

UNTIL number=10

Print sum

STOP


Explain different types of data code.


Ans: The codes used to represent the digits; alphabets and special characters in computer are called computer data codes. Some of the popular data-codes are:


BCD (Binary Coded Decimal)


-152-

 

BCD is a binary coded notation in which each of the decimal digits are expressed as binary digits. It is a four-bit code to represent all decimal numbers. For example, BCD of 12 is 0001 0010 as opposed to 1100 in pure binary form. Some of the old computers used BCD. BCD numbers will only from 0000 to 1001. BCD does not contain numbers from 1010 to 1111.


EBCDIC (Extended Binary Code Decimal Interchange Code)


It is an eighth bit binary code for large computers, i.e., mainframes. An EBCDIC code contains two points: for


‘numeric’ bit on the right and four ‘zone’ bits on the left. For example, EBCDIC of 1 is 1111 0001 and 2 is 1111 0010.


ASCII (American Standard Code For Information Interchange):


ASCII is a common computer code used for data communication, developed by American National Standard Institute [ANSI]. The standard ASCII code uses 7- bits to represent 128 different symbols or characters. The ASCII value of ‘A’ is 65 and ASCII code is 1000001 and ASCII code for ‘a’ is 1100001.


Unicode


ASCII and other coding technique is not enough to support large number of character.In order to cover various character set like Devnagri,Chinese,Japanese and so forth a higher bit character code is required.To cover all these characters a standard is required.unicode is a standard that assign character code to charactercs of different languages.Unicode is designed for 16-bit and 32-bit standard.Currently 16 bit code are used because it can accommodate almost all of the local language,32 bit is for future use.


Long Questions and Answers


What is programming language? Explain each of them in detail.


Ans: Programming language is a set of rules that provides a way of instructing the computer to perform certain operations. In another word, it is a language used for expressing a set of computer instructions (programs). Since, this language is responsible for human and system communication, it consists


of necessary symbols, characters and grammar rules,

 


-153-

 

which allow programmers to communicate with


computers.


Types of programming languages are:


Machine language (First Generation Language, 1GL) It is machine oriented language (i.e. form of 0s and 1s) that a computer can understand without any difficulty. The machine for a certain operation differs from computer to computer because each type of processor has its own machine code. E.g. the code for INTEL processor cannot execute in MOTOROLA processor. Each microprocessor has its own instruction set and corresponding machine codes.


It is the language of CPU. The lowest level language having only the use two codes "0" and "1".The most difficult way to write a program and the chance of error is also high due to the type-error. Even 1-bit changes the whole meaning. For e.g. if "01100000" is typed instead of "01100001", then "ADD" may change to "DIVIDE".


Advantages


Machine language requires less memory space than other languages.


Programs in machine language can be executed directly.


It does not require any translating program.

Disadvantages


It is very difficult to locate and debug errors in machine language.


Machine oriented.


The knowledge of computer internal architecture is essential for program coding.


Assembly language (2GL)


To overcome the difficulties of MLL, assembly languages were developed. Assembly languages contain the same instruction as machine language but each instructions and variables have a symbol instead of being just numbers. These symbols are called mnemonics. For example, 78 is number to add any number, ADD could be used to replace it. After developing assembly language, it was easier for program using symbols like ADD, MOV, SUB, MUL etc. instead of numbers. But the program written in assembly language must be translated to machine

 


-154-

 

language which could be done by assembler. Each type of CPU has its own machine language and assembly language.


** Computer Viruses are mostly written in Assembly **. Advantages


Assembly language is easier to understand and use than machine language as it employs easy to understand symbols in place of numeric codes .


It is easier to locate and correct errors in assembly language. Fewer errors occur while coding and these errors can be more easily removed.


The program in assembly language can be more easily modified which is very difficult in machine language.Recording of the logic is preferred to


modifying a program in machine language in case of errors.


Disadvantages

It is machine dependent

Programs written is ALL are comparatively larger.


High- level language


High level languages were developed to make programming easier. It is purely problem oriented rather than machine oriented. It means, unlike, machine and low level, the program written for a machine can be executed in another machine. It is fully machine independent.


Each high level language has their own set of grammar and rules to represent set of instructions. Programs written in HLL also must be translated into MLL by compiler or interpreter. They use familiar English words, special symbols and mathematical symbols in their syntax. There are different types of high languages like FORTRAN, COBOL, Visual Basic, Java etc.


The first high level language developed – FORTRAN (in 1956).

Advantages


It is easy to learn and use. High-level language is easy to learn and use as it is close to a familiar language like English.


Better documentation. High-level language to a large extent is self-documenting, as it is more like the language of the problem.

 


-155-

 

Portability. Programs written in high level language are portable across machines, as the language is machine-independent.


Programming efficiency. Programmer productivity is very high as the programmer can code several times more lines of program than in any other language.


Improved debugging facility. Error detection and removal is easier in high-level language as the program is easily readable and only logical errors need be checked. Syntax errors are detected and displayed by the compiler for correction.


Fewer errors. Since the programmer is not required to remember all the small steps to be carried out by the machine, fewer errors are likely to be there in the code.


Programs  in  high-level  languages  are  easier  to

maintain than those in the low-level languages.

Disadvantages


Lower efficiency. The machine takes more time and main memory to run a program in high-level language.The object program tends to be less efficient in terms of storage utilisation and running time.

Less flexibility. The high level language is less flexible than machine language as the automatic features of the high level languages always occur and are not under the control of the programmer. A large number of rules are to be adhered to in programming.


High-level language requires translation.A translatorprogram (interpreter or compiler) is required in translating source code into object code.


There are different high-level languages in use today. Some of the most common are: C, COBOL, C++ etc.


High-level languages are divided into three generation.


Procedural- Oriented languages: (3 GL)


The high–level languages, which require step-by-step sequence of instructions to solve a variety of problems (general problems), are called procedural-oriented languages or third generation languages (or General purpose programming languages). They are designed to help the programmer in order to express

 


-156-

 

the logic, the procedure, of a problem in the form of a program. Examples of procedural languages are BASIC, FORTRAN, C, C++, COBOL, FORTRAN etc.


Advantages:

Machine independent.


Programmer is clear about the logic of the program. So it can make any modification in the program.


Requires less time to write.

Easy to understand / learn.

Disadvantages:

Takes more time to execute the program


Programmer should have in-depth knowledge of the programming language.


Problem – oriented languages (4 GL)


Problem–oriented languages or fourth generation languages are high–level language designed to solve specific problems or develop specific applications by enabling the user to describe what he wants rather than step by step procedures, i.e. it simply describes the necessary input/output requirements. Sometimes these languages are called non-procedural languages, as the programmer need not provide the logic to perform a task. They are mostly database-oriented language. Examples of 4 GL are: dBase III, Oracle, FoxPro, SQL (Structured Query Language), QBE (Query By Example) etc.


Advantages:

Machine independent.


Programmer need not provide the logic to perform a task.


Define report on the screen and form layouts including format to be printed

Define input data and validation check

Disadvantage:

Requires more memory as compared to 3 GL.


Natural language (5 GL)

 




-157-

 

Languages used for everyday communication are known as natural language. They will use in coming generation computers to communicate humans with computers i.e. they will use in the areas of artificial intelligence and expert system.

Two  popular  natural  languages  are  LISP  (List


processor) and Prolog (programming logic).

Instructions written in such languages often

suffer from ambiguities.


For example,


“Calculate 4 and 6 divided by 2” has different interpretations.


Another example is “ I want ham or eggs and chips”


What is program documentation? Why documentation is important for successful implementation of a system?


Ans: Program documentation is a process of recording all important information and relevant to the projects which is used for future reference. This documentation will include a statement of problem, pseudo code, coding sheets, test data & results. The main areas of uses are


For the programmer’s own use (present or future) as an aid to all stages of programming.


For the present & future use of other programmers, including the programmer’s supervisors, for maintenance, modification, debugging etc.


For the users of program


Program documentation is important for the successful implementation of a system because as the program becomes more complex there will be greater need for proper implementation. Once the program development process gets complemented will be tested &finally implemented. The program will be operated by the user who works regularly. At times or in future the program may come up with some problem or sometime organization using the program may want to modify program according to the ever changing need, so during this time the program documentation if done properly and carefully will help the programmer to accomplish the tasks.

The documentation aid should cover the following:


(a)  Statement of problem ( system specification )

 


-158-

 

Documents specifying the formats inputs & outputs including validation requirements, ranges of values etc.


Details of data structures used and, in cases where files have been used, the methods of file organization, backup, security etc.


Flow charts, tables etc. Showing the design of algorithm & procedures used to solve the problem.

Coding sheets and a self documented program listing


A carefully devised set of test data & evidence to show that the test data checks all the alternative path taken by program.


Details of computer system on which the program has


been developed and tested, including the time taken by computer to solve the test data.


What is control structure? Explain different types of control structure .


Ans: The order in which program instructions are performed by the computer must be carefully controlled and programming language contains features that allow the order of instruction execution to be controlled. They are called control structures. i.e., program control structures are used to regulate the order in which program statements are executed. They fall into

three categories.


(A) Sequence (B) Selection

Repetitions (Iterations)


A)  Sesuence


Normally the statements are executed sequentially as written in the program. In other words, when all the operations specified in particular statements are executed, the statement appearing on the next line of the program is taken up for execution. This is also known as the normal flow of control.

 













-159-

 

Flowchart



Process1


Process2


Process3



B) Selection





T if condition F

Statement1 Statement2



endif


Selection is a special kind of branching, in which one group of statements is selected from several available groups, i.e., it allows alternative actions to be taken according to the conditions that exist at particular stages in program executions. Conditions are normally in the form of expressions that when evaluated give Boolean results (true or false).


Syntax:


if (condition)

then

statement1


else

statement2

endif

statement


Switch Statement


A more general form of selection is switch-case statement. Syntax of a typical switch-case statement is:


switch (expression)


-160-

 

{


case constant1

statement1

break


case constant2

statement2

break

case constant3

statement3


break

default

statement

}






Expression






Constant1 Constant2 Constant3 Constant

Statement Statement Statement Statement















Repetition (looping)


any programs require that a group of instructions to be executed repeatedly, until some logical conditions has been satisfied i.e., the same sequence of statements needs to be performed again and again for a number of times.

 



-161-

 

The repeated performance of the same statements is called looping.


here are number of statements used to carry out looping operations such as while loop, for loop, do-while etc.


while loop


‘while’ statement executes body of instructions as long as an expression remains true.


The general from of ‘while’

statement is

Initialization

initialization

while (expression) Logical F

{

expression

statement1

statement2 T

…………..

increment or decrement

} Statements

Increment or decrement



do-while loop


In this program structure, the statements in the loop are executed and testing is done at the end of the loop. The ‘do-while’ executes a body of instruction at least one time, and more if, an expression remains true. The general form is:



initialization

do

Initialization

{

statement1

statement2 Statements

………….

Increment or

increment or decrement

}while (expression)


 


T

for loop


The ‘for’ statement is most commonly used looping statement in C or C++.


The general form of ‘for’ statement is

 


Logical


expression


 F

 


-162-

 

Initialization


for

(initialization; Logical F

condition;

expression

increment or

decrement) T

{

statement1

statement2 Statements

…………… Increment or decrement

}



All three parts of loop (initialization, condition and increment/decrement) are in the same line. The flowchart of for loop is same as while loop.


What  are  program  designing  tools?  Name  program

designing tools. Explain any three of them.


Ans: These are the tools used to define the logic and sequence of specific program operations in unambiguous form so that it presents how the complete operation will be held to solve the specified problem.

Name of program designing tools are:


Algorithm

Flowchart


Pseudo code Explanations are:


Pseudo code or Structured English


It is programming analysis tool which is used for planning program logic. It allows programmer to represent the logic of program in manner which may look like plain English, so anybody can understand it without any difficulty.


It put verbal descriptions into a logical structure, which removes logical ambiguities. This methodology provides the best of two areas: The logical structure removes logical ambiguities. But, English narratives can still be to describe activities.


In short, Pueudocode is an aid to develop program and it expresses the logic of program in way similar to that of flowchart.


Rules for writing pseudo code are as

 


-163-

 

Pseudo code must not be language oriented. Hence; certain words that are peculiar program should be totally avoided.


It support conditional statements like IF must end with


END IF , IF..THEN..ELSE each block should end with END IF, CASE should end with END CASE.


Pseudo code of CASE…END CASE

CASE Type

Case Type1: Process 1


Case Type2: Process2

Case Type3:Process3

…………………….

……………………


Case Typen: Processn

END CASE


Pseudo code of IF...THEN...ELSE

IF Condition


THEN Process1

ELSE

Process 2


END IF


It also supports looping. The looping statements are FOR


DO….END   FOR,   WHILE   DO……END   WHILE,


REPEAT...UNTIL


Pseudo code of WHILE statement

Initialization


WHILE condition DO

Process1

Process2

……….

……….

Processn


END WHILE


Pseudo code of FOR statement


FOR Counter =Initial to Final DO

Process1

Process2


……….

……….

Processn

END FOR

-164-

 

d). Mostly support arithmetic (+,-,*,/ etc) and comparison(=,≥,<> etc) operators.

Examples:


Write a pseudo code to find sum of first 10 natural numbers.

Initialize number to 1.

Initialize sum to 0.


REPEAT

Add number to sum

Increase number by 1.


UNTIL number=10

Print sum


STOP


How   does   algorithm   and   flowchart   help   in   the


programming? Explain with examples.

Ans: Algorithm


Algorithm can be defined as a sequence of instructions designed in a manner that, if the instructions are executed in the specified sequence, the desired results will be obtained. It is named after its Arabian inventor Musa Al-Khowarizmi of Baghdad (Iraq) means recipe, procedure, technique etc. A sequence of instructions must posses the following characteristics:


Each and every instruction should be precise and unambiguous.

Each instruction should be performed in a finite time.

One  or  more  instructions  should  not  be  repeated

infinitely. This ensures that the algorithm will

ultimately terminate.


After performing the instructions, that is, after the algorithm terminates,the desired results must be obtained.


Example :


Write an algorithm to print sum of odd numbers up to 100.

To solve the questions,

Step 1 : Start


Step 2 : Store 1 to A

Step 3 : Print A

Step 4 : Store A in sum

Step 5 : Add 2 in A

Step 6 : Is A less than 100?

 


-165-

 

If yes, repeat 3 onwards


If no, go to step 7

Step 7 : Print sum

Step 8 : Stop


Flowchart


A flowchart is the symbolic representation of the step by step solution of a given problem, and it indicates the flow of the entire process, the sequence of data input, operations, computations, decisions, results and other relevant information, pertaining to a particular problem. It uses different shape boxes to denote different types of instructions. The actual instructions are written within these boxes using clear and vivid statements. These boxes are connected by lines having arrow marks to indicate the way of operation, the exact sequence in which the instructions are to be executed.


Since a flowchart shows the flow of operations in pictorial form, any error in the logic of procedure can be detected more easily than in the case of program. Once the flowchart is ready, the programmer can forget about the logic, and can concentrate only on coding the operations in each box of the flowchart in terms of the statement of programming language. After the completion of flowchart, programmer is ready for coding such flowchart in programming language.


There were no standards for drawing flowchart and uniformity of symbols because every manufacturers use their own symbols. So the standard symbols were developed by ANSI (American National Standard Institute).


John Von Neumann used flowchart to solve problem and explain its importance in program designing.


Examples:


Draw a flow chart to print sum of odd numbers up to 100.

 














-166-

 

Start


A = 1


Print A


Sum = Sum + A


A = A + 2


Yes IS


A < 100 ?


No


Print Sum


Stop

 




































-167-

 

Unit 9: Internet and Email


[Short Answer Questions]

Write short notes on:


a. Web browser b. Web Page

c. Web site d. Home Page

d. Web Server f. HTTP

g. FTP h. WWW

i. Search Engine j. Messenger services


Ans: Short notes are:

Web browser


A web browser is application software used to view HTML documents within www and the browsers are stored in the users’ computers. It is used to send and receive data from web server that provides web page. It enables a computer to download and retrieve documents containing text, picture, audio, video etc located on computer networks. When the browser request to the web server, then the server provides the proper response to the clients in their computers.


Some browsers are: Netscape Navigator, Internet Explorer, Mozilla, Firefox, Opera , Safari, Google Chrome etc.


In a simple way, we can describe a web browser as a type of software that we use to ‘surf’ the internet.


Web Page


A web page is really little more than a text files with a series of markup tags to display it in browser.


A web is a page with hypertext links that cross-reference text in the Internet.Though you'll see multimedia content such as images, audio and video or Flash animations on a web page when its shown in a browser window, the web page file itself doesn't contain this information. The multimedia files are separate and are included in the web page through HTML tags.


A bunch of web pages with their multimedia files makes a web site. Having said that, a web site can also have just one web page - the home page of the web site - and nothing else..A web page is also known as HTML pages because it is coded in HTML language. Today web pages are the standard interface of the internet.

 




-168-

 

WebPages can be static or dynamic, meaning that the content is the same each time someone visits the webpage or is taken from a database which is updated with new content


Web site

A Web site, then, is a collection of Web pages under


the control of a particular person or group.Generally, a Web site offers a certain amount of organization of its internal information. You might start with an index or default page for a Web site, and then use hypertext links to access more detailed information. Another page within the Web site may offer links to other interesting sites on the Web, information about the organization, or just about anything else.


Web site organization is an important consideration for any HTML designer, including those designing and building corporate Web sites. The typical corporate Web site needs to offer a number of different types of information, each of which might merit its own Web page or pages.


Home Page


The page (i.e. index page) which will be loaded first in the browser after the requesting of users is called home page. It is a main page of the web site that provides general information about web site. It contains various related hyperlinks to the link page which is opened in the same window or new window.


Web Server

In its essence, it's the job of a Web server to accept


connections from Web browsers all over the Internet and, when requested, send them the HTML documents that are available from your site.


A Web server is simply a computer with an Internet connection that runs software designed to send out HTML pages and other file formats (such as multimedia files). The server computer should have a relatively high-speed connection to the Internet (faster than any available modem connections, for instance) and be powerful enough to deal with a number of simultaneous connections from the Internet. Web server software generally requires a fairly robust operating system (like UNIX, Windows NT, or OS/2), although software is available for other versions of Microsoft Windows, and the Macintosh OS is a very popular choice for Web server computers. The software you use depends on

 



-169-

 

your level of experience with Internet connections and various operating systems.


HTTP


HTTP (Hyper Text Transfer Protocol) is the language servers and clients use to exchange information .HTTP is optimized for requesting and supplying HTML documents. When client request information to the server, the server responds to such information through HTTP. If web server found web pages, the server sends requested web page to the respective clients otherwise web server provides error message to the clients. Web server uses this language to deliver web pages.


FTP

The File Transfer Protocol (FTP) is the Internet


service that allows computers to transfer binary files (programs and documents) across the Internet. This is the uploading /downloading protocol that you might use to obtain copies of shareware or freeware programs, or that might be useful for downloading new software drivers from a particular computer hardware company.


WWW

The  WWW  is  the  graphical  Internet  service  that


provides a network of interactive documents and the software to access them. It is based on documents called pages that combine text, pictures, forms, sounds, animation and hypertext links called hyperlinks. Users can surf from one page to another by pointing and clicking on the hyperlinks in texts or graphics.


is an information system which brings together data from many of Internet service under one set of protocols. WWW is distributed network which consists of HTML documents and web pages.


Search Engine


A Web search engine is a tool designed to search for information on the WWW. The search results are usually presented in a list and are commonly called hits. The information may consist of web pages, images, information and other types of files. Some search engines also mine data

 


-170-

 

available in databases or open directories. Unlike Web directories, which are maintained by human editors, search engines operate algorithmically or are a mixture of algorithmic and human input.


Messenger Services


Messenger Service is a network-based system notification service included in some versions of Microsoft Windows. This service, although it has a similar name, is not related in any way to the .NET Messenger Service or the Windows Messenger and MSN Messenger/Windows Live Messenger instant messaging clients.


What is URL?Explain the components of URL


Ans: URL is an acronym for Uniform Resource Locator. URL is the technical term for what is often called a "web address" of web site on the Internet. It is the address by which computers and documents on the Internet can be located. The URL is a short text string that contains the name of a computer on the Internet, a protocol for communicating with that computer, a path and filename of a document on that computer, and sometimes additional information as well. The inclusion of all this information in a single string is allows for seamless interaction between computers on the Internet and rapid exchange of information. The URL was designed to be extensible in the sense that as new types of documents are added to the Internet, the URL would be able to adopt and uniquely identify each document with regard to each new document format's needs.


The format of URL is


URL: http://www.nepalnews.com


In the above format,


http : indicates that we want browse the web using

the HTTP protocol, the default protocol for


browsing the Web. There are other protocols

for other uses of the Internet.

 





-171-

 

:// : It is a symbol that differentiates which file


protocol & file server

:   file server

nepalnews :   Domain name

.com : type of site like .com for commercial, .edu for

educational, .gov for governmental etc.


Examples: http://www.sagoon.com is the URL of Sagoon web site.


What is protocol?Explain different types of protocol. Ans: Protocols are a set of rules that control transmission (sending


and receiving) of signals. In other words, it is a language of networking by which computers communicate with each other. Protocol defines a set of commands which one machine sends to another. If message is too large, protocol will split it up into several packets and make sure that they all arrive correctly. The most commonly used protocols are


TCP/IP: (Transmission Control Protocol/Internet Protocol)

  Used in WAN and LAN

  The Internet is based on TCP/IP

HTTP: (Hyper Text Transfer Protocol)

  To transfer hypertext or web documents


  Hypertext is text that is specially coded using standard system called HTML (Hyper Text Markup Language)

FTP: (File Transfer Protocol)

  Part of TCP/IP

  Enables files to be transferred between computers


Telnet: This protocol enables one computer to connect with another computer

NetBeui: (NetBios User Interface)

  Mostly used in LAN.


What is email?List the uses of email.


Ans: Email allows individuals and groups to communicate with one another. You need to get information and ideas from people living in your dorm or house, from members of the surrounding community, from university officials, and perhaps other groups. Once you've established contact with these groups and individuals, you can gather and share information as well as elicit reactions to on-going proposals

 


-172-

 

through email rather than face-to-face meetings or repetitive telephone calls.

The uses of Email are:

Information Exchange


Brainstorming and Problem Solving

Record Keeping

Group Work

Staying in Touch Professionally

Staying in Touch Socially

Transmitting Documents


What are the advantages and disadvanatges of email?


Ans: Advantages:


Low cost (cheap): E-mail is cheaper than postal mail. Letters can be sent by E-mail for the cost of one local call.


Speed (fast): E-mail is a very fast means of communication. An E-mail (letter) can be sent at any part of the world within few seconds.


Multimedia: Besides text, an E-mail supports pictures, sound and even video as an attachment (sound, images, video, even computer software can be sent by E-mail).


Easy to use: It is easy to send an E-mail. You don’t have to write it many times, find an envelope, go to the corner to buy a stamp and find a mailbox. (i.e., can be sent to large number of people at the same time)


Disadvantages:


Cannot send physical things like money, book, floppy etc.


Hardware requirements: You have to have a computer with E-mail facilities to send or receive the E-mail (can’t see without computer).


Brings virus--> data would be lost automatically (crash the computer system)


Sometimes the message gets lost or reaches to another location. (The private information sent by the remote user gets lost)


Telephone line busy


Differentiate between web based email and POP. Ans: Differences between web based email and POP:

 


-173-

 

Web based e-mail


They are free services by the different web sites like yahoo, hotmail etc.These type of email can be accessed anywhere in the universe and is operated by the web browser.


Webmail (or Web-based e-mail) is an email service intended to be primarily accessed via a web browser, as opposed to through a desktop email client. Some webmail providers use dedicated websites for providing email services, including Gmail, Yahoo! Mail, Hotmail, and AOL Mail; but there are many internet service providers which provide webmail services as part of their internet service package.


Webmail has several advantages, including an ability to send and receive email away from the user's normal base using a web browser, thus eliminating the need for an email client. The main limitations of webmail are that user interactions are subject to the website's operating system (including file size limits) and the general inability to download email messages and compose or work on the messages offline, although Gmail does offer Offline Gmail through the installation of Gears. The advantage of webmail provided by a user's mail server is that emails can remain on the mail server until the user can return to their base computer, when they can be downloaded.


POP based email


It is a service given by ISP company. User must have to register the account in the ISP company for sending and receiving email. ISP company give username and password. This type of email can be accessed by using software like outlook express, Eudora etc.


POP (Post Office Protocol) mail refers to email software on your computer that sends and receives mail via a shared computer's electronic post office. Personal computers seldom have the network resources required to serve as an independent post office, which is why most people use shared systems as email servers.


POP mail software on your computer (the POP client) logs into the shared computer (the POP server) and transfers received mail from your account to your computer. When you send an email message, your POP client transfers it to a dedicated mail system for transmission on the Internet.

 


-174-

 

Most POP mail clients support features such as document


Internet Intranet

i. Internet   is   a   global i. The term Intranet refers to an

distributed network of internal network that utilizes

computers access the the  tools  and  techniques  of

world connected the Internet to provide

together  by network of services   limited to   local

cables. network uses.

ii. It is global. ii. It is local.

iii. An  Internet  is  not  a iii. An Intranet  is a company-

company-wide network. wide network run along the

lines  of  WWW,  making  it

possible to share documents,

databases and applications.


attachment, automatic document encoding and decoding, user lookup, internal address books, font selection, signature files, and multiple mail management options.


Diferntiate between Internet and Intranet. Ans: Differnces between Internet and Intranet:


[Long Answer Questions]


What is Internet?Explain the services provided by the

Internet.


Ans: The Internet is the global, network of network, distributed network of computer across the world connected together by network of cables. A computer sends information from computer's modem through telephone lines, out of series of cables that provide access to all the computers in network.


It was created nearly 30 years ago as a project for US Department of Defense. Its goal was to create a method for widely separated computers to transfer data efficiently even in the event of a nuclear attack. Today the Internet has grown to thousands of regional network that can connect millions of users.


Internet offers access of data, graphics, sound, software, text and people through a variety of services and tools for communication and data exchange. Internet is the cheapest and fastest means to get and provide information. Simply, Internet is an information center. You can get various information from Internet through World Wide Web (WWW).

 


-175-

 

Internet can be used as a tool of advertisement. For an organization or institution, setting up a home page is a good way to let the world what its products and services are.


Services provided by the Internet are:


On-line communication


The electronic mail service on the Internet is extensively used today by computer users around the world of communicate with each other with this facility, Internet has provide to be a rapid and productive communication tool for million of users.


On-line shopping


The Internet also has facilitated the introduction of a new market concept which consists of virtual shopping. They provide information about products or services for sale through www servers. Using the Internet, customers submit specific product queries and request specific sales quotes.


Video conferencing


Internet allows a group of users located around the globe to talk and interact with each other as if they were sitting and discussing in a single room. The parties interacting can see each other talking on their computer screen and can hear each other’s voice through a special audio device fixed in their computers.


WWW


It is simply the service on the Internet which accessed through a naming system known as URL.


Usenet


Usenet is the bulletin board service which provides the knowledge of more than 4000 subjects.


Software sharing

The Internet provides access to a large number of


shareware software development tools and utilities. A few example of such available shareware tools are compilers, code libraries, mail servers and operating systems. For example, a collection of such shareware tools is available via ftp (File Transfer protocol) from the Internet site sunsite.unc.edu.


IRC


Internet Relay Chat (IRC), the other method for Internet conversation, is less common than talk because someone must set up the chat before others can join in. Chat sessions allow many users to join in the same free-form conversation,

 


-176-

 

usually centered around a discussion topic. When users see a topic that interests them, they type a command to join and then type another command to choose a nickname. Nicknames allow people in the session to find you on IRC networks or channels.

 
















































-177-

 

Unit 9: Software Package and Installation


Short Questions and Answers


What is word processing package? Mention its features with any four examples.


Ans: Word processing means the process of manipulation of text using computers. It includes entering, editing, formatting and manipulation of text on a computer screen and printing of the processed text. The text is saved on the computer as a file for future use. It avoids retyping to correct an error or omission. The document can be modified easily without retyping the whole text. Document templates can be designed and stored for future use.


The most popular word processing programs are:


a. Word Star b. Word Pro


c. Word Perfect d. Ms Word


The features of a word processing package are:


a. It permits printing selected text

b. It allows to change font and size of fonts

c. It allows to adjust page size and margins

d. Facility to right justify, left justify and justify selected

text within the document

e. Adjustable line spacing and character spacing

f. Layered indentation facility

g. Facility to add bulletins and numbers to lines or

paragraphs etc.

h. Facility to move text within the document

i. Facility to define headers and footers in a document

j. Creating multiple column documents

k. Indexing a document

l. Preparing table of contents

m. Facility to check spelling and grammar

n. Choosing most appropriate word using bUilt-in thesaurus

2. Explain the following terms used in different software

packages.

a) Cut and Paste b) Text justification

 


-178-

 

Ans: a) Cut and Paste


In Microsoft Word, you can cut (delete) text from one area of a document and save that text. so it can be pasted elsewhere in the document. When you cut text,it is stored on the Clipboard. You can also copy text. When you copy text, it is also stored on the Clipboard. Information stored on the Clipboard stays there until new information is either cut or copied. Each time you execute Cut or Copy, you replace the old information on the Clipboard with whatever you just cut or copied. You can paste Clipboard information as often as you like.


Text justification


This is a sample paragraph. It is used to illustrate alignment. Left-justified text is aligned on the left. Right-justified text is aligned with on the right. Centered text is centered between the left and right margins. You can use Center to center your titles. Justified text is flush on both sides.


What do you understand by formatting a document? Give the significance of speller and thesaurus of modern word processing package.


Ans: It includes size of page, its orientation, headers or footers, marging columns and sections. Due to this, document look like good.


Speller


We can enable it to each spelling mistakes as we type or use it to review an entire documents for spelling errors. A spell checker matches each word in a document against a built-in dictionary containing standard spelling. A good spell checker will provided options for replacing word, ignoring it or adding it to spelling dictionary.


Thesaurus


It is a feature of word processing package which locates and suggest alternative words or synonyms from a list of alternative words stored on disk.


Write down the significance of Mail merge and Grammar in word processing package.


Ans: Significance of mail merge and grammar are:


Mail merge

 




-179-

 

A mail merge is the process of combining form letter with the contents of database - usually a name and address list - so that each copy of letter has one entry from the database printed on it. The mail merge feature makes it easy to send same letter to a list of different people with correct name & address printed on each letter.


Grammar


Grammar checker work like spell checkers but they inspect our document for grammatical problems. A grammar checker compares each sentence to a set of standard grammatical rules, notifies us if it finds a potential problem & provides grammatically options.


What are the significance of header and footer and limitations of spelling and grammer?


Ans: Header and Footer


The collection of characters (i.e. page number, symbol etc) which appears in every page at the top of the document is called Header and collection of characters (i.e. page number, symbol etc) which appears in every page on the bottom of the document is called footer. This contains company's name, Chapter heading, title etc. You can insert any types of text, page number, Date and Time, symbol and auto text as a Header or Footer by using Header and Footer toolbar or insert menu.


Limitations of using spellers in word processing are:


It cannot be used to check proper names and technical jargons or any local words.


It does not show the word, which is right by spelling but wrong contextual meaning.


What is spreadsheet package? Stat the features of spreadsheet package with examples.


Ans: Spreadsheet package is a software tool for data analysis. It

allows users to quickly create, manipulate and analyze data

organized in columns and rows. Spreadsheet programs are

widely used in accounting, sales, inventory control, financial

aspects of business, tabulation of marks, and a number

of business and non-business problems.  Today several

spreadsheet package  are  available  which  can  be used  to

 


-180-

 

prepare budgets, forecast  future  cash  needs,  prepare


examination results etc. Examples: MS Excel, Lotus, 1-2-


3 etc.


Features of spreadsheet packages are:

All spreadsheets have the same overall features:

formulas to perform varying grades of mathematics

editing facilities with auto text


cut and paste — text/graphics can be rearranged within the same document or between a number of documents


page formatting, eg columns, margins and page breaks (pagination)

sorting facilities


use of relative and absolute referencing

creating charts to visually represent data

exporting and importing data easily to database products

vertical text and other text effects

some desktop publishing capabilities.


7.Explain the followings:


Document formatting in word processing package

Cell referencing in spreadsheet package


Ans: b) Cell Reference


Cell reference is a feature of MS Excel. A cell address or cell reference consists of its column letter and row number. For example, B6 identifies the cell at intersection of column B and row 6.


MS Excel provides three types of cell references: relative, absolute, and mixed. Relative references refer to the cell relative to the given position. Absolute references refer to the specific cell irrespective of the position of the formula. The '$' sign is used to denote an absolute reference. Mixed references are a combination of both relative and absolute references. It has one absolute co-ordinate and one relative co-ordinate. and C$1 are both examples of mixed references.


What are the significance of mail merge and macro in word processing package?Explain.


Ans: Macro

A Macro is a list of commands, keystrokes or some other

actions that has been saved and given a name when


you create a macro; we record a series of actions.

 


-181-

 

When we replay the macro, it repeats those actions

for us. We can use macro to automate nearly any task

that requires multiple steps-no matter how many

steps arerequired.Many commercial applications

support macros, and some even    feature an array  of

built-in, predefined macros that we can use right

away to suit our own work style.


What is chart and function in spreadsheet package? Explain.


Ans: Chart


MS Excel allows users to view data entered as tables in a graphical form as charts, which helps a user to easily understand, analyze, and compare data. Excel allows its users to create either two-dimensional charts or three-dimensional charts. A user can enhance the chart by adding chart items, such as data labels, a legend, titles, text, and gridlines. He can also do formatting on these items by using colors, alignment, fonts, and other formatting attributes. MS Excel also allows users to view charts along with the data by using embedded charts. These charts are included in the worksheet and can be copied, moved, and resized in the same way as can be done with any other graphical object.


Function


The built-in formulas are called functions. MS Excel provides analyzing data and manipulating text by using different functions. Users can easily calculate percentage, interest, average, etc. by using built-in functions. This can be done either by typing in the function-based formulas or by using function wizards. Formulas are widely used in simple computing (such as addition, subtraction, multiplication and division) and advanced computing. They provide the power to analyze data extensively.


Explain the following terms used in spreadsheet package:


a.MS Excel Workbook b.Worksheet c.Cell

d.Cell range

Ans: Explanation of given terms are:


MS Excel


It is spreadsheet application program. It is a part of MS Office which is a suite of application programs. It allows

 


-182-

 

user to create, manipulate and analyze data organized in columns and rows. The spreadsheet is displayed on the screen, stored in the memory and its print out can be taken. Spreadsheet programs are widely used in accounting, sales, inventory control, financial aspects of business, salary preparation etc. Excel provides various charts i.e. pie chart, bar chart etc. and layout options.


Workbook


Workbook is the collection of worksheet. By default, there are three sheets (i.e. Sheet1, sheet2 and sheet3) in a workbook. The other sheet can be added later.


Worksheet


It is the place where we do mathematical calculation. The large working area of a workbook is called worksheet. There are 65,536 rows and 256 columns in a worksheet.


Cell


The intersection between row and column is called Cell. Each cell contains 32000 Characters. Each cell on the spreadsheet has a cell address that is the column letter and the row number. Cells can contain text, numbers, or mathematical formulas.


Cell range


If out formula uses cells that are continuous, we refer to all the cells at once as a range or block. E.g. = Sum (B4: D4)


e.MS PowerPoint


It is a presentation package. It helps users to create interactive, self-running or speaker-controlled visual displays. It uses multimedia technology to include text, photographs, drawing, graphs, audio and video clips in presentation. Presentation created in PowerPoint can be used to accompany lectures or as the basis for web sites.

 








-183-

 

Unit 10: Web Page Designing

 


[Short Answer Questions]

What is HTML ?Explain the types of tag of HTML.


Ans: An HTML (Hyper Text Markup Language) document is essentially a text file with special tags to help your web browser display its content.HTML formats text, graphics and structure in individual web pages. Web page must use correct syntax in order for web browsers to understand and display them correctly. It supports style sheet, scripting language and server side codes. HTML is a markup language. Some popular markup languages are: DHTML, SGML, XHTML, XML etc


HTML consists of elements, which are made up of tags, which contain attributes, which often have values.

Element An element is general name for tag.

Attributes  Attributes defining same form of  markup in

HTML


Examples:

Element  <P>

Attribute <P ALIGN=”LEFT”>


Value <Image src=”C:\images.gif” border=0align=”left”>


Types of tags are:

Container Tags/Paired tags


In HTML, tags that include both an on and an off tag are called container tags. These tags wrap around text in your document and perform some sort of formatting on the text. They hold, or contain, the text between the two tags. The title, HTML, head, and body tags are all container tags-the relevant text goes between the on and off tags. Container tags always have the following form:


<TAG>text being formatted or defined</TAG>


Empty Tags/Unpaired Tags


All other tags in HTML fall into one other category, called empty tags. These tags have only an on tag-there are no off tags. The reason for this is that empty tags don't act on blocks of text. Instead, they do something all on their own. An example of this would be the <HR> (horizontal rule) tag. This tag draws a line across the width of your document. For example:


-184-

 

The following is a horizontal line:


<HR>

The rest of this is just more text.

What is paragraph tags?Explain different types of


paragraph tags.


Ans: Paragraph tags are basically good for keeping form data together in smaller chunks. As always, paragraph tags will add space on either side of the text that they enclose. You don't always want to add <HR> tags just because your form needs some white space. For instance, here is a nice, short comment form:


The basic paragraph Tag: <P>

Attributes: ALIGN=”LEFT/RIGHT/CENTER”

e.g.<P ALIGN=”LEFT”> ………………………...</P>


Preformatted paragraph

The <PRE> (preformatted text) tag is designed to allow you


to keep the exact spacing and returns that you've put between

the on and off tags. The basic reasoning behind this tag is the

notion that every once in a while you'd like your text to stay

exactly as you put it-for instance, in a mathematical formula,

or if you create a table. While there are other ways to do both


tables and math, they don't fall under the HTML 2.0 standard.

On top of that, you can use <PRE> for a number of other


reasons: lists, lining up decimals for dollar figures, and even


poetry.

Tag: <PRE>

Attributes: ALIGN=”LEFT/RIGHT/CENTER”

e.g. <PRE>……………..</PRE>


What is a form in web page designing?Write command to


create text link,image link and email link.

Ans: From previous guess


What is frame ?Explain Ans: From previous guess

What is scripting language?What do you know about

javascript and VBScript?

Ans: From previous guess

 








-185-


No comments:

Post a Comment

MCQ Question Bank Microsoft PowerPoint