Thursday, 17 November 2016

Fundamentals of computers

Q) What is a computer? What are the characteristics and limitations of computer?
Ans:  “Computer is an electronic device that processes given data to derive the required and useful information”.
During the processing the computer performs various functions like
·         Accepting instructions from the user
·         Accepting data from the user
·         Performing various arithmetic and logical operations as per instructions given
·         Presenting the information or output to the user

Characteristics of Computers
1.    Speed: Computers can perform millions of operations per second. The speed of computers is usually given in nanoseconds (ns) and picoseconds (ps), where 1 ns = 1×10-9 sec and 1 ps = 1×10-12 sec.
2.    Versatile: Computers can perform multiple tasks of different nature at the same time.
3.    Memory: Computers have internal or primary memory (storage space) as well as external or secondary memory to store data and programs.
4.    Accuracy:  A computer always gives accurate results, provided the correct data and instructions are input to it. If the input data is wrong, then the output will also be erroneous. This is called garbage-in, garbage-out (GIGO).
5.    Automation: Computers perform a task without any user intervention.
6.    Diligence: Unlike humans, computers never get tired of a repetitive task.
7.    Economical:  Computers are considered as short-term investments for achieving long-term gains.  They save time, money, and energy.

LIMITATIONS OF COMPUTER
Computer is, no doubt, a marvellous tool. Yet it has some limitations. Some of the major limitations of computer are as follows.
1. Computer cannot think on its own. It has to be given instructions to perform any operation. Research is currently underway to impart artificial intelligence to computer. Once this becomes possible computer will be thinking on its own, then it will be a reasonable replication of human mind.
2. It does not have intuition. It cannot draw a conclusion without going through all intermediate steps.
3. It can do a task only if it can be expressed in a series of finite steps leading to the completion of the task.
4. Similarly, it cannot handle a situation where a finite number of steps generate an impossibly large number of computational operations.
5. It cannot learn from experience. It will commit the same error repeatedly and cannot learn from experience. But changes are taking place in this area as research progresses on artificial intelligence.
Q) What are the five basic operations performed by the computer? OR
Q) Draw a block diagram of computer. Explain its parts.
The computer performs basically five major operations of functions irrespective of their size and make. These are 1) it accepts data or instruction by way of input, 2) it stores data, 3) it can process data as required by the user, 4) it gives results in the form of output, and 5) it controls all operations inside a computer.
1. Input: this is the process of entering data and programs into the computer system.
2. Control Unit (CU): The process of input, output, processing and storage is performed under the supervision of a unit called 'Control Unit'. It decides when to start receiving data, when to stop it, where to store data, etc. It takes care of step -by-step processing of all operations in side the computer.
3. Memory Unit: Computer is used to store data and instructions.
4. Arithmetic Logic Unit (ALU): The major operations performed by the ALU are addition, subtraction, multiplication, division, logic and comparison.
5. Output: This is the process of producing results from the data for getting useful information.
The ALU and the CU of a computer system are jointly known as the central processing unit (CPU). You may call CPU as the brain of any computer system.
ng updated at the same time, there is a possibility of the administrator reading an incorrect address.


These difficulties lead to the development of database systems.
Q) What are the Uses of Computer systems?
1.Use of Computers in Education
The use of computers in the education sector has increased greatly over the past few years.
Advantages and Disadvantages of Computers in Education:
1.    Computers are the best way of teaching subjects to students. These days, all schools and colleges have computer labs where they receive practical training from their teachers.
2.    Computers assist teachers in teaching their students easily and quickly.
3.    Students can search for the concepts or things which they wish to know, by referring to relevant websites.
4.    Increasing the knowledge of these students greatly.
5.    Another advantage of computers is that it enables the students to gain knowledge of various subjects and things which are out of their school syllabus to widen their learning.
6.    Computers in the classroom can help teachers to save time in teaching much more than they can do without them.
7.    Charts, diagrams and figures can easily be illustrated for the students while teaching practical oriented subjects such as Algebra, Geometry, Physics, Biology or Botany

2. Uses of computer in business
Computers can be used in business from the stage of manufacturing till the stage of its sale. We cannot think of a business without a computer. Any managing work depends on computer scheduling that controls communication managing data and all the information about company and competitors. Computers can keep records of all the employees

3. Uses of Computers in Hospitals
Since almost 2 decades, computers have been included in hospitals and medical clinics throughout the world. Some uses of computers in hospitals do not involve treating patients but help medical staff and doctors to handle information and data in a better manner.
Application of Computers in Hospitals
·         Handling Medical Data
·         Scanning and Imaging
·         Examination and Monitoring
 Advantages of Computers in Hospitals
·         Precise tests and medical examinations
·         Faster medical alerts, which are more accurate time-wise
·         Enhanced data about patients medical history
·         Precision in diagnosis
·         Precision in billing
·         Automated updating of medical history

