Computer Science guide to C Unit-I Translator.pptx

NomthandazoNgwenya1 24 views 14 slides Oct 20, 2024
Slide 1
Slide 1 of 14
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14

About This Presentation

C programming


Slide Content

School of Computing Science and Engineering Course Code : R1UC101B Name: Programming for Problem Solving using C Program Name:B.Tech (CSE) UNIT I Translators

Objectives Language Processing System Low Level Language High Level Language Translators Compiler Interpreter Assembler

Characteristics of LOW Level Languages: They are machine oriented : an assembly language program written for one machine will not work on any other type of machine unless they happen to use the same processor chip. Each assembly language statement generally translates into one machine code instruction, therefore the program becomes long and time-consuming to create. Language Processing System Program Name: B.Tech (CSE)

Characteristics of HIGH Level Languages: They are not machine oriented: in theory they are portable , meaning that a program written for one machine will run on any other machine for which the appropriate compiler or interpreter is available. They are problem oriented: most high level languages have structures and facilities appropriate to a particular use or type of problem. For example, FORTRAN was developed for use in solving mathematical problems. Some languages, such as PASCAL were developed as general-purpose languages. Statements in high-level languages usually resemble English sentences or mathematical expressions and these languages tend to be easier to learn and understand than assembly language. Each statement in a high level language will be translated into several machine code instructions. Language Processing System Program Name: B.Tech (CSE)

Computer Language Evolution Program Name: B.Tech (CSE)

Translator is one that converts high level Language to low level language Types of Translator are: Assembler Compiler Interpreter Translator Program Name: B.Tech (CSE)

Translator Program Name: B.Tech (CSE)

An assembler is a  program  that converts  assembly language  into machine code. It takes the basic commands and operations from assembly code and converts them into  binary  code that can be recognized by a specific type of  processor . Assemblers are similar to  compilers   in that they produce executable code. However, assemblers are more simplistic since they only convert low-level code (assembly language) to machine code. Since each assembly language is designed for a specific processor, assembling a program is performed using a simple one-to-one mapping from assembly code to machine code. Most programs are written in high-level  programming languages  and are compiled directly to machine code using a compiler. However, in some cases, assembly code may be used to customize functions and ensure they perform in a specific way. Therefore,  IDEs  often include assemblers so they can build programs from both high and low-level languages. Assembler Program Name: B.Tech (CSE)

A compiler is a software program that  compiles  program  source code  files into an executable program . The compiler takes source code files that are written in a high-level language, such as  C ,  BASIC , or  Java , and compiles the code into a low-level language, such as machine code or assembly code. If there is any occurrence of error in source code so compiler won’t be able to convert that to low level so on compilation errors if any are displayed. Compiler Program Name: B.Tech (CSE)

An interpreter converts high level language into low level machine language, just like a compiler. But they are different in the way they read the input. The Compiler in one go reads the inputs , does the processing and executes the source code whereas the interpreter does the same line by line. Compiler scans the entire program and translates it as a whole into machine code whereas an interpreter translates the program one statement at a time. Interpreted programs are usually slower with respect to compiled ones. Interpreter Program Name: B.Tech (CSE)

Comparison Program Name: B.Tech (CSE)

C Program Working Program Name: B.Tech (CSE)

E. Balagurusamy 7th Edition, Programming ANSI C, McGraw-Hill Brian W. Kernighan and Dennis M. Ritchie, The C programming Language, Prentice-Hall in 1988 Byron Gottfried, Programming with C, Schaum's Outline References Program Name: B.Tech (CSE)
Tags