INSTRUCTION

Basic commands that tell the computer processor to do something are called instructions.

PROGRAM [2] [072] [074]

A collection of instructions written to solve a particular problem is called program. A program is like a recipe, which contains a list of ingredients (called variables) and a list of directions (called statements) that tell the computer what to do with those variables.

PROGRAMMING [1] [2074]

Process of writing instructions using a programming language is called programming or coding.

PROGRAMMING LANGUAGE [2] [071] [073]

We humans use natural language such as English, Nepali, Newari etc to communicate our ideas and emotions to others. Similarly a programmer uses programming language to communicate with the computer. Programming Language is the standardized communication technique between a computer and a human being. Each programming language has a set of syntactic and semantic rules used to define computer programs.



1. LOW LEVEL LANGUAGES
Low-level languages are closer to the computer hardware.

Low-level language is of 2 types

a. Machine languages / Machine code (1st GL)
The language in which programs are written in binary code (composed of 0 and 1) is called Machine language and it is the only one language that the processor directly understands.

b. Assembly languages (2nd GL)
The language in which programs are written in mnemonics (short codes) like ADD, SUB, MUL, etc. instead of writing instruction in binary numbers (0 and 1) is called Assembly language. Computer viruses are mostly written in this language.

2. HIGH LEVEL LANGUAGES
High-level languages are similar to natural language (human language) [068]. It is so called because functions used in high level programming languages are similar to the words that we use in natural language.

For example, to print the content in a standard output device (like monitor) we use printf() in C programming language, which is similar to printing a document from a printer that we may use in natural language. Also to represent integer (whole number, i.e. not a fractional number, that can be +ve, –ve or zero) variables, we use ‘int’ keyword which is also close to natural language. Program written in high-level languages are translated into machine language by a language translator called a compiler or an interpreter.

High-level language is of 3 types [4] [068] [067]

a. Procedural oriented languages (3rd GL)
Language that follows step-by-step instruction to solve a particular problem is known as procedural language. Therefore it mainly focuses on writing the algorithm before coding. In procedural oriented languages, program is divided into small parts, where each part is called a function. In procedural oriented languages, importance is not given to data but to functions. Procedural oriented languages follows the Top Down approach. Most functions use Global data for sharing, which can be accessed freely from function to function.
They don’t have data hiding options.
Example: C, FORTRAN, Pascal

b. Problem oriented languages(4th GL)
These languages are non-procedural languages which allow the user to specify what the output should be, without describing all the details of how the data should be manipulated to produce the result. They are result oriented, and need a translator like an interpreter or a compiler. Their main objective is to increase the speed of developing programs.
Examples: MATLAB, Oracle, MySQL, MS-SQL

c. Natural languages(5th GL)
Natural languages are still in the developing stage. On completion, we would be able to write statements that would look like normal sentences. They are designed to make computers solve problems without a programmer. They are used in the areas of research, robotics, defense system and different types of expert systems.
Examples are LISP, PROLOG, Mercury

LOW LEVEL LANGUAGES VS. HIGH LEVEL LANGUAGES[4] [073] [069]

Low Level Languages High Level Languages
Advantages Execution Speed Execute faster than high level language. Execute slower than low level language.
Translation Machine language does not need any translation.
Assembly language needs an Assembler to translate an Assembly language code into Machine code.
Required translation is done by compilers or interpreters.
Memory Require less memory space. Since it uses compilers and interpreters, they require large memory space.
Disadvantages Machine Dependencies Very machine dependent, i.e. a machine code written for Intel processor doesn't work for Motorola processor. Machine independent, i.e, program in one processor easily runs on another processor also.
Easiness Difficult to learn, which in turn requires sound knowledge of computer architecture. Easier to learn because it is similar to English language.
Debugging Debugging is tough and difficult. Finding and correcting errors in high level language is easy.
Example Mnemonics code is used in 8085 and 8086 microprocessor. FORTRAN is the first high-level language. C, C++, .NET, JAVA are other examples.

GENERATION OF PROGRAMMING LANGUAGE [4] [069][070][072][073]

1st Generation Programming Language (1940-1950)

Machine Language

2nd Generation Programming Language (1950-1958)

Assembly language

3rd Generation Programming Language (1958-1985)

Procedural Oriented language, FORTRAN, Pascal etc.

4th Generation Programming Language (After 1985)

Problem oriented language, Mat-lab, Oracle, MY-SQL, MS-SQL

5th Generation Programming Language (After 1990)

Natural Language, LISP, PROLOG, Mercury

Note: For detailed explanation of "Generation of Programming Languages", refer to the above-mentioned "types of programming languages."

FEATURES OF A GOOD COMPUTER PROGRAM [4][069][071]

  1. Accuracy: Every program must give the correct output for correct input. Otherwise, no program can be useful.
  2. Clarity: The logic implemented in a program should be readable and intelligible, so that it can be clearly understood with little effort.
  3. Modularity: While developing a program, we should divide the problem into different modules if possible, which can be accomplished using functions in C.
  4. Efficiency: A good program consumes minimum memory & executes within short period of time.
  5. Easy to maintain and update: Should be easy to maintain and update for future use.
  6. Simplicity: There may be a number of ways to develop a program but it is better to choose the simplest one.

SOFTWARE [1][070]

Software are a collection of computer programs designed to perform a well-defined task that provides a good user interface and are documented with operating procedures manuals.
Software = programs + good user interface + documentation + operating procedure

Types of Software [3][070][072]

1. System Software

