0% found this document useful (0 votes)
38 views2 pages

Grade 9 Notes Printed - 18 - 2010 - Programming Languages

The document discusses different types of computer languages including high-level languages like Java and C++ and low-level languages like machine code and assembly language. It explains the differences between interpreters and compilers as translation programs used to convert between language levels and how each works.

Uploaded by

hlt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Grade 9 Notes Printed - 18 - 2010 - Programming Languages

The document discusses different types of computer languages including high-level languages like Java and C++ and low-level languages like machine code and assembly language. It explains the differences between interpreters and compilers as translation programs used to convert between language levels and how each works.

Uploaded by

hlt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PROGRAMMING LANGUAGES

Program: A program is a set of instructions that the computer can understand. A program is
written in a computer language and it must be translated to binary code for it to work (run).

Types of Computer Languages:


 High Level Language
 Low Level Language
High Level Language:
High level language instructions are similar to English and therefore programming is easier.
Ex: BASIC, C, C++, VB, SQL, HTML, JAVA, ASP.Net, COBOL etc.
Advantages of HLL Disadvantages of HLL
• Easy for the programmer to understand as • Programs need to be translated into
instructions are mostly in English Machine Language and this is time
• Easy to correct errors and test programs consuming.
• Programs written in HLL can be used on
different makes of computers

Low Level Language:


Low level language is easy for the computer to understand as programs are typed in Machine
Code or Assembly Language. A lot of games or simulation programs are written in machine
code & Assembly language.
Machine Code
Machine code is the language directly understood by the machine. It consists of 0s and 1s.
Assembly Language
Assembly language used codes such as LDA, STA etc. A program in assembly language is to be
translated to machine code by software called Assembler.
Advantages of LLL Disadvantages of LLL
• Allows users to address computer memory / • Takes a long time to write a program
registers directly • Takes a long time and is difficult to find and
• Users can learn the actual working of the correct errors.
computer and programs • Programs are machine specific.
• A program written in machine code needs
no translation hence execution is very fast.

Translation Program:
Translation programs are part of the system’s software and are used to convert HLL programs
into machine code.
Types of Translation Programs:
 Interpreter
 Compiler
 Assembler

Interpreter:
 Interpreter reads each line of HLL program translates it to machine code and runs it.
 Shows errors (if any) once a line is translated. The error must be corrected to proceed
further.
 Execution of program is slow compared to compiled program.
 Each time the program is run, it is interpreted. Interpreter is needed all the time.

©AIS PROGRAMMING LANGUAGES COMPUTER SCIENCE Page 1 of 2


Compiler:
 Compiler translates the entire program written in HLL into machine code in one step.
 Any errors in the program are shown after translation and those have to be corrected
and the program recompiled.
 After compiling, creates a translated program code called as object file.
 Time consuming as the program needs to be compiled till it becomes error free.
 Execution of program is very fast as object file is run.
Interpreter Compiler
Translates instructions line by line Translates the whole program in one step
Object code file is not created Object code file is created
Translates the program each time to execute Runs straight away the object code
Less memory needed More memory needed
Errors displayed immediately Errors displayed in the end of compilation

Assembler:
 An assembler translates an assembly language program into machine code. This is
quiet easy as each instruction in assembly language corresponds to a specific binary
code in machine language.
 Any errors in the program are shown after translation and those have to be corrected
and the program retranslated.
 Creates translated program code called as object file.
 Executes program very fast.
Source code: The program written in a HLL is called source code.
Object code: The translated program that contains machine code is called object code.
Whenever the program needs to be run the object code can be used. The advantage is the
source code can be modified any number of times and each time produce an object code.
The object code cannot be edited or modified.
Translate using a translator

PSEUDOCODE PROGRAM IN BASIC PROGRAM IN C MACHINE CODE

Steps to add two Program to add Program to add two Steps to add two
numbers two numbers numbers numbers

Set num1=0 Let num1=0 #include <stdio.h> 0110101011011


Set num2=0 Let num2=0 #include <conio.h> 0101101011110
Set total=0 Let total=0 main() 0101010101011
Input num1 Input num1 { 1010111010101
Input num2 Input num2 int num1,num2,total=0; 0011010101101
Total=num1+num2 Total=num1+num2 scanf(“%d”, &num1); 1010110101111
Output total Print total scanf(“%d”, &num2); 0010101010101
End End total = num1+num2; 1101011101010
printf(“%d”, total); 1010101011011
getch();
}
English Mock representation
representation HLL HLL of LLL

Source Code Object Code


©AIS PROGRAMMING LANGUAGES COMPUTER SCIENCE Page 2 of 2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy