Anda di halaman 1dari 18

UNIT I

Objectives: Describe basic computer system concepts Describe history of computer languages List the steps in the development of a computer programming Describe system development lifecycle Define algorithm Define pseudo code Define flow chart List the symbols used in flow chart Define software engineering

INTRODUCTIN TO COMPUTERS Computer systems: Computer is an electronic device, which accepts data as input process it by doing some kind of manipulations and produce the output in desired format. Technically a computer is a high speed electronic data processing machine. Block diagram of a computer

CU
In-put unit

ALU
Out-put unit

Memory

Auxiliary memory

The computer consists of four major blocks 1. In-Put unit 2. Central Processing Unit (CPU) 3. Out-Put unit 4. Memory unit In-Put Unit: It provides man to machine communication. It accepts data in human readable form, converts it into machine-readable form and sends it to CPU. Key Board and mouse are commonly used in-put devices. Other in-put devices are punched cards, optical scanners, joy stick etc. Central Processing Unit: It controls the sequence of operations as per the stored instructions. It issues commands to all parts of the computer. It process the data and sends results to out put devices, stores data and instructions. Again CPU consists of Control Unit : To Control the activities Arithmetic Logic Unit(ALU) :To perform all arithmetic and logical operations Memory Unit :To store the primary data Memory Unit: It is used to store the programs and data. It is mainly two types 2

Main Memory or Immediate access memory or Primary storage: It is part of CPU and is used to store the primary data when the program is being executed. Auxiliary or Secondary storage: Which is external to the CPU. Out-Put Unit: Out put unit is provided for machine to man communication. It receives the information from CPU in machine readable form , and presents it to user in a desired form. Visual Display Unit(VDU),Printers are most commonly used out-put devices. COMPUTER SYSTEM Computer

Hardware

Software

Computer is made up of two major components called hardware and software. All physical components of computer comes under hardware like all input and out put devices memory and CPU etc. And the software is collection of programs that allows the hardware to do its job. Computer software is divided into two broad categories system software and application software. System Software :It manages the computer resources and provides the interface between the hardware and the users. We can have operating system , system support programs and system development programs under this system software. Application software: It is directly responsible for helping users in solving their problems. Again we can classify into general purpose application software and application specific software. General purpose application software: It is used for more than one applications for example word processor, data base management system etc. Application specific software: It can be used for its intended purpose. A general ledger system used by an accountants is an example for an application specific software. Software System Software Operating Sys Sys support Sys development Application Software General purpose Application specific

History and development of computers: i. Abacus: The first calculating machine ABACUS was developed by the Chinese. It is still being used by Russia and Japan.

Analog machine : The Scottish mathematician John Napier developed a device called Napier Bones analog machine at around 1617. All arithmetic operations can be performed with the help of this machine. iii. Odometer: It is also called as speedometer, using this along with basic arithmetic operations logarithms can be worked out. iv. Mechanical calculator: The first mechanical calculator was made by the French Mathematician Blaize Pascal in 1642. Its a simple calculator used for addition, and subtraction purpose. Later Leibnitz Calculator was designed by Gottfried Leibnitz in 1671. It can be used for addition, subtraction, multiplication and division. v. Differential engine: Father of modern digital computers Charles Babage an English mathematician proposed to build a general purpose problem solving machine in 1833.This machine called an Analytical Engine was designed to perform all the five basic data processing operations namely input, storage, control, process and output. Computer Generations: Over the years many scientific advances occurred in the computer industry. Based on the technology advances the computers have been grouped into five generations. First generation(1951-1958): The first generation computers used vacuum tubes technology. They were heavy occupying much space, unreliable and consumed large amount of power. It did not have the stored program concept. ENIAC ( Electronic Numerical Integrator And Calculator) ,EDSAC(Electronic Delay Storage Automatic Computer),EDVAC(Electric Discrete Variable Automatic Computer),UNIVAC(Universal Automatic Computer),IBM-701&IBM 650 are examples for first generation computers. Second Generation (1959-1964): Used Transistors technology. The size of the transistor is 1/200th size of vacuum tube. Transistors helped in developing smaller and more reliable computers, which used less power and generated less heat than the first generation computers. Third Generation(1964-1970): These computers were characterized by IC(Integrated Circuit) technology, which contains many components fused together on single chip. These computers are very reliable and could store programs. Fourth generation(from 1970 onwards): These computers were developed by using microprocessor technology to increase the speed , greater reliability and large storage capacity etc. Fifth Generation: In this generation AI(Artificial Intelligence) technology is used. Types of Computers: One can classify the computers on the following bases o Classification based on type o Classification based on purpose o Classification based on configuration Classification based on type: Based on type we can classify the computers into three types 4