The software used to control and coordinate computer hardware and software is called System Software. It is responsible for resource management, memory management, file management, tasks scheduling etc.

2. Application Software

Application software does their tasks with the help of an operating system. They are of following types.

  1. Tailored software: Tailored software is customized software designed to fulfill the specific requirements of an organization, office or individual. E.g. Hospital Management Software, Ticket Reservation, School Management Software, Air Ticket Reservation, Banking Software etc.
  2. Package software: Packaged software is readymade software developed for all general users to perform generalized tasks. One of the most prominent examples is something like the Microsoft Office package, which includes individual applications such as Word, Excel, Access and PowerPoint.
  3. Utility software: Utility software is helpful software that performs tasks related to the maintenance of computer hardware and data. Disk cleanup, system recovery, antivirus, WinZip etc. are common examples of utility software.

COMPILATION PROCESS[4] [069]

The process of translation from high level language(source code) to low level language(object code) is called compilation. Compilation process consists of the following steps.

  • Source code: The code written by programmer using a particular programming language is called source code. Source code is the only format that is readable by humans. When we purchase programs, we usually receive them in their machine-language format. This means that we can execute them directly but we cannot read or modify them.
  • Compiler: Compiler is a program that translates source code into object code.
  • Object code: The intermediate code produce by a compiler is called object code. Object code is often the same as or similar to a computer’s machine language. Object code needs to be converted into executable code using linkers.
  • Linker: A linker is a program that combines all object modules to form an executable program. We need to link a program even if it contains only one module. A linker is also called a binder.
  • Executable code: Code that is ready to run is called executable code or machine code.


COMPILER VS. INTERPRETER [2] [067][071]

Compiler Interpreter
Advantages It takes entire program as input. It takes single instruction as input.
Intermediate object code is generated after successful compilation which can be executed many times whenever needed if there are no changes in source code. Intermediate object code is not generated, so it must perform the translation process each time a program is executed.
Control statements are executed faster. Control statements are executed slower.
Disadvantages Memory requirement is more since object code is generated. Memory requirement is less since no object code is generated.
Error message are displayed only after scanning the whole source code. So after correction of error it needs to be compiled right from the very beginning. When error is found no further code is scanned. And after correction of error, interpretation can resume from there.
Compiler is not so good for Debugging. Interpreter is good for debugging.
Example C, C++, FORTRAN etc PHP, Pearl, Python, Ruby, Javascript, MATHLAB etc.

Note: To combine the advantages of both compilers and interpreters, the program development environment of a computer system provides both a compiler and an interpreter for a high-level language. In these cases, the interpreter is used to develop and debug programs. Then, when a bug-free state is reached, the programs are compiled to increase their execution speed. Java and .NET languages use both compiler and interpreter for better performance.

COMPILER VS. ASSEMBLER [3] [068]

Compiler Assembler
Compilers are used to translate high level languages (like C,C++) into machine code. Assemblers are used to translate assembly language into machine code.
The compiler takes high level language as its source code. The assembler takes low level language as its source code.
Compiler is more popular than Assembler. Assembler is less popular than compiler.

Assignment Set

  1. Draw the block diagram of a computer & explain the function of each block.
  2. Explain about the evolution of programming languages. Distinguish between Highlevel & Low-level programming languages.*
  3. How High-level programming languages are similar to natural languages?
  4. Differentiate: Compiler vs. Assembler vs. Interpreter
Board Exam Questions
  1. What are computer programs and computer programming? [2] [074]
  2. What do you mean by Programming Language? Explain about the evolution of programming languages. [1+3] [073]
  3. Explain the generation of programming language. Distinguish between high level and low level programming language. [3+3] [073]
  4. What is program? Briefly describe types of computer software. [2+2] [072]
  5. Explain different generation of programming languages. [4] [072]
  6. What do you mean by compilation? What is mean by interpretation? How do these two processes differ? [4] [071]
  7. Define programming language? What are the features of good computer program? [1+3] [071]
  8. Categorize programming languages on the basic of their uses and applications. Among them which programming language is C programming? [4] [071]
  9. What do you mean by software and explain about generation of programming languages. [4] [070]
  10. Define software. Explain its types. [3] [070]
  11. What are the features of a good computer program? Explain the process involved in converting a program written in high level language to an executable program. [4+4] [069]
  12. Differentiate between high level and low level. Explain the steps of solving a problem using computer. [4+4] [2069]
  13. How high level programming languages are similar to natural language? Describe. [3] [2068]
  14. What is high level language? Write different types of high level programming languages with their examples. How compiler is different than assembler programming language? [1+4+3] [068]
  15. Differentiate interpreter and compiler. Briefly explain the steps followed for developing computer software. [2+2] [2067]
  16. What is high level language? What are the different types of high level languages? How computer programming language C is different from FORTRAN? [1+3+4] [067]
Overview of Computer Software & Programming Languages
  • Introduction to Computer
  • Use of Computer
  • Data and Information
  • Instruction Sets
  • Computer Program
  • Software and its types
    • System Software
    • Application Software
  • General Software features and recent Trends
  • Computer Programming
  • Programming Language
  • Types of Programming Language
    • Low Level Programming Language
      • Machine Level Programming Language
      • Assembly Level Programming Language
    • High Level Programming Language
  • Generation of Language
  • Programming Approach
    • Top-Down Approach
    • Bottom-Up Approach
  • Programming Paradigm
    • Structured Programming
    • Object Oriented Programming
Web hosting by Somee.com