GE COMPUTER PROGRAMMING

Similar documents
COMPUTER - GENERATIONS

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

CHAPTER 1 INTRODUCTION TO COMPUTERS. 2. HOW COMPUTERS WORK Any digital computer carries out five functions in gross terms:

COMPUTER SKILLS COMP101

Basic Computer Information Technology-I

Chapter 1: Introduction to Computers

Chapter 1: Introduction to Computers. In this chapter you will learn about:

Learning Objectives. In this chapter you will learn about:

v.m.g.rajasekaran ramani sri sarada sakthi mat. Hr. sec. school

Computer Fundamentals

HIGHER SECONDARY FIRST YEAR 2 MARK & 5 MARK NOTES CHAPTER 1 1. INTRODUCTION TO COMPUTER

SNS COLLEGE OF ENGINEERING

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Computer Fundamentals

ABC Atanasoff-Berry Computer

Introduction to Computer World Fall 2016

Overview of a computer

Ms. Minerva A. Lagarde

COMPUTERIZED OFFICE MANAGEMENT

Computer Programming for Engineering

Chapter 2 HISTORICAL DEVELOPMENT OF COMPUTERS

Computer Fundamentals. Computer - Overview. Functionalities of a computer. Definition

Describe the layers of a computer system

Chapter 2 Basic Computer Configuration

LECTURE -I BASIC CONCEPTS OF COMPUTERS

Chapter Two Computer Types

UNIT-I FUNDAMENTALS OF COMPUTER

INTRODUCTION TO COMPUTER

Maninder Kaur.

Course-Content. Computer - Overview Computer - Applications Computer Generations Computer - Types Computer - Components

1.2.1 Electronic computers based on digital switching

Zimmer CSCI /24/18. CHAPTER 1 Overview. COMPUTER Programmable devices that can store, retrieve, and process data.

Characteristics of Computers

SSRVM Content Creation Template

Chapter 1 Basic Computer Organization

Sir Sadiq s computer notes for class IX. Chapter no 1. Introduction to computer

EVOLUTION OF COMPUTERS. In the early years, before the computer was invented, there are several inventions of counting machines.

Second Generations Computers( )

Introduction. Basic computer operations: Application of computer:

TNBEDCSVIP.IN. S.No CONTEND Page No 1. NUMBER SYSTEM AND BASE CONVERSIONS TYPES OF NUMBER SYSTEM 1. Binary Number System:

(Types and Classifications of Computers Lecture # 02 By: M.Nadeem Akhtar. Lecturer. URL:

Computing Concepts / IT Fundamental

**GE6151 COMPUTER PROGRAMMING**

1.The First Instrument known in the history of computers was. a) Pascal s adding machine b) Napier s bones c) Abacus d) Analytical Engine

Computers can be broadly classified by their speed and computing power. S.No Type Specifications

Chapter 20: Classification of Computers

Module 3: Functional units of computer

What is Information Technology. Chapter 1: Computer System. Why use Information Technology? What is Data?

Introduction to Computers

Computer Fundamental Tutorial

Unit II. (i) Computer Programming Languages

Trends in Computer System Capabilities

Fundamental of digital computer

Computer Skills Revision. By: Rana Hammady

Computer is an electronic machine that can receive, store, transform and output data of all kinds (image, text, numeric, graphics and sound).

Chapter 1 Introduction to the World of Computers

Learning Objectives. Computer Classification. In this chapter you will learn about:

Computer Principles and Components 1

Computer Systems. Communication (networks, radio links) Meatware (people, users don t forget them)

Computer Concepts and C Programming. Unit I 06CCP13

COURSE OVERVIEW. Introduction to Computer Engineering 2015 Spring by Euiseong Seo

7. Mechanical & Electrical calculator:-

Chapter 1. Computer System Organization

Chapter 1. Introduction To Computer Systems

Fundamentals Of Computer

Q.1 What is Computer? Explain its Characteristics and Limitations? A computer is a fast electronic device, processing the Input data

Lecture -1- By lec. (Eng.) Hind Basil University of technology Department of Materials Engineering

Introduction To Computers. About the Course

1-1 Computer Structure

Computer Organization and Assembly Language

Computer fundaments. Functionalities of a computer

SYLLABUS. Subject Information B.B.A. I SEM Technology

Chapter Two: Program Design Process and Logic

Chapter 2: Computers: The Machines Behind Computing.

CSC 170 Introduction to Computers and Their Applications. Computers

CS101 Lecture 29: Brief History of Computing

Part 1: Computer and Information Literacy

Chapter One. Computers in Context

Agenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010