4. Uses of Computers in Airports
Computers are used in airports to:
a)    Keep track of the planes' locations, speed, direction, status, etc.
b)    Monitor security devices like cameras, x-ray machines, and metal detectors
c)    Keep up with the departure/arrival status
d)    Communicate over screens audio systems, and paging devices
e)    It is used for saving, who have booked the tickets

Q) Explain Computer Generations. OR
Q Explain history of Computers

Using size and features as the bases, computers are classified into various generations. These generations of computers are:

First Generation Computers (1951-1958):
The first generation computers were made up of vaccum tubes. Each computer had as many as thousands of vaccum tubes and hence the first generation computers were extremely large in size and require more space. These computers generated considerable amount of heat and poor reliability. These required constant maintenance.
To enter data into the computer punch cards were used. Punch card is a sheet of thick paper, in which holes are punched accordingly to a coding scheme.
Second Generation Computers (1959-1964):
With the invention of junction transistors, the vacuum tubes were replaced by transistors. Transistors were more reliable, small in size and required low power when compared with vacuum tubes. The second-generation computers were faster and had increased storage capacity. In the second-generation computers, in addition to the main memory an external or auxiliary storage device like magnetic tapes, magnetic disks were used. Second generation computers lead to the development of high level languages like
FORTRAN= Formula Translation
COBOL =Common Business Oriented Language
ALGOL = Algorithemic Language
APL =A Programming Language
With these languages the computers began to find their use in commercial and scientific applications.
Third Generation Computers (1965 - 1971):
Integrated circuits (IC) were intorduced n 1960’s. In an IC, hundreds of transistors were incorporated on a single silicon chip and hence with IC’s computers could be made even small, more reliable and less expensive. After few years of invention of IC’s they were used as main memory. The magnetic discs replaced the magnetic tapes for auxilary memory.
Fourth generation computers (1971 - present):
In the early 1970’s development of microprocessors revolutionized the computer industry. Very large scale integration (VLSI) and very high speed integration circuits led to the development of microcomputers. These circuits improved the performance of the computer in various aspects like speed, reliability and stability. These occupy less space and required no air- conditioning. With the advent of microprocessors, personal computers were developed. These are user friendly and are very easy to operate. The most popular integrated circuits used for personal computers are Intel’s 8008,8080,8085,8086 and Zilog’s Z-80.
Fifth generation computers:
Computers with capabilities to think reasonably make judgements, take decisions with artificial intelligence have the potential to change the world. These computers are classified as fifth generation computers. Very large scale integration will have millions of components on a single chip available at very low cost. Communication between user and systems is likely to be able to emulate performance of human brain where thinking computers will open new horizons in computing arena.
Q Explain different types of computers.
Computers can be classified into two categories,
1. Classification according to the logic used.
2. Classification according to the size.

1. Classification according to the logic used:
a. Analog computers:
These computers recognize data as a continuous measurement of a physical property. They assign numeric values by physically measuring from actual property. Such as length of an object, an angle created by two lines etc. Analog computers derive all their data from some form of measurement. The accuracy of the data used in an analog computer is directly related to the precision of its measurements.
Examples: Thermometers, speedometers, barometers etc.
b. Digital computers:
Digital computers represent data as numbers or separate units. Counting on fingers is the simplest form of digital computer. Each finger represents one unit of the item being counted. Unlike the analog computer, which is limited to the accuracy of the measurements made, the digital computer can accurately represent data using as many positions and numbers as necessary.
Examples: Adding machines, pocket calculator and personal computer
Digital computers are further grouped into two categories
1. General purpose computers: The digital computers, which can theoretically be used for any type of application, are called general-purpose digital computers. These computers can be used in solving a business problem as well as mathematical equation with same accuracy and consistency.
Example: The computers that are used for payroll, graphs, analysis, account, banking etc.
2. Special purpose computers:
These are those digital computers, which are designed, made and used for specific job. These are usually used for those purposes, which are critical, and need great accuracy and response like satellite launching, weather forecasting etc.
c. Hybrid computers:
Hybrid computers combine the best features of analog and digital computers. They have the speed of analog and the accuracy of digital computers. They are usually used for special problems in which input data derived from measurements is converted into digits and processed by the computers. The computer can act like an analog computer converting measurement into numeric input. It can act as a digital computer processing stored data for management.
Classification according to size (Shapes of Computers)
There are both large and small computers.
Large computer system:
They have been traditionally divided into three main categories
1. super computers
2. Main-frame computers
3. Mini computers
4. Micro computers