ii.

a) Digital computer b) Analog computer c) Hybrid computer Digital Computer: The computers that work with binary digits (0 and 1) are generally known as digital computers. Here all expressions are represented in the form of binary digits, and inside the computer all operations are done using these digits at high speed. A digital computer performs only one mathematical operation i.e. addition. With the help of addition it performs other operations like subtraction, Multiplication, division, exponentiation etc. Here the instructions and data are fed to the computer in the form of discrete electrical signals. Analog Computers: These computers uses analog data. The primary advantage of these computers is , All the calculations are done in parallel . Example for analog computer is speedometer. Hybrid Computer: The best features of digital and analog computers are combined in hybrid computers. These computers help the user to make use of the machines ability to process both continuous and discrete data. These are widely used in scientific applications , research and industrial control applications. Classification based on purpose: a) General purpose computers b) Special purpose computers General purpose Computers: The computers used in our day to day life and which are designed to solve a wide variety of problems in different sectors of social life are known as general purpose computer systems. Special purpose Computer systems: Generally the architecture of these kind of computers is designed for one or more specific applications. They handle very narrow categories of data processing activities. Examples are: -Computer means for process control in industry -Robots -Computer mean for air traffic control etc. Classification based on configuration: The computers are classified as follow with respect to their size, and data processing capacity. a) Micro Computer b) Mini Computer c) Main Frame Computer d) Super Computer Micro Computer: Its a smallest computer , which uses s micro processor as its CPU. A micro computer is also called as a personnel computer(PC), can interact with single user. These computers are in-expensive and popular used for business and industrial applications. Mini Computer: Mini computer is 16 times faster than a micro computer , multiple users can interact with these computers. These are commonly used for business and scientific applications. Main Frame Computers: A main frame computer is large computer having the capacity of 16 mini computers. These computers are most commonly used for problems such as weather forecasting etc. 5

Super Computer: Super computers are most powerful computers, and these computers are having the capability of around 64 main frame computers. These are generally used for missile firing, satellite launching etc. Computing Environments: We are having different kinds of computing environments Personal computing environment Time-sharing environment Client-Server environment Distributed computing etc Personal computing environment: In a personal computer all of the computer hardware components are tied together . In this situation we have the whole computer for our self, and we can do what ever we want. Time sharing Environment: In a time sharing environment many users are connected to one or more computers, These computers can be minicomputers or central mainframe computers. In this environment the out-put devices and auxiliary storage devices are shared by all the users through central computer and computing must be done by the central computer. terminals

central storage

Central computer

Shared printer

Client/Server environment: In a client server computing environment computing function can be carried out by central computer and user computers. Server Shared printers Central storage

clients 6

Here users are given personal computers called clients or work stations, which will communicate with powerful central computer called server. Because the work is shared between clients and sever response time low and productivity will be high. Distributed computing: In distributed computing environment the computing complexity will be distributed among multiple servers and clients, which are having connectivity. This environment is reliable and scalable.

server Internet Server

Clients

Computer Languages: A program is a set of instructions written to solve a problem or function. To write a program for a computer we must use a computer language. Over the years computer languages have evolved from machine language to natural language. Machine language: Machine language is a language which can be understood by the computer with out any translation. This is a fundamental language of a computer, its nothing but a sequence of 0s and 1s called binary representation. It is difficult to understand and debug. It is slow to enter and not readable but programs written in machine language can be executed very by the computer. Machine language is machine dependent. Assembly Language: In assembly language programming numeric operation codes are added by mnemonics. Mnemonics are the instructions in the assembly language. It is readable and easy to debug but machine dependent and needs to be coded using assemblers. A translation program which translate an assembly language code into computers machine language code is called an assembler. High level language: This language is based up on solving the problem instead of being machine based. This language enables the programmer to write instructions using English words. It is machine independent and easy to debug. In high level language the translation job is done by the compiler. Compiler translate high level language instructions into machine language. Computer Language evolution
1940's Machine Language 1950's Assembly or Symbolic Language 1960's High-Level Language