Introduction to Computer Systems and Operating Systems

INFS 214: Introduction to Computing

Vanavani Mat. Hr. Sec. School. Subject : Computer Science Std: XI. Quarterly Exam Key

Downloaded from various sources on the NET

CHAPTER1 : Part 2 INTRODUCTION & HISTORY OF COMPUTERS. UNIVERSITI TENAGA NASIONAL Generates Professionals

Computing Fundamentals and Programming Batch 2012 (Electronics and Telecomm) Chapter 1: Introduction and Overview to Computers.

Chapter Review. 42 Chapter 1 Introduction to Computers

Chapter 1 Introduction to Computers

Memory Addressing, Binary, and Hexadecimal Review

Dawood Public School Computer Studies Course Outline for Class VI. Course book- Right Byte 1 Fourth edition (Oxford University Press)

Chapter 1 Introduction to Computers

Chapter 1. The Big Picture

Computer science First Class Lecture 1

STUDY MATERIALS ON COMPUTER ORGANIZATION (As per the curriculum of Third semester B.Sc. Electronics of Mahatma Gandh Uniiversity)

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR

Week 1 Introduction to Programming

COMPUTER SYSTEMS. Section 1

6. Under which of the following categories is a laptop computer classified? (1) Microcomputer (2) Minicomputer (3) Mainframe (4) Supercomputer

Introduction To Operating System

General purpose computers have become an important

Chapter1 Overview of computers

Transcription:

GE6151 - COMPUTER PROGRAMMING

UNIT I INTRODUCTION

What is Computer? Definition Computer System is an electronic data processing device which does the following: 1. Accept and store an input data. 2. Process the data input. 3. And output the processed data in required format. Functionalities of a computer Any digital computer carries out five functions in gross terms: 1. Takes data as input. 2. Stores the data/instructions in its memory and can use them when required. 3. Process the data and convert it into useful information. Output the information. Control all the above four steps.

Advantages 4. It can store any type of data such as images, videos, text, audio and any other type. High Speed 1. Computer is a very fast device. 2. It is capable of performing addition of very big data. 3. The computer has units of speed in microsecond, nanosecond and even the picosecond. 4. It can perform millions of calculations in a few seconds as compared to man who can spend many months for doing the same task. Accuracy 1. In addition to being very fast, computer are very accurate. 2. The computer has performed calculations 100% error free. 3. Computers perform all jobs with 100% accuracy. Storage Capability 1. Memory is a very important characteristic of computers. 2. The computer has much more storage capacity than human beings. 3. It can store large amount of data.

Diligence 1. Unlike human beings, a computer is free from monotony, tiredness and lack of concentration. 2. It can work continuously without creating any error and boredom. 3. It can do repeated work with same speed and accuracy. Versatility 1. A computer is a very versatile machine. 2. A computer is very flexible in performing the jobs to be done. 3. This machine can be used to solve the problems relating to various different fields. 4. At one instant, it may be solving a complex scientific problem and the very next moment it may be playing a card game. Reliability 1. A computer is a reliable machine. 2. Modern electronic components have failure free long lives. 3. Computers are designed to make maintenance easy.

Automation 1. Computer is a automatic machine. 2. Automation means ability to perform the task automatically. 3. Once a program is given to computer i.e stored in computer memory, the program and instruction can control the program execution without human interaction. Reduction in Paper Work 1. The use of computers for data processing in an organization leads to reduction in paper work and speeds up the process. 2. As data in electronic files can be retrieved as and when required,the problem of maintenance of large number of files gets reduced. Reduction in Cost 1. Though the initial investment for installing a computer is high but it substantially reduces the cost of each of its transaction.

Disadvantages Following list demonstrates the disadvantages of Computers in today's arena. No I.Q 1. A computer is a machine and has no intelligence of its own to perform any task. 2. Each and every instruction has to be given to computer. 3. A computer can not take any decision on its own. Dependency 1. It can perform function as instructed by user.so it is fully dependent on human being. Environment 2. The operating environment of computer should be dust free and suitable to it. No Feeling 1. Computer has no feeling or emotions. 2. It cannot make Judgement based on feeling, taste, experience and knowledge unlike a human being.

Computer - Applications Business The computer's characteristic as high speed of calculation, diligence,accuracy, reliability, or versatility has made it an integerated part in all business organisations. Computer used in business organisation for: 1. Payroll Calculations 2. Budgeting 3. Sales Analysis 4. Financial forcasting 5. Managing employees database Banking 6. Maintenance of stocks etc. 1. Today Banking is almost totally dependent on computer. 2. Banks provide following facilities: 3. Banks on-line accounting facility, which include current balances, deposits, overdrafts, interest charges, shares and trustee records. 4. ATM machines are making it even easier for customers to deal with banks.

Insurance Insurance companies are keeping all records up to date with the help of computer.the Insurance Companies, Finance houses and Stock broking firms are widely using computers for their concerns. Insurance Companies are maintaining a database of all clients with information showing 1. how to continue with policies 2. starting date of the policies 3. next due installment of a policy 4. maturity date 5. interests due 6. survival benefits 7. bonus

Education 1. The computer has provided a lot of facilities in the Education System. 2. The uses of computer provide a tool in the Education system is known as CBE (Computer Based Education). 3. CBE involves Control, Delivery and Evaluation of learning. 4. The computer education is very familiar and rapidly increasing the graph of computer students. 5. There are number of methods in which educational institutions can use computer to educate the students. 6. It is used for prepare a database about student performance and analysis are carried out. Marketing Advertising: With computers, advertising professionals create art and graphics, write and revise copy, and print and disseminate ads with the goal of selling more products. At Home Shopping: At home shopping has been made possible through use of computerised catalogues that provide access to product information and permit direct entry of orders to be filled by the customers.

Health Care Computers have become important part in all Medical Systems. The computers are being used in hospitals to keep the record of patients and medicines. It is also used in scanning and diagnosing different diseases. ECG, EEG, Ultrasounds and CT Scans etc. are also done by computerised machines. Some of major fields of health care in which computer are used: 1. Diagnostic System: Computers are used to collect data and identify cause of illness. 2. Lab-diagnostic System:All tests can be done and reports are prepared by computer. 3. Patient Monitoring System:These are used to check patient's signs for abnormality such as in Cardiac Arrest, ECG etc. 4. Pharma Information System:Computer checks Drug-Labels, Expiry dates, harmful drug side effects etc. Nowadays, computers are also used in performing surgery.

Military 5. Video-conferencing Computers are largely used in defence.modern tanks, missiles, weapons etc.employ computerised control systems.some military areas where a computer has been used are: 1. Missile Control 2. Military Communication 3. Military operation and planning 4. Smart Weapons Communication Communication means to convey a message, an idea, a picture or speech that is received and understood clearly and correctly by the person for whom it is meant.some main areas in this category are: 1. E-mail 2. Chatting 3. Usenet 4. FTP 5. Telnet

Government Applications Computers play an important role in government applications. Some major fields in this category are: 1. Budgets 2. Sales tax department 3. Income tax department 4. Male/Female ratio 5. Computerization of voters lists 6. Computerization of Driving Licensing system 7. Computerization of PAN card 8. Weather Forecasting. Computer Generations Generation in computer terminology is a change in technology a computer is/was being used. Initially, the generation term was used to distinguish between varying hardware technologies. But nowadays, generation includes both hardware and software, which together make up an entire computer system. There are totally five computer generations known till date. Each generation has been discussed in detail along with their time period, characteristics. We've used approximate dates against each generations which are normally accepted.

S.N. 1 2 3 4 5 Generation & Description First Generation The period of first generation : 1946-1959. Vaccum tube based. Second Generation The period of second generation : 1959-1965. Transistor based. Third Generation The period of third generation : 1965-1971. Integrated Circuit based. Fourth Generation The period of fourth generation : 1971-1980. VLSI microprocessor based. Fifth Generation The period of fifth generation : 1980-onwards.ULSI microprocessor based First Generation 1946-1959 The period of first generation was 1946-1959. First generation of computer started with using vacuum tubes as the basic components for memory and circuitry for CPU(Central Processing Unit). These tubes like electric bulbs produced a lot of heat and were prone to frequent fusing of the installations, therefore, were very expensive and could be afforded only by very large organisations.

In this generation mainly batch processing operating system were used. In this generation Punched cards, Paper tape, Magnetic tape Input & Output device were used. There were Machine code and electric wired board languages used. The main features of First Generation are: 1. Vacuum tube technology 2. Unreliable 3. Supported Machine language only 4. Very costly 5. Generate lot of heat 6. Slow Input/Output device 7. Huge size 8. Need of A.C. 9.Non portable 10. Consumed lot of electricity Some computer of this generation were: 1. ENIAC (ELECTRONIC NUMERICAL INTEGRATOR AND COMPUTER) 2. EDVAC (ELECTRONIC DISCRETE VARIABLE AUTOMATIC COMPUTER) 3. UNIVAC (UNIVERSAL AUTOMATIC COMPUTER) 4. IBM-701 (INTERNATION BUSINESS MACHINE 701) 5. IBM-650 (INTERNATION BUSINESS MACHINE 650)

