sd & d high and low level languages

12
High and Low Level Languages

Upload: forrester-high-school

Post on 19-Aug-2015

39 views

Category:

Education


1 download

TRANSCRIPT

Page 1: SD & D High and low level languages

High and Low Level Languages

Page 2: SD & D High and low level languages

High Level LanguagesProgramming languages are generally similar to the English

language. They use words like If, Else, Repeat, While etc.

These languages are known as high level languages.

Page 3: SD & D High and low level languages

Low Level LanguagesThe computer does not understand high level languages. It

understands binary codes which are referred to in programming as machine codes e.g. 10010010 01101010.

These languages are known as low level languages.

Page 4: SD & D High and low level languages

Low Level LanguagesMachine Code in the form of binary is extremely difficult

for humans to read. To make it (slightly) easier to read and understand, Assembly Language was devised.

Each Assembly Language command can be converted to machine code.

Page 5: SD & D High and low level languages

TranslatorsSo, humans understand high level languagesandComputers understand low level languages.

To get our high level languages into a form that the computer understands, we need a translator.

A translator converts high level language commands into low level language commands.

Page 6: SD & D High and low level languages

Interpreters and CompilersIn order to resolve this problem, there are two ways to

convert the high level language written by humans into a low level language understood by computers.

These are interpreters and compilers.

Page 7: SD & D High and low level languages

InterpretersAs the program is running, the interpreter takes one line of

code at a time and translate it into a low level code.

IF age > 18 THEN displayfield.text = “Left school”END IF

Page 8: SD & D High and low level languages

InterpretersAs the program is running, the interpreter takes one line of

code at a time and translate it into a low level code.

10011001 00010110 11000100 00010011 displayfield.text = “Left school”END IF

Page 9: SD & D High and low level languages

InterpretersAs the program is running, the interpreter takes one line of

code at a time and translate it into a low level code.

10011001 00010110 11000100 0001001110010010 11110001 00000001 1001101100110101 01111110

Page 10: SD & D High and low level languages

CompilersA compiler works by converting the program source code

and converting it into object code before the program is run.

IF age > 18 THEN displayfield.text = “Left school”END IF

Page 11: SD & D High and low level languages

CompilersA compiler works by converting the program source code

and converting it into object code before the program is run.

10011001 00010110 11000100 0001001110010010 11110001 00000001 1001101100110101 01111110

Page 12: SD & D High and low level languages

Compilers vs InterpretersInterpreters are slower than compilers when the program is

running because they have to interpret each line

The interpreter needs to be in memory each time the program is run, whereas compilers do not

Interpreters can make debugging a program easier because they can track errors line by line

Compilers have to have programs recompiled each time the code is changed, even if the change is minor