1. Super computer:
A super computer is generally characterized as being fastest, most powerful and most expensive computer. Super Computers recognize the largest word lengths of 64 bits or more. They calculate at rates up to 1.2 billion instructions per second. They can take input form over 10,000 workstations.
Super Computers are widely used in scientific applications such as Aerodynamic design and simulation, processing of geological data, processing of data regarding genetic coding and collecting and processing weather data.
Example: The most powerful Super Computer today, the CRAY-2 is setup in a C-shape, it is not as tall as a person and is small enough to fit in the space of a large business desk.
2. Main Frame Computers:
The largest type of computer in common use is the Mainframe. Mainframe computers are used where many people in a large organization need frequent access to the same information, which is usually organized into one or more huge databases. A technique that allows many people at terminals to access the same compute at one time is called time-sharing. [A terminal is a keyboard and screen wired to the mainframe. It does not have its own CPU or storage. It is just an input/output (storage) device] Mainframe process data at several million instructions per second (MPIS). More than thousand workstations can be accommodated by a typical mainframe computer.
Example: Mainframes are used by banks and many businesses to update inventory etc.,
3. Mini Computers:
Mini computers are smaller than mainframes. The capabilities of mini computes lie in between the mainframes and personal computers. Like mainframes, mini computers can handle a great deal more input and output than personal computers can. Although some minis are designed for single use. Many can handle dozens or even hundreds of terminals.  Example: IBM AS 400
4. Personal Computers or Micro Computers:
A microcomputer is the smallest, least expensive of all the computers. The prefix micro refers mainly to the physical size of the computer and its circuitry rather than its capabilities.
The essential differences between micro computers and mainframe or mini computers are that micro computers has smallest memory and less power and are physically smaller and permit fewer peripherals to be attached.
Microcomputers available in different capabilities and size are
1. Desktop Models
2. Notebook Computers
3. Personal Digital Assistance
1. Desktop Models:
Desktop computers are actually small enough to fit on a desk but are a little too big to carry around. In the tower model, the main case which is called the system unit sits vertically and has more space for devices. Because of its design this model is often placed on the floor to preserve desk space, allowing more room to place external components such as removable disk drives or scanners on the desktop.
2. Notebook Computers:
Notebook computers, as their name implies, approximate the shape of an 8.5 by 11-inch notebook and can fit easily inside a briefcase. Also called laptops, they can operate on plugin current or with special batteries. Notebooks are fully functional microcomputers. Some models can plug into a dock that includes a large monitor, a full sized keyboard and some times an additional disk drive.
3. Personal Digital Assistants (PDA):
PDA’s are among the smallest of portable computers. Often, they are no larger than a checkbook. PDA’s also sometimes called palmtops are much less powerful than notebook or desktop models. They are normally used for special applications, such as creating small spreadsheets, displaying important telephone numbers and addresses, and keeping track of dates and agendas. Many can be connected to larger computers to exchange data.
Q) What are the number systems?
Number systems are the technique to represent numbers in the computer system architecture, every value that you are saving or getting into/from computer memory has a defined number system.
Computer architecture supports following number systems.
·         Binary number system
·         Octal number system
·         Decimal number system
·         Hexadecimal (hex) number system
Binary number system:  A Binary number system has only two digits that are 0 and 1. Every number (value) represents with 0 and 1 in this number system. The base of binary number system is 2, because it has only two digits.
Octal number system: Octal number system has only eight (8) digits from 0 to 7. Every number (value) represents with 0,1,2,3,4,5,6 and 7 in this number system. The base of octal number system is 8, because it has only 8 digits.
Decimal number system:  Decimal number system has only ten (10) digits from 0 to 9. Every number (value) represents with 0,1,2,3,4,5,6, 7,8 and 9 in this number system. The base of decimal number system is 10, because it has only 10 digits.
Hexadecimal number system: A Hexadecimal number system has sixteen (16) alphanumeric values from 0 to 9 and A to F. Every number (value) represents with 0,1,2,3,4,5,6, 7,8,9,A,B,C,D,E and F in this number system. The base of hexadecimal number system is 16, because it has 16 alphanumeric values. Here A is 10, B is 11, C is 12, D is 14, E is 15 and F is 16.


DBMS Notes

A) DATA:
·         It is a collection of information.
·         The facts that can be recorded and which have implicit meaning known as 'data'.
Example:   Customer ----- 1.cname.       2. cno.                     3. ccity.

B) DATABASE:
·         It is a collection of interrelated data.
·         These can be stored in the form of tables.
·         A database can be of any size and varying complexity.
·         A database may be generated and manipulated manually or it may be computerized.
Example:  Customer database consists the fields as cname, cno, and ccity
C) DATABASE-MANAGEMENT SYSTEM (DBMS):
·         A database-management system (DBMS) is a collection of interrelated data and a set of programs to access those data.
·         The collection of data, usually referred to as the database, contains information relevant to an enterprise.
·         The primary goal of a DBMS is to provide a way to store and retrieve database information that is both convenient and efficient.

Q) What are the Database System Applications?
A) Database System Applications are as follows.

  1. Banking: For customer information, accounts, and loans, and banking transactions.
  2. Airlines: For reservations and schedule information. Airlines were among the first to use databases in a geographically distributed manner—terminals situated around the world accessed the central database system through phone lines and other data networks.
  3. Universities: For student information, course registrations, and grades.
  4. Credit card transactions: For purchases on credit cards and generation of monthly statements.
  5. Telecommunication: For keeping records of calls made, generating monthly bills, maintaining balances on prepaid calling cards, and storing information about the communication networks.
  6. Finance: For storing information about holdings, sales, and purchases of financial instruments such as stocks and bonds.
  7. Sales: For customer, product, and purchase information.
  8. Manufacturing: For management of supply chain and for tracking production of items in factories, inventories of items in warehouses/stores, and orders for items.
  9. Human resources: For information about employees, salaries, payroll taxes and benefits, and for generation of paychecks.

Q) Explain the Traditional Approach for Data Storage and the Need of DBMS (OR) Explain the difference between File processing systems and database (OR) Problems with Early Information System

ANS: Traditional Data Storage Model
1.       In traditional approach, information is stored in flat files which are maintained by the file system under the operating system’s control.
2.       Application programs go through the file system in order to access these flat files

How data is stored in flat files

·         Data is stored in flat files as records.
·         Records consist of various fields which are delimited by a space, comma, pipe, any special character etc.
·         End of records and end of files will be marked using any predetermined character set or special characters in order to identify them
Example:  Storing employee data in flat files


  Problems with traditional approach for storing data
1.       Data Security: The data stored in the flat file(s) can be easily accessible and hence it is not secure.

Example: Consider an online banking application where we store the account related information of all customers in flat files. A customer will have access only to his account related details. However from a flat file, it is difficult to put such constraints. It is a big security issue.
2.       Data Redundancy: In this storage model, the same information may get duplicated in two or more files. This may lead to to higher storage and access cost. it also may lead to data inconsistency.

For Example, assume the same data is repeated in two or more files. If a change is made to data stored in one file, other files also needs to be change accordingly.

Example: Assume employee details such as firstname, lastname, emailid are stored in employee_details file and employee_salary file. If a change needs to be made to emailid, both employee_details file and emplyee_salary file need to be updated otherwise it will lead to inconsistent data.
However, it is possible to design file systems with minimal redundancy. Also note that Data redundancy is sometimes preferred.

Example: Assume employee details such as firstname, lastname, emailid are stored only in employee_details file and not in employee_salary file. If we need to access an employee salary along with firstname of the employee, we have to retrieve details from two files. This would mean an increased overhead.
3.       Data Isolation: Data Isolation means that all the related data is not available in one file. Usually the data is scattered in various files having different formats. Hence writing new application programs to retrieve the appropriate data is difficult.

4.       Program/Data Dependence: In traditional file approach, application programs are closely dependent on the files in which data is stored. If we make any changes in the physical format of the file(s), like addition of a data field , etc, all application programs needs to be changed accordingly. Consequently, for each of the application programs that a programmer writes or maintains, the programmer must be concerned with data management. There is no centralized execution of the data management functions. Data management is scattered among all the application programs.

Example: Consider the banking system. An employee_salary file exists which has details about the salary of employees. An employee_salary record is described by
employee_id
firstname
lastname
salary_amount
An application program is available to display all the details about the salary of all employees. Assume a new data field, the date_of_joining is added to the employee_salary file. Since the application program depends on the file, it also needs to be altered.
If the physical format of the employee_salary file for example the field delimiter, record delimiter, etc. are changed, it necessitates that the application program which depends on it, also be altered.  
5.       Lack of Flexibility: The traditional systems are able to retrieve information for predetermined requests for data. If we need unanticipated data, huge programming effort is needed to make the information available, provided the information is there in the files. By the time the information is made available, it may no longer be required or useful.

Example : Consider a software application which is able to generate employee salary report. Assume that all the data is stored in flat files. Suppose we now have a requirement to retrieve all the employee details whose salary is greater than Rs.10000. It is not easy to generate such on-demand reports and lot of time is needed for application developers to modify the application to meet such requirements.
6.       Concurrent Access Anomalies: Many traditional systems allow multiple users to access and update the same piece of data simultaneously. However this concurrent updates may result in inconsistent data. To guard against this possibility, the system must maintain some form of supervision. But supervision is difficult because data may be accessed by many different application programs and these application programs may not have been coordinated previously.

Example : Consider a personal information system which has the data of all employees. Now there may be an employee updating his address details in the system and at the same time, an administrator may be taking a report containing the data of all employees. This is called concurrent access. Since the employee's address is being updated at the same time, there is a possibility of the administrator reading an incorrect address.

These difficulties lead to the development of database systems.