Second Generation The period of second generation was 1959-1965. This generation using the transistor were cheaper, consumed less power, more compact in size, more reliable and faster than the first generation machines made of vaccum tubes.in this generation, magnetic cores were used as primary memory and magnetic tape and magnetic disks as secondary storage devices. In this generation assembly language and high level programming language like FORTRAN, COBOL were used. There were Batch processing and Multiprogramming Operating system used. The main features of Second Generation are: 1. Use of transistors 2. Reliable as compared to First generation computers 3. Smaller size as compared to First generation computers 4. Generate less heat as compared to First generation computers 5. Consumed less electricity as compared to First generation computers 6. Faster than first generation computers 7. Still very costly 7. A.C. needed 8. Support machine and assembly languages

Some computer of this generation were: 1. IBM 1620 (INTERNATION BUSINESS MACHINE 1620) 2. IBM 7094 (INTERNATION BUSINESS MACHINE 7094) 3. CDC 1604 (CONTROL DATA CORPORATION 1604) 4. CDC 3600 (CONTROL DATA CORPORATION 3600) 5. UNIVAC 1108 (UNIVERSAL AUTOMATIC COMPUTER - 1108) Third Generation The period of third generation was 1965-1971. The third generation of computer is marked by the use of Integrated Circuits (IC's) in place of transistors.a single I.C has many transistors, resistors and capacitors along with the associated circuitry.the I.C was invented by Jack Kilby. This development made computers smaller in size, reliable and efficient. In this generation Remote processing, Time-sharing, Real-time, Multi-programming Operating System were used. High level language (FORTRAN-II TO IV, COBOL, PASCAL PL/1, BASIC, ALGOL- 68 etc.) were used during this generation.

The main features of Third Generation are: 1. IC used 2. More reliable 3. Smaller size 4. Generate less heat 5. Faster 6. Lesser maintenance 7. Still costly 8. A.C needed 9. Consumed lesser electricity 10. Support high level language Some computer of this generation were: 1. IBM-360 series - (INTERNATIONAL BUSINESS MACHINE 360 SERIES) 2. Honeywell-6000 series 3. PDP - (PERSONAL DATA PROCESSOR) 4. IBM-370/168 - (INTERNATIONAL BUSINESS MACHINE 370/168) 5. TDC-316 (TORPEDO DATA COMPUTER 316) Fourth Generation The period of Fourth Generation was 1971-1980. The fourth generation of computers is marked by the use of Very Large Scale Integrated (VLSI) circuits.vlsi circuits having about 5000 transistors and other circuit elements and their

5. CRAY-X-MP(Super Computer) associated circuits on a single chip made it possible to have microcomputers of fourth generation. Fourth Generation computers became more powerful, compact, reliable, and affordable. As a result, it gave rise to personal computer (PC) revolution. were used. In this generation Time sharing, Real time, Networks, Distributed Operating System All the Higher level languages like C and C++, DBASE etc. were used in this generation. The main features of Fourth Generation are: 1. VLSI technology used 2. Very cheap 3. Portable and reliable 4. Use of PC's 5. Very small size 6. Pipeline processing 7. No A.C. needed 8. Concept of internet was introduced 9. Great developments in the fields of networks 10.Computers became easily available Some computer of this generation were: 1. DEC 10 - (DIGITAL EQUIPMENT CORPORATION 10) 2. STAR 1000 3. PDP 11 (PROGRAMMED DATA PROCESSOR 11) 4. CRAY-1(Super Computer)

Fifth Generation The period of Fifth Generation is 1980-till date. In the fifth generation, the VLSI technology became ULSI (Ultra Large Scale Integration) technology, resulting in the production of microprocessor chips having ten million electronic components. This generation is based on parallel processing hardware and AI (Artificial Intelligence) software. AI is an emerging branch in computer science, which interprets means and method of making computers think like human beings. All the Higher level languages like C and C++, Java,.Net etc. are used in this generation. AI includes: 1.Robotics 2. Neural networks 3. Game Playing 4. Development of expert systems to make decisions in real life situations. 5. Natural language understanding and generation.

The main features of Fifth Generation are: 1. ULSI technology 2. Development of true artificial intelligence 3. Development of Natural language processing 4. Advancement in Parallel Processing 5. Advancement in Superconductor technology 6. More user friendly interfaces with multimedia features 7. Availability of very powerful and compact computers at cheaper rates Some computer types of this generation are: 1. Desktop 2. Laptop 3. NoteBook 4. UltraBook 5. ChromeBook

CLASSIFICATION OF COMPUTER Computer can be broadly classified by their speed and computing power. Sr. No. 1 Type PC (Personal Computer) 2 WorkStation 3 Mini Computer 4 Main Frame Specifications Single user computer system. Moderately powerful microprocessor. Single user computer system. Similar to Personal Computer but have more powerful microprocessor. Multi-user computer system. Capable of supporting hundreds of users simultaneously. Multi-user computer system. Capable of supporting hundreds of users simultaneously. Software technology is different from minicomputer. An extremely fast computer which can perform hundreds of millions of 5 Supercomputer instructions per second. PC (Personal Computer) A PC can be defined as a small, relatively inexpensive computer designed for an individual user. PCs are based on the microprocessor technology that enables manufacturers to put an entire CPU on one chip. Businesses use personal computers for word processing, accounting, desktop publishing, and for running spreadsheet and database management applications. At home, the most popular use for personal computers is for playing games and surfing the Internet.

Although personal computers are designed as single-user systems, these systems are normally linked together to form a network. In terms of power, now-a-days High-end models of the Macintosh and PC offer the same computing power and graphics capability as low-end workstations by Sun Microsystems, Hewlett-Packard, and DELL. WorkStation Workstation is a computer used for engineering applications (CAD/CAM), desktop publishing, software development, and other such types of applications which require a moderate amount of computing power and relatively high quality graphics capabilities. Workstations generally come with a large, high-resolution graphics screen, large amount of RAM, inbuilt network support, and a graphical user interface. Most workstations also have a mass storage device such as a disk drive, but a special type of workstation, called a diskless workstation, comes without a disk drive. Common operating systems for workstations are UNIX and Windows NT. Like PC, Workstations are also single-user computers. However, workstations are typically linked together to form a local-area network, although they can also be used as stand-alone systems.

Minicomputer It is a midsize computer. A minicomputer is a multi-processing system capable of supporting from up to 250 users simultaneously. Mainframe Mainframe is a very large in size and is an expensive computer capable of supporting hundreds, or even thousands, of users simultaneously. Mainframe executes many programs concurrently. Mainframes support many simultaneous programs execution. Supercomputer Supercomputers are one of the fastest computers currently available. Supercomputers are very expensive and are employed for specialized applications that require immense amounts of mathematical calculations (number crunching). For example, weather forecasting, scientific simulations, (animated) graphics, fluid dynamic calculations, nuclear energy research, electronic design, and analysis of geological data (e.g. in petrochemical prospecting).

Comparison between different types Computers

BASIC ORGANIZATION OF COMPUTER All types of computer follows a same basic logical structure and perform the following five basic operations for converting raw input data into information useful to their users Sr. No. Operation Description 1 Take Input The process of entering data and instructions into the computer system. 2 Store Data Saving data and instructions so that they are available for processing as and when required. 3 Processing Data 4 Output Information 5 Control the workflow Performing arithmetic, logical operations on data in order to convert them into useful information. The process of producing useful information or results for the user,such as a printed report or visual display. Direct the manner and sequence in which all of the above operations are performed.

Input Unit This unit contains devices with the help of which we enter data into computer. This unit makes link between user and computer. The input devices translate the human being information into the form understandable by computer. Following are few of the important input devices which are used in Computer Systems 1. Keyboard 2. Mouse 3. Joy Stick 4. Light pen 5. Track Ball 6. Scanner 7. Graphic Tablet 8. Microphone 9. Magnetic Ink 10. Card Reader(MICR) 11. Optical Character Reader(OCR) 12. Bar Code Reader 13. Optical Mark Reader CPU Unit 1. Memory Or Storage Unit: 2. Control Unit 3. ALU(Arithmetic Logic Unit)

Memory Or Storage Unit: 1. This unit can store instruction, data and intermediate results. This unit supplies information to the other units of the computer when needed. It is also known as internal storage unit or main memory or primary storage or Random access memory(ram). 2. Its size affects speed, power and capability. There are primary memory and secondary memory two types of memories in the computer. Function of Memory Unit are: 3. It stores all the data to be processed and the instructions required for processing. 4. It stores intermediate results of processing. 5. It stores final results of processing before these results are released to an output device. 6. All inputs and outputs are transmitted through main memory. Control Unit This unit controls the operations of all parts of computer. It does not carry out any actual data processing operations. Functions of this unit are 1. It is responsible for controlling the transfer of data and instructions among other units of a computer.

2. It manages and coordinates all the units of the computer. 3. It obtains the instructions from the memory, interprets them and directs the operation of the computer. 4. It communicates with Input/Output devices for transfer of data or results from storage. 5. It does not process or store data. ALU(Arithmetic Logic Unit) This unit consists of two subsection namely 1. Arithmetic section 2. Logic Section 1. Arithmetic section Function of Arithmetic section is to perform arithmetic operations like addition, subtraction, multiplication and division. All complex operations are done by making repetitive use of above operations. 2. Logic Section Function of logic section is to perform logic operations such as comparing, selecting, matching and merging of data.

Output Unit Output unit consists of devices with the help of which we get the information from computer. This unit is a link between computer and users. Output devices translate the computer's output into the form understandable by users. Following are few of the important output devices which are used in Computer Systems 1. Monitors 2. Graphic Plotter 3. Printer NUMBER SYSTEM When we type some letters or words, the computer translates them in numbers as computers can understand only numbers. A computer can understand positional number system where there are only a few symbols called digits and these symbols represent different values depending on the position they occupy in the number. A value of each digit in a number can be determined using The digit 1. The position of the digit in the number 2. The base of the number system (where base is defined as the total number of digits available in the number system).

Common Number Systems System Base Symbols Used by humans? Used in computers? Decimal 10 0, 1, 9 Yes No Binary 2 0, 1 No Yes Octal 8 0, 1, 7 No No Hexadecimal 16 0, 1, 9, A, B, F No No Quantities/Counting Decimal Binary Octal Hexadecimal 0 0 0 0 1 1 1 1 2 10 2 2 3 11 3 3 4 100 4 4 5 101 5 5 6 110 6 6 7 111 7 7 Decimal Binary Octal Hexadecimal 8 1000 10 8 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F Decimal Binary Octal Hexadecimal 16 10000 20 10 17 10001 21 11 18 10010 22 12 19 10011 23 13 20 10100 24 14 21 10101 25 15 22 10110 26 16 23 10111 27 17

Conversion Among Bases Decimal to Decimal Weight Decimal 125 10 => 5 x 10 0 = 5 2 x 10 1 = 20 1 x 10 2 = 100 125 Base

Binary to Decimal Decimal Binary Octal Hexadecimal Technique 1. Multiply each bit by 2 n, where n is the weight of the bit 2. The weight is the position of the bit, starting from 0 on the right 3. Add the results Example Bit 0 101011 2 => 1 x 2 0 = 1 1 x 2 1 = 2 0 x 2 2 = 0 1 x 2 3 = 8 0 x 2 4 = 0 1 x 2 5 = 32 43 10 Sum of Weights Methods

Octal to Decimal Decimal Binary Octal Hexadecimal Example 724 8 => 4 x 8 0 = 4 2 x 8 1 = 16 7 x 8 2 = 448 468 10 Technique 1. Multiply each bit by 8 n, where n is the weight of the bit 2. The weight is the position of the bit, starting from 0 on the right 3. Add the results Sum of Weights Methods Hexa Decimal to Decimal Decimal Binary Octal Hexadecimal Technique 1. Multiply each bit by 16 n, where n is the weight of the bit 2. The weight is the position of the bit, starting from 0 on the right 3. Add the results

Example ABC 16 => C x 16 0 = 12 x 1 = 12 B x 16 1 = 11 x 16 = 176 A x 16 2 = 10 x 256= 2560 Sum of Weights Methods Decimal to Binary Decimal Binary Example Octal 2748 10 Hexadecimal Technique 1. Divide by two, keep track of the remainder 2. First remainder is bit 0 (LSB, leastsignificant bit) 3. Second remainder is bit 1 4. Etc. Repeated Division by 2 method

Octal to Binary Example Decimal Binary Octal Hexadecimal Technique 1. Convert each octal digit to a 3-bit equivalent binary representation 705 8 =? 2 7 0 5 Hexa decimal to Binary 111 000 101 705 8 = 111000101 2 Decimal Binary Octal Hexadecimal Technique 1. Convert each hexadecimal digit to a 4-bit equivalent binary representation

Example 10AF 16 =? 2 1 0 A F Decimal to Octal 0001 0000 1010 1111 10AF 16 = 0001000010101111 2 Example Decimal Binary Octal Hexadecimal Technique 1. Divide by 8 2. Keep track of the remainder Repeated Division by 8 method

Decimal to Hexa - decimal Decimal Binary Octal Hexadecimal Technique 1. Divide by 16 2. Keep track of the remainder Example Repeated Division by 16 method

Binary to Octal Decimal Binary Octal Hexadecimal Technique 1. Group bits in threes, starting on right 2. Convert to octal digits Example 1011010111 2 =? 8 1 011 010 111 1 3 2 7 1011010111 2 = 1327 8 Binary to Hexa - Decimal Decimal Binary Octal Hexadecimal Technique 1. Group bits in fours, starting on right 2. Convert to hexadecimal digits

Example 1010111011 2 =? 16 10 1011 1011 Octal to Hexa - Decimal 2 B B 1010111011 2 = 2BB 16 Decimal Octal Technique Use binary as an intermediary Binary Hexadecimal Example

Hexa Decimal to Octal Decimal Binary Octal Hexadecimal Technique Use binary as an intermediary Example

PROBLEM SOLVING TECHNIQUES 1. ALGORITHM 2. FLOWCHART 3. PSEUDO CODE

ALGORITHM a step-by-step method for solving a problem or doing a task. THREE CONSTRUCTS Computer scientists have defined three constructs for a structured program or algorithm. The idea is that a program must be made of a combination of only these three constructs: sequence, decision (selection) and repetition. It has been proven there is no need for any other constructs. Using only these constructs makes a program or an algorithm easy to understand, debug or change.

Sequence The first construct is called the sequence. An algorithm, and eventually a program, is a sequence of instructions, which can be a simple instruction or either of the other two constructs. Decision Some problems cannot be solved with only a sequence of simple instructions. Sometimes we need to test a condition. If the result of testing is true, we follow a sequence of instructions: if it is false, we follow a different sequence of instructions. This is called the decision (selection) construct. Repetition In some problems, the same sequence of instructions must be repeated. We handle this with the repetition or loop construct. Finding the largest integer among a set of integers can use a construct of this kind.

Algorithm Examples Example : 1 (Sequence) To write a algorithm to find the area and circumference of the circle. ALGORITHM: Step-1 Step-2 Step-3 Step-4 Step-5 Start the program. Input the radius of the circle. Find the area and circumference of the circle using the formula Area=3.14*r*r Circumference=2*3.14*r Print the area and the circumference of the circle Stop

Example : 2 (Decision) To write a program to find the roots of the quadratic equation. ALGORITHM: Step-1 Step-2 Step-3 Step-4 Step-5 Step-6 Start the program Enter the value of a, b, c Find the value of d by using the formula D=b*b-4*a*c If D is greater then or equal to zero then find the two roots as root1=(-b+sqrt(d))/(2*a); root2=(-b-sqrt(d))/(2*a); Print the two roots If the D is not greater then or equal to zero then print the statement the roots are imaginary. Stop

Example : 3 (Iterative) To write a program to find the factorial of the given number ALGORITHM: Step-1 Step-2 Step-3 Step-4 Step-5 Start the program Enter a number Set a loop to find the factorial of the given number using the formula Fact=Fact*I Print the factorial of the given number Stop

FLOWCHART 1. The flowchart is a diagram which visually presents the flow of data through processing systems. 2. This means by seeing a flow chart one can know the operations performed and the sequence of these operations in a system. 3. Algorithms are nothing but sequence of steps for solving problems. So a flow chart can be used for representing an algorithm. 4. A flowchart, will describe the operations (and in what sequence) are required to solve a given problem. 5. You can see a flow chart as a blueprint of a design you have made for solving a problem. For example, Suppose you are going for a picnic with your friends then you plan for the activities you will do there. If you have a plan of activities then you know clearly when you will do what activity. Similarly when you have a problem to solve using computer or in other word you need to write a computer program for a problem then it will be good to draw a flowchart prior to writing a computer program. Flowchart is drawn according to defined rules.

Flowchart Symbols There are 6 basic symbols commonly used in flowcharting of assembly language Programs: Terminal, Process, input/output, Decision, Connector and Predefined Process. This is not a complete list of all the possible flowcharting symbols, it is the ones used most often in the structure of Assembly language programming.

General Rules for flowcharting 1. All boxes of the flowchart are connected with Arrows. (Not lines) 2. Flowchart symbols have an entry point on the top of the symbol with no other entry points. 3. The Decision symbol has two exit points; these can be on the sides or the bottom and one side. 4. Generally a flowchart will flow from top to bottom. However, an upward flow can be shown as long as it does not exceed 3 symbols. 5. Connectors are used to connect breaks in the flowchart. Examples are: From one page to another page. From the bottom of the page to the top of the same page. An upward flow of more then 3 symbols 6. Subroutines and Interrupt programs have their own and independent flowcharts. 7. All flow charts start with a Terminal or Predefined Process (for interrupt programs or subroutines) symbol. 8. All flowcharts end with a terminal or a contentious loop.

Some examples of Flowcharts Example 1: Find the area of a circle of radius r.

Example 2: Convert temperature Fahrenheit to Celsius.

Example 4: Algorithm for find the greater number between two numbers.

Example 5: Flowchart for the problem of printing even numbers between 9 and 100:

Advantages of using Flowcharts program. Writing code referring the flowchart of the solution become easy. 1) Communication: A Flowchart can be used as a better way of communication of the logic of a system and steps involve in the solution, to all concerned particularly to the client of system. 2) Effective analysis: A flowchart of a problem can be used for effective analysis of the problem. 3) Documentation of Program/System: Program flowcharts are a vital part of a good program documentation. Program document is used for various purposes like knowing the components in the program, complexity of the program etc. 4) Efficient Program Maintenance: Once a program is developed and becomes operational it needs time to time maintenance. With help of flowchart maintenance become easier. 5) Coding of the Program: Any design of solution of a problem is finally converted into computer

