After reading this article you will learn about the high level and low level computer languages.
Low Level Language:
Low level languages are more compatible with the hardware of the computer and consist of binary or Mnemonic codes. Thus, low level languages are better understood by the computer in a better manner.
(a) Machine Language:
Machine language is the language which is directly understood by the computer. Machine language is the lowest form of computer language. When first generation computers were introduced, programs were written only in binary based machine level language. This is the only language actually understood by the computer. Since human programmers are more familiar with the decimal system (rather than the binary system), most of them preferred to write instructions in decimal and leave the input device to convert these to binary.
To understand the structure of a machine code or machine language two facts need to be understood. The first, is that a machine instruction has a two-part format (Fig. 36.31). The second point is that both parts are represented internally in the machine’s store as a string of binary digits.
Thus, a machine language instruction may look like 563603 where 56 is, for example, the operation aide for addition and 3603 is the address of the memory location where the number to be added is stored. The instruction is, of course, stored in a memory location in a binary representation.
The main difficulty in utilising machine language lies in the fact that one has to memorise the codes for all sorts of operations as well as the elocution numbers and addresses of all memory boxes. The stupendous task can well be imagined by the fact that a program may consist of more than 100 different operations (instructions) and also hundreds or thousands of locations in memory.
(b) Assembly Language:
Assembly language is also known as Symbolic language. Like machine language, it also being oriented towards the basic design of computers, is called low level language. Considering the difficulties encountered with the machine language, the assembly languages were developed in 1950’s and were introduced in the second generation computers. In Assembly language, the idea of mnemonics (or memory aids) was introduced.
The human mind can more easily identify with mnemonics or abbreviated words such as MULT for multiply, DIV for division etc., than (a series of digits, for example, a computer may be designed to interpret) the machine code 1001 (binary) or 09 (decimal) as the operation-multiply.
This, though, made the life easier for the programmer, it made things more involved for the computer. The abbreviated words such as MULT, DIV, SUB, ADD, STO (store) etc. have to be translated into the binary pattern before the computer can understand the operation intended.
This act of translating is carried out by a special pre-stored program called an assembler. In other words, the software aid that translates the symbolic language program into a machine language-object program is called the assembler program or assembler. Assembler translates the program written by the programmer into that version which the computer/machine recognizes and responds to, and assembles it in the main memory, ready for execution.
The assembly language program prepared by the user is called source program. This source program acts as an input to the assembler, which is loaded to the computer’s memory. Then the assembler performs the translation and generates the equivalent machine code, which is called as the object program or object code.
In a typical computer system, the assembler program is stored on paper tape, magnetic tape or a disk. When it is needed, the assembler is called up from secondary storage and loaded into RAM (Random Access Memory, usually on a chip). The source program is then entered by the user via the terminal and is also stored in RAM.
The assembler translates the source program into object code and stores it in another portion of RAM. The object code or program is then stored on some external media. In this way, the program can be retrieved and executed again and again when needed.
High Level Languages:
High level languages look similar to the Englidh language, and hence are better understood by the programmers rather than the computers.
(a) Fortran:
The commercial viability and wider use of computers led by the mid-1950s, to the necessity for, and development of higher level languages. Higher level languages, instead of being machine based, are orientated more towards the problem to be solved.
Such problem-oriented languages (such as Fortran) enable the programmer to write instructions using certain English words and conventional mathematical notations, therefore making it easier for the programmer to think about the problem.
The first available high-level language was FORTRAN developed in 1956 for use on an IBM 704 Computer. Its primary purpose was to solve mathematical and scientific problems which were allowed to be written in a simple English style with the mathematical expressions stated naturally e.g., A = B + C — D.
During the middle 1960s, it became widely used on a number of machines resulting in a variety of dialects, the most important being IBM FORTRAN II and IBM FORTRAN IV. By 1962, the American Standards Institute (ASA) set up a working committee to produce a specification for the language.
Two versions were finally approved in March 1966, ASA FORTRAN (similar to IBM FORTRAN IV) and ASA BASIC FORTRAN (similar to IBM FORTRAN II). A new standard FORTRAN, called FORTRAN 77, was defined in 1977. The latest in the field is FORTRAN 86.
The fortran language, the name being an abbreviation of the two words formula translation is a problem-oriented programming language. Fortran is extensively used throughout the world. Because it resembles familiar arithmetical language, it greatly simplifies the preparation of problems for machine computation.
Data and instructions may be organized in the form of a sequence of fortran statements. This is the source program. The fortran compiler, also called the translator or processor, then analyzes these statements and translates them into an object program in machine language. A program written in fortran language can be processed on any machine which has a fortran compiler. In this sense the language is machine independent.
However, the compiler must in each case be prepared with the particular machine in mind. Because machines do differ in their internal organization, a number of dialects of Fortran have developed, each dialect being suited to a class of machines. The differences between dialects are not severe and one easily adjusts from one to another. The dialect to be presented here is known as Fortran IV.
The alphabet of Fortran includes the following characters:
From this alphabet all our symbols, expressions and statements in Fortran language are to be constructed.
(b) Cobol:
COBOL implies Common Business Oriented Language. Work on a common source language suitable to commercial (as opposed to scientific) data processing began in 1959. A committee composed of several large users, the federal government, computer manufacturers, and other interested parties was formed to develop the language. The CODASYL (Conference on Data Systems Languages) Committee developed the specifications for a language named COBOL.
Their report, issued in April 1960, contained the first version of COBOL, called COBOL 60. Subsequent revisions of this language were published in 1961 (COBOL-61), 1963 (COBOL-61 Extended), and 1965. COBOL has been established as a standard language by the American National Standards Institute (ANSI). ANSI released a new standard-ANSI C-OBOL85 which includes many concessions to modern thinking. CIS-COBOL (Compact, Interactive Standard) is used on personal computers.
Lateral versions also include powerful debugging aids to speed up interactive development of COBOL programs. COBOL is a higher-order language oriented towards commercial data processing procedures. Data processing is the processing of information, specifically business type information, by computer. COBOL is a procedure-oriented language designed for coding business data processing problems.
These types of problems are characterized by the use of large files (organised collection of records having a common feature or purpose), a high volume of input and output, and production of report output requiring editing and formatting of output data. COBOL looks and reads like ordinary business English. The programmer uses English words and conventional arithmetic symbols to direct and control the complicated operations of the computer.
Like all procedure oriented programming languages, COBOL requires a source language for coding instructions and a compiler to convert the source program into a machine language object program. Although the source language is common, the compiler is unique for each computer.
The following are typical COBOL sentences:
Multiply Quantity by Price Giving Total Price Add Sales to 600 Giving Total:
The COBOL compiler translates these instructions into machine language and the machine language program thus generated is known as object program.
A COBOL program consists of four parts or divisions as named below:
(c) Pascal:
PASCAL (not an acronym, but named after the great Frenchman) is a high level language. It was originally designed by Nicklaus Wirth in 1968, belongs to the ALGOL stable and the first operational compiler became available in 1970. One of its more important features is to allow the programmer to structure data in his way.
Pascal was developed as a teaching aid to students of programming, but has expanded rapidly that it is now used in business and scientific applications. Pascal is relatively easy to learn. Pascal is available on micro-computers. Compared to other languages like FORTAN, Pascal has poor input/output capabilities.
(d) Basic:
BASIC implies Beginners All-purpose Symbolic Instruction Code. BASIC was developed in 1963-64 at Darmouth College in the U.S.A, under the directions of Professor John Kemeny and Thomas Kurtz for use on a times haring system. Since then it has been used in a number of computers and applications. Most of the present day micro and home computers and graphics terminals use only BASIC language.
To understand BASIC it is not necessary to learn complex programming techniques. It is, in fact, intended for those who have no experience with using computers or writing computer programs. BASIC has few grammatical rules and can be said to be user rather than system orientated. It resembles FORTRAN in many respects, making use of standard mathematical notation, but serves business applications equally well.
BASIC can be learnt in a few hours concentrated study and, though simple, it is flexible and reasonably powerful. Because of its simplicity and bias towards the user, BASIC is a language well suited for use in education and has become extremely popular with micro computer users. The disadvantages of BASIC is that it is limited in scope. There are no standards for the BASIC language but the Darmouth specifications form the generally agreed-upon heart of the language.
The major application of BASIC is in Time Sharing in which the programmer user has a type writer device such as a Teletype. Programs are typed and transmitted line by line to the computer. After the program is received, it is executed and the results are typed on the typewriter. The typewriter may also have a punched paper tape input and output.
This allows a program to be prepared offline (without being connected to the computer) by punching into a tape. The punched paper tape is then transmitted to the computer, saving online connection time. BASIC is available on some computers for regular batch compilation from cards, but this use of BASIC is much less common than its use as a time sharing language.