language translation system p

21
University of Wah,Wah cantt Pakistan.

Upload: anassatti5

Post on 07-Nov-2014

42 views

Category:

Education


3 download

DESCRIPTION

Language translation system in computer archetecture

TRANSCRIPT

Page 1: Language translation system p

University of Wah,Wah cantt Pakistan.

Page 2: Language translation system p

University of Wah,Wah cantt Pakistan.

GROUP MEMBERS

• TOQEER QAYYUM

• ANAS SATTI

• ZEESHAN AKRAM

Page 3: Language translation system p

University of Wah,Wah cantt Pakistan.

LANGUAGE TRANSLATION SYSTEM

Page 4: Language translation system p

University of Wah,Wah cantt Pakistan.

INTRODUCTION

Translator is a computer program that translates a program written in a given programming language into a functionally equivalent program in a different language.

Depending on the translator this may involve changing or simplifying the program flow without losing the essence of the program thereby producing a functionally equivalent program

Page 5: Language translation system p

University of Wah,Wah cantt Pakistan.

WHAT IS LANGUAGE TRANSLATOR

Computers are digital devicesAll types of commands, data and instructions required to be converted

into machine code which is the combination of 0’s and 1’sWe give instructions to the computer in a language which is similar to

English and easier for us to understand The computer translates these instructions into the machine language

with the help of language translators.

Page 6: Language translation system p

University of Wah,Wah cantt Pakistan.

TYPES

Assembler An assembler is software that converts programs written in assembly

language to machine language Interpreter An interpreter is software that converts programs written in high

level language to machine language code. It converts one instruction at a time.

Compiler

A compiler is software that converts programs written in high level language to machine code in a single operation.

Page 7: Language translation system p

University of Wah,Wah cantt Pakistan.

CONT….

If the translator translates target/machine code to source language it is called a decompiler

Example Reverse Engineering Compiler (REC).If the translator translates machine code into assembly language it is

called a disassembler

Page 8: Language translation system p

University of Wah,Wah cantt Pakistan.

EXAMPLE

Page 9: Language translation system p

University of Wah,Wah cantt Pakistan.

HISTORY

The idea of machine translation may be traced back to the 17th centuryMachine translation generally started in the 1950s, although work can be

found from earlier periods.The Georgetown experiment in 1954 involved fully automatic translation

of more than sixty Russian sentences into English.MT on the web started with SYSTRAN Offering free translation of small

texts (1996),

Page 10: Language translation system p

University of Wah,Wah cantt Pakistan.

In the 1960s, high-level programming languages using a compiler were commonly called autocodes

a text/SMS translation service for mobiles in Japan (2008), and a mobile phone with built-in speech-to-speech translation functionality for English

Google announced that Google Translate translates roughly enough text to fill 1 million books in one day (2012).

Page 11: Language translation system p

University of Wah,Wah cantt Pakistan.

The human translation process may be described as:

Decoding the meaning of the source text; andRe-encoding this meaning in the target language.

Page 12: Language translation system p

University of Wah,Wah cantt Pakistan.

WORKING

Assembler. Assembly language consists of mnemonics for machine opcodes so

assemblers perform a 1:1 translation from mnemonic to a direct instruction

For example:LDA #4 converts to 0001001000100100

Page 13: Language translation system p

University of Wah,Wah cantt Pakistan.

CONT….

Conversely, one instruction in a high level language will translate to one or more instructions at machine level.

Advantages of using an Assembler:Very fast in translating assembly language to machine code as 1 to 1

relationshipAssembly code is often very efficient (and therefore fast) because it is a

low level language

Page 14: Language translation system p

University of Wah,Wah cantt Pakistan.

CONT…

Assembly code is fairly easy to understand due to the use of English-like mnemonics

Disadvantages of using AssemblerAssembly language is written for a certain instruction set and/or

processorAssembly tends to be optimised for the hardware it's designed for,

meaning it is often incompatible with different hardwareLots of assembly code is needed to do relatively simple tasks, and

complex programs require lots of programming time

Page 15: Language translation system p

University of Wah,Wah cantt Pakistan.

CONT…

CompilerA compiler takes as input a program in some language, and translates

that program into some other language, which may serve as input to another interpreter or another compiler

Notice that a compiler does not directly execute the programUltimately, in order to execute a program via compilation, it must be

translated into a form that can serve as input to an interpreter.

Page 16: Language translation system p

University of Wah,Wah cantt Pakistan.

Advantages of using a compilerSource code is not included, therefore compiled code is more secure than

interpreted codeTends to produce faster code than interpreting source codeProduces an executable file, and therefore the program can be run

without need of the source code

Page 17: Language translation system p

University of Wah,Wah cantt Pakistan.

Disadvantages of using a compilerObject code needs to be produced before a final executable file, this can

be a slow processThe source code must be 100% correct for the executable file to be

produced

Page 18: Language translation system p

University of Wah,Wah cantt Pakistan.

InterpreterAn interpreter program executes other programs directly, running

through program code and executing it line-by-line. An interpreter is slower than running compiled code but it can take less

time to interpret program code than to compile and then run it — this is very useful when prototyping and testing code

Page 19: Language translation system p

University of Wah,Wah cantt Pakistan.

Interpreters are written for multiple platformsmeans code written once can be run immediately on different systems

without having to recompile for eachExamples of this include flash based web programs that will run on your

PC, MAC, games console and Mobile phone.

Page 20: Language translation system p

University of Wah,Wah cantt Pakistan.

Advantages of using an InterpreterEasier to debug(check errors) than a compilerEasier to create multi-platform code, as each different platform would

have an interpreter to run the same codeUseful for prototyping software and testing basic program logic

Page 21: Language translation system p

University of Wah,Wah cantt Pakistan.

Disadvantages of using an InterpreterSource code is required for the program to be executed, and this source

code can be read making it insecureInterpreters are generally slower than compiled programs due to the per-

line translation method