Senin, 28 Februari 2011

Madhu Sharma

We have said that computer is not an intelligent machine. We need to issue it a detailed sequence of instructions that it needs to follow to operate upon any data. Such a sequence is called Program. A program may directly be written to the RAM or may be stored in some form of secondary memory

It may be transferred from the secondary memory to RAM as and when required. The control unit then fetches the program step by step from the memory and executes it. Execution of a program means that data is moved around the CPU according to a well detailed sequence given by a program. At the most basic level, any program is made of several statement made of binary digits. We will take for granted that the computer is familiar with what it is expected to do when it encounters a particular instruction in the binary form. Some programs, like those that tell a computer what it should do once the power is turned on, must be permanently resident on the computer; such programs are stored in the ROM or EPROM.

Computer programs are written using special languages called PROGRAMING LANGUAGES. There are several programming languages. Each language has its own ‘grammar’ called its syntax. 

Types of Programming languages

Computer languages are essentially of two kinds: low-level and high-level. In low level languages, programmers issue a detailed sequence of instructions to precisely control the flow of data through the components of the computer. If a number must be brought from the memory to the ALU, the programmer would have to give a detailed instruction to do so. To program in low-level languages, programmers must, therefore, be familiar with how the CPU is organized. Machinr Language and the Assembly Language are examples of low-level languages. Instructions in machine language are usually written in binary or decimal form. In case of decimal form, the input unit must convert it to the binary form. It is usually difficult to remember complex instruction in the form of several digits. The assembly language solves this problem by giving simple three or four letter English words called Mnemonics for some common instructions written in the binary form. A special program called Assembler converts all instructions into the binary format.

High-level languages are very different. These languages enable programmers to use conventional English terms and Mathematical symbols to write all instructions. An instruction to add two numbers could simply be written as ‘A= 4+5’. The next statement could be ‘Write A’. Because all such instructions must finally be converted to the binary form, all high-level languages have their own translations program called Compilers or Interpreter. Compilers convert the entire program into a binary form, while interpreters convert and execute program statements one by one. Examples of popular high-level languages are C, C++, JAVA, PASCAL, FORTRAN etc.