• No results found

“Leonhard Euler is one of the greatest mathematicians of the 18

th

century. Euler was born in Basel, Switzerland on 15

th

April 1707. In 2013 his 306

th

birth anniversary was celebrated. Euler’s eyesight deteriorated throughout his career.

Three years after suffering from fever he became blind in 1735. Although Euler blamed the work on cartography he performed for St. Petersburg Academy for his condition. He did most of his work during the last two decades of his life when he was totally blind. After Euler became blind he did most of the calculations in his mind. His memory and concentration power was legendary. His computational capability was outstanding and his blindness did not stop him from producing amazing mathematical results. He produced one paper every week in the year 1775. His contributions are Euler’s theorem, Euler’s equation for motion of fluids,

Today, in our everyday life, interactions with the electronic devices or computers have become natural form of our every expressions that we think are more productive way to interface with the rest of the universe. These devices have a lot of power to process information that help us stay ahead in various areas of our choosing.

The interaction enablers on these devices are the various pieces of software that present interfaces for us to use the devices the way we want. Based the usages, these pieces of software create appropriate processing action for devices and instruct them to perform the same and therefore, we see they work for us. These various pieces of software essentially help us to utilize the computational powder of the device.

It is critical that we are able to create an elegant software that utilizes the devices efficiently. Also important is the need to have a standard mechanism to design and develop such software. The mechanism must allow us to specify various tasks without having to worry about how computers will understand them. As pieces of software need to instruct the device to perform tasks efficiently and, at the same time, we need to be able to dvelop a software that we can converse with, there grew the need to be able to build pieces of software from a form of human language (programming language) that will interface the device with machine language. Here is where we got ourselves what is known as the

“compiler” that provides the transparency between human (programming) and machine language.

A compiler is a process that converts a software program written by human-understandable language (high-level programming language) into a computer-understandable language (low-level machine language) in order for the program to work on a computer. The code in which we write a program is in a high-level language but the computer would not understand anything but the machine language. So we need someone to translate the high-level code into machine code. The translator that does this work for us is called the compiler.

Compiler overview

The machine code is CPU specific. Compilers allow the source code to be independent of the target processor. This implies that the source code is independent of the target processor. So it is not needed to generate source code for different processors but only a suitable compiler needs to be purchased.

The program is platform independent

The generated machine code can be executed later many times against different data input. An interpreter reads an executable source program written in a high-level programming language as well as data for this program and it runs the program against the data to produce the output. Both the interpreters and the compilers are written in some high-level programming language just like any other program and it may be different from the language they accept and they are later translated into machine code.

So a compiler is a program that translates a source program written in some high-level programming language into a machine code for some computer architecture. Computer architecture is conceptual design and fundamental operational structure of a computer system. It is how to design and implement the various parts of a computer. It focuses largely on the way by which the central processing unit (CPU) operates internally and how it accesses addresses in memory. Computer architecture is the technical drawings and functional description of all design requirements.

A compiler is a computer program that transforms the source code into an object code. It is a computer program that transforms the human readable source code of another computer program into the machine readable code that the CPU can execute. This process

of converting the source code to a machine code is called compilation. The first compiler was developed by Grace Hooper in the year 1952 while working on the Harvard Mark I computer. He developed this compiler for the A-0 programming language. The compiler converts a high-level programming language into a lower level language, assembly language or a machine language. Compilers translate source code to object code which are unique for each type of computer. Many compilers are available for the same programming language. For example, there is a FORTRAN compiler that is available for Windows PC and another compiler for Apple computers (MAC operating system) or Intel Linux.

2.2 HOW DOES A COMPILER WORK?

As we would like to be able to interact with computers using a language that we are comfortable with, we need compilers to translate out interactions into simple commands making up a software program which will actually interact with computers using machine (assembly) language.