Creating And Running a Program: It is the job of the programmer to write and test the program. There are four steps in this process. 1. Writing and Editing the program 2. Compiling the Program 3. Linking the program with required library modules 4. Executing the program 7

Building a C program Text Editor programmer Compiler


#include<stdio.h> #include<stdio.h> void main() main() { void -----{ -----------} ------}

Source Program

001001001 0001011001

Object Code

Library

Linker

00110 0011 11000

Executable

Runner

Hai hello Friend Hai hello Friend

Result

Writing and editing Program: The software used to write programs is known as a text editor. A text editor helps us to enter ,change and store character data. More often these text editors included compiler and some set of menus to deal with statements. After writing a program we should save our file to disk. This file will be input to the compiler and it is known as a source file. Compiling Program: The code in the source file stored on the disk must be translated into machine readable form by the Compiler. After compilation the file we get is object module which will be in machine language. Linking Programs: C program is made up of many functions .We write some of these functions and they are a part of our source program. However there are other functions such as input and out put and mathematical library functions, that exist else where and must be attached to our program. The linker assembles all these library functions, and our functions into our final executable program. Executing Program: Once our program has been linked it is ready for execution. Here loader will load the program into primary memory of the computer. To execute a program we use an operating system command ,such as run.

SYSTEM DEVELOPMENT:

System development life cycle: Todays large scale and modern programming projects are built using a series of inter related phases commonly referred to as the system development life cycle. The names and exact number of these phases are differ depending on the environment. The popular development life cycle model is waterfall model. Depending on the software being developed , this model consists of five to seven phases.

Waterfall Model
System requirements

analysis design

code

Waterfall model starts with system requirements , here the Requirements stated in terms that the user understands. The analysis phase look at different alternatives from a System point of view, While the design phase determines How the system will be built. In the fourth phase we will do Coding. After the programs have been written and tested to The programmers satisfaction, the program proceeds to Testing phase. All the programs are tested together to make Sure the system works as whole. The final phase , Maintenance keep the system working, once it has been put Into production.

testing

maintenance Here the iterations are shown using backward arrows. Program development steps: Computer program is the list of instructions a computer follows in carrying out its computations. The process of writing a program is called programming. Steps involved in computer programming is as follows 1. Problem specification: The problem must be clearly understood. The programmer should know exactly what is the problem, what is input ,out-put and how to solve it. 2. Outlining the solution: In this step solution method is to be chosen or developed. Once the problem is cleared, then we will consider different methods to solve the problem. Among them we will choose an optimal method . 3. Selecting and representing Algorithm: An algorithm is nothing but step by step procedure we are following to solve a particular problem. An algorithm can be written in simple English or in any other standard notation. 4. The Algorithm is programmed: It is relatively easy to convert the algorithm into a program. The choice of a programming language depends on the nature of problem and the availability of programming language.

5. Removing Errors: After writing the programs we should ensure that they are error free . The process of detecting and removing the errors is called debugging. There are 3 types of common errors . a) Syntax errors: These errors occur due to wrongly typed statements, which are not according to the syntax or grammatical rules. Ex: a = b+(c+d))/2 Left parenthesis is missing These errors are found at the time of compiling the programs. b) Logical Errors: These errors occur if we miss use the operators or due to logically incorrect instructions in the program. These errors can be known only after output is examined. c) Runtime errors: The errors detected at the time of program execution are called runtime errors. These errors can be known at the time of execution only. Most common errors are i) Exceeding the system dependent limits. ii) Divide by zero. iii) Square root of a negative number. iv) Logarithm of a negative number. 6. Testing and validation: Once program is written, the programmer will do testing to know whether it is working properly or not .He will compare the desired result from all possible valid input. 7. Documentation and maintenance: Documentation is a process of collecting, organizing and maintaining complete information about the program. 8. Maintenance: Modifications we will do for the program according to changing requirements are called maintenance. ALGORITHM Algorithm can be defined as a step by step procedure we follow to solve a particular problem. It consists of English like statements or flow charts. Characteristics of an algorithm: There are five important characteristics 1. Input : It may take zero or more inputs. 2. Output : It should produce at least one result. 3. Definiteness : Each instruction must be clear, well defined and precise. There should not be any ambiguity. 4. Finiteness : It should be a sequence of finite instructions. 5. Effectiveness : The operations must be simple and must be completed in a finite time.

Algorithm Notation: ( Using pseudo code) Name of the algorithm: It specifies the problem to be solved Step number: Identification number or tag of an instruction it should be a positive value. 10

Explanatory Comments: It follows the step number and describes or explains the operation to be performed. It should be written with in a pair of square brackets. Termination: It indicates the end of the algorithm. It is generally a STOP statement , and it is the last instruction in the algorithm

Example: Write an algorithm to find sum of two numbers. Algorithm: Addition of two numbers Step 1: Start Step 2: [Read A and B ] Read a,b Step 3: [Compute ] Sum=A+B Step 4: [Print Sum.] Step 5: [end] Stop. FLOW CHART: A flow chart can be defined as the diagrammatic representation of an algorithm. It is a chart showing flow of logic involved in solving the problem. It is easy to understand and analyze the problem. Flow chart is constructed by using geometrical figures, which indicates particular operation. While drawing the flow chart ,operation must be written inside the geometric figures. Symbols used to construct flow chart are
Name oval Parallelogram Use Start / stop Input / Output Operation

Rectangle Circle

Continuation

Rhombus Arrows

Decision Making Connections

11

Example: Flow chart for sum of two numbers.

Start Read a,b C=a+b

Print c

Stop

Selection Statements: Selection statements can cause the flow of the program to change. They allow the execution of selected statements and skipping of other statements. Structured programming has two selection statements 1) Two-way selection (if- else) 2) Multi way selection (else-if or switch) Two-way selection: F T

Conditi on

False action

True action 12

Example: Flowchart for finding greatest of three numbers. Start

Read a,b,c True False

a> b False False

True

a> c

b> c

True

Print a

Print c

Print b

Stop

Multiway selection:
Expressi on

A A action

B B action

C C action

D D action 13

Looping Statements: There are three looping statements used: 1) for Statements 2) while Statements 3) dowhile Statements for Statements It is a counter-controlled loop. This uses three actions namely, initialization, test and update. The following is the representation of a for Statement

Initialization Update Condition T

BODY (One Statement)

Start Example: Flowchart to displaying 20 numbers using for loop

i i++ i < 20 T

Write (i) 14

Stop

while Statement

Condition T

Body (One Statement)

dowhile Statement

Body (One Statement)

T Condition F 15

Example: Flowchart to find the sum of first 10 natural numbers using while statement

Start Sum 0

Read (num)

num > 0

T Sum sum+num

Read (num) Write (sum)

Stop

Software Engineering: Software Engineering is establishment in use of sound engineering methods and principles to obtain software that is reliable and that works on real machines. In software engineering people use CASE tools (Computer Assisted Software Engineering) to 16

determine requirements, design software and develop and test software. Here everything will be done in automated environment.

THE END Objective type questions from the 1st unit: 1. Which of the following is not an input device? a. Plotter b. Scanner c. Keyboard d. Mouse 2. The parallelogram is used to represent . Type of statements in flow charts? a. Input output b. Functions c. Decisions d. Processing 3. Which of the following is not a translator program? a. Linker b. Assembler c. Interpreter d. Compiler 4. Object code produced by which of the following phase? a. Preprocessing b. Linking c. Compilation d. Editing 5. The hardware along with the read only software that resides on this hardware is combinely called as .. 6. Execution of C program begins at .. 7. In flow charts decisions are represented by using .. symbol 8. .acts as interface between the computer hardware and the user of the computer. Previous Question papers from the first unit: 1. Explain the functions of the following a) Compiler b) Linker 2. Draw the flow chart to find maximum and minimum of the given three input numbers. 3. Explain different phases in software development methods. 4. Explain about algorithm 5. What are the different types of symbols in flow charts.

17

*******************************All the best*******************************

18

Anda mungkin juga menyukai