Tuesday, May 10, 2011

COMPUTER PROGRAMMING: FUNDAMENTALS PART1

INTRODUCING PROGRAMMING LANGUAGES

A language is a means of communication between people. Similarly, a programming language is a means of communication between a programmer and a computer. A programmer writes a set of instructions in a programming language to instruct the computer to perform a task. A set of logically related instructions is called a program.
Every language is nothing but a collection of words and symbols, which are understood by users of the language. This collection of words and symbols is called the vocabulary of a language.
The vocabulary of a programming language is not as vast as the vocabulary of a commonly spoken communication language. Like any other communication language, all programming languages have a set of rules, called the syntax of the language.
Programming languages can be classified into three broad categories:
·         Machine language                                             
·         Assembly language
·         High-level language
As stated earlier, a program written in any programming language is a set of logically related instructions. These instructions have two parts, as shown in the following figure:
Format Of A Programming Language

·         Operation code (opcode): This part instructs a computer about the operation to be performed.
·         Operand: This part instructs the computer about the location of the data on which the operation specified by the opcode is to be performed.
For example, in the instruction Add A and B, Add is the Opcode and A and B are operands. 
Each computer has its own set of opcode. The opcode in the instruction set can perform the following operations:
·         Logical operations: These operations involve the comparison of data and the result is either True or False.
·         Arithmetic operations: These operations involve mathematical calculations.
·         Branch operations: These operations involve transfer of control a memory location given in an operand field.
·         Data movement operations: These operations involve data transfer between the memory and the processor or between the input/output devices and the computer.

It must be understood here that the objective of writing a program is to generate the predefined output with the use of computers. However, programs can be long and complex. There are tools available to programmers that help them minimize the time taken to get a program up and running. Depending on the standards followed by their organization, programmers use flowcharts or pseudocode during the planning phase of problem solving. There are also specialized tools available for representing complex logic like decision tables and decision trees.
     

No comments:

Post a Comment