Flowchart Advantages Standardized Visual Flowchart Disadvantages: Hard to modify Structured design elements not implemented Special software required

PSEUDO CODE

INTRODUCTION 1. Flowcharts were the first design tool to be widely used, but unfortunately they do not reflect some of the concepts of structured programming very well. 2. Pseudo code, on the other hand, is a newer tool and has features that make it more reflective of the structured concepts. 3. The drawback is that the narrative presentation is not as easy to understand and/or follow. Rules for Pseudo Code 1. Write only one statement per line 2. Capitalize initial keyword 3. Indent to show hierarchy 4. End multiline structures 5. Keep statements language independent

1. One Statement Per Line Each statement in pseudocode should express just one action for the computer. If the task list is properly drawn, then in most cases each task will correspond to one line of pseudocode. Task List Read name, hours worked, rate of pay Perform calculations gross = hours worked * rate of pay Write name, hours worked, gross Pseudocode READ name, hoursworked, payrate gross = hoursworked * payrate WRITE name, hoursworked, gross 2. Capitalize Initial Keyword In the example below note the words: READ and WRITE. These are just a few of the keywords to use, others include: READ, WRITE, IF, ELSE, ENDIF, WHILE, ENDWHILE Pseudocode READ name, hoursworked, payrate gross = hoursworked * payrate WRITE name, hoursworked, gross

3. Indent to Show Hierarchy Each design structure uses a particular indentation pattern Sequence: Keep statements in sequence all starting in the same column Selection: Indent statements that fall inside selection structure, but not the keywords that form the selection Loop: Indent statements that fall inside the loop but not keywords that form the loop READ name, grosspay, taxes IF taxes > 0 net = grosspay taxes ELSE net = grosspay ENDIF WRITE name, net

4. End Multiline Structures READ name, grosspay, taxes IF taxes > 0 net = grosspay taxes ELSE net = grosspay ENDIF WRITE name, net See the IF/ELSE/ENDIF as constructed above, the ENDIF is in line with the IF. The same applies for WHILE/ENDWHILE etc 5. Language Independence Resist the urge to write in whatever language you are most comfortable with, in the long run you will save time. Remember you are describing a logic plan to develop a program, you are not programming!

The Selection Structure yes amount < 100 no interestrate =.06 interestrate =.10 Pseudocode IF amount < 100 interestrate =.06 ELSE Interest Rate =.10 ENDIF

The Looping Structure In flowcharting one of the more confusing things is to separate selection from looping. This is because each structure use the diamond as their control symbol. In pseudo code we avoid this by using specific keywords to designate looping WHILE / ENDWHILE WHILE/ENDWHILE REPEAT/UNTIL Start count = 0 count = 0 WHILE count < 10 ADD 1 to count WRITE count ENDWHILE WRITE The End count <10 add 1 to count write count Write The End Stop

REPEAT / UNTIL Start count = 0 add 1 to count write count count = 0 REPEAT ADD 1 to count WRITE count UNTIL count >= 10 WRITE The End count <10 Write The End Stop

Rules for Variable Names 1. Begin with lowercase letter 2. Contain no spaces 3. Additional words begin with capital 4. Unique names within code 5. Consistent use of names Working with Fields Calculations Selection + add - subtract * multiply / divide ** or ^ exponentiation ( ) grouping > greater than < less than = equal to >= greater than or equal to <= less than or equal to <> not equal to

Advantages and Disadvantages Pseudo code Advantages Easily modified Implements structured concepts Done easily on Word Processor Pseudo code Disadvantages: Not visual No accepted standard, varies from company to company