Compiler works as a language processor that reads a program in the “source” language and translates it into an equivalent program in another “target” language. During the process of translation, compiler reports any errors in the “source” program which requires to be fixed in order for a successful translated “target” program. The “target” program is typically a machine-language software program that can be used by users to process inputs and produce the desired output.

The way a compiler works is usually split into the following phases with well-defined interfaces.

1. Lexical analysis (scanning)—first, the program is read, analyzed and divided into tokens, each of which corresponds to a symbol in the programming language, such as, a variable, a keyword or a number.

2. Syntax analysis (parsing)—the tokens produced above are arranged in a tree-structure (called the syntax tree) that reflects the structure of the program.

3. Type checking—the syntax tree is analyzed to determine if the program violates certain consistency requirements. For example, a variable is used but is not declared, a variable is used in a context that does not make sense due to its type etc.

4. Intermediate code generation—program is translated to a simple machine independent intermediate language and the code is generated.

5. Register allocation—from the generated intermediate code, the symbolic variable names are translated to numbers and each of these numbers corresponds to a register in the target machine code.

6. Machine code generation—the intermediate language is translated to assembly language for a specific machine architechture.

7. Assembley and linking—finally, the assembley language code is translated into binary representation after determining addresses of variables, funactions, etc.

The first three phases are called the frontend of the compiler and the last three phases are called the backend. The middle part of the compiler is comprised of the intermediate code generation, but this often also includes various optimizations and transformations on the intermediate code.

Parts of a compiler

Assembly and linking are typically done by programs supplied by the machine or, the operating system. They work with the compiler to complete the compilation process but they are not part of the compiler.

2.3 INTERPRETER AND COMPILER

An “interpreter” is another kind of language processor. Instead of translating “source”

code into “target” program an interpreter directly executes operations specified in the source program on inputs provided by the user. As there is no compilation happening on the source code but computer understands only the machine language, interpreter simulates a virtual machine using the basic set of instructions on a programming language as its machine language and that allows interpreter to directly execute operations from the source program.

The target program produced by a compiler is usually much faster than an interpreter processing user actions (inputs) and producing results (outputs). An interpreter, however, can provide better error diagnostics than a compiler as it executes the source program statement by statement.

In today’s enterprise cloud computing, Java language processors combine an optimum blend of compilation and interpretation. Java source code will be compiled into an intermediate form called “bytecodes”. The bytecodes are then interpreted by a virtual machine. The benefit and the power of this combination is that the bytecodes are compiled once, on a single machine and they can be interpreted on a number of virtual machine environments across various networks.

2.4 THE MATLAB COMPILER

The MATLAB CompilerTM converts MATLAB scripts written by the user into stand-alone applications that do not need to be run within the MTALAB environment. When we run these applications they do not require the use of liscences. The MATLAB compiler lets us share MTALAB programs as stand-alone applications or shared libraries for integration with common programming languages. Applications and libraries created with MATLAB Compiler use the MATLAB Compiler Runtime, which enables royalty-free deployment to users who do not have MATLAB.

The MATLAB Compiler Runime also known as MCR is a stand-alone set of shared

libraries that enables the execution of compiled MTALAB application or components on computers where MATLAB is not installed. Thus, when used together, MATLAB, MATLAB Compiler and the MCR enable us to create and distribute numerical applications or software components quickly and securely.

A MATLAB based application compiled as an executable using MATLAB Comipler and deployed on an end-user machine running MATLAB Compiler Runtime So the MATLAB Compiler only generates wrapper files that interface with the MCR (MATLAB Compiler Runtime) that implements standalone set of shared libraries that enable execution of MATLAB algorithms, even on computers which do not have MATLAB Compiler installed in them. As the MATLAB program is portable they should work on any computer that has MATLAB interpreter. A separate MATLAB compiler is available which can compile a MTATLAB program into a single stand-alone executable which can run without MTALAB licence. This helps in converting prototype MATLAB program into an executable suitable for sale and distribution.

CHAPTER

3

Numbers, Review of Matrices and Matrix

Related documents