Computer program is a set of instructions that makes the computer/hardware to perform a set of particular task in order. Without Programs, computers are useless and can not perform any operations.
To instruct a computer to perform a certain job , we need a language which can be understand by the computer. The language which are used to instruct the computer to do certain jobs are called Computer Programming Languages.
Some of the programming languages are C,C++, Java, Python etc.
The process of writing, testing, debugging/troubleshooting, and maintaining the source code is called computer programming.
The person who writes the program is called the programmer.
Level of Programming Language
The programming language level is divided into three levels: machine language, assembly language, and high-level programming language
Low Level Programming Language
In Low level programming language each instruction is directly translated into a single machine code.
It is machine dependent – Only work for a certain machine
Machine Level Language
machine language is computer understandable language which consist only binary number (0 and 1)
Machine language is a sequence of instruction written in the form of binary numbers consisting of 1’s and 0’s to which the computers respond directly.
The advantage of machine language is that they execute fast as the computer understands them and doesn’t need translation into other forms.
Disadvantage:
- It is machine Dependent
- It is Difficult to write
- Difficult to remember different machine codes for different operations.
Example :
To add two numbers 3 and 6 in machine language like :
11 10111001 110
3 (machine code for addition ) 6
Assembly Language
Assembly language is a symbolic representation (called mnemonics) of machine code.
The assembly languages program must be translated into machine code by a separate program called an assembler.
The assembler program recognizes the character strings that make up the symbolic names of the various machine operations and substitutes the required machine code for each instructions.
To add two numbers 3 and 6 in assembly language :
11 add 110
Sum of the Examples of instructions for assembly language are as follows.
Code | Meaning |
ADD | Addition |
SUB | Subtraction |
INR | Increase |
DCR | Decrease |
CMP | Compare |
Advantage :
Writing a program in assembly language is more convenient than writing in machine Language
Program Written in the form of symbolic instruction
It is useful writing program in embedded system because it needs fewer codes than high level language
It is also useful for device programming
Disadvantage:
Hard to Remember mnemonics
Machine Dependent
Less efficient than machine language – translated into machine language before execution
High Level Language
High level programing is a more user friendly and to some extent platform independent. It is similar to natural language and so are easy to remember and write.
High level languages are easy to learn and work but while executing they have to be translated into to machine language.
It is slow in execution but efficient for Developing Programs
C,C++,C#, Java, Python are the example of High level language.
Advantages
- Easy to understand and use
- Portability- can be run in different machine with little or no change.
- Easy in Debugging – Error can be easily detected and removed
- Fast Development of Software – Commands of these language are similar closer to English language.
Disadvantages
- It Required more execution time
- Need own translator to translate high-level language to low-level language.
Compiler and Interpreter
Compiler and Interpreter are language translator which translate the high level language into a Machine level language.
Difference between compiler and interpreter
Compiler | Interpreter |
Compiler scans the entire program before translating it into machine code | Interpreter translates and executes the program line by line. |
Syntax errors are found only after the compilation of complete program. | Syntax errors can be found after translation of every line. |
It takes less execution time | It takes more execution time. |
CPU utilization is more. | CPU utilization is less as compared to the compiler. |
C, C++, C# etc. | Python, MATLAB |