Showing posts with label STUDY. Show all posts
Showing posts with label STUDY. Show all posts

Monday, October 29, 2018

LINES IN THE PLANE

October 29, 2018
LINES IN THE PLANE
Find The Number Of Region
Ln = Ln-1+n  = Number of Region
n = Number of lines

Ln _ Ln-1 + n; for n > 0.




































Sunday, October 28, 2018

Tower of Hanoi Simulation Example with Solution and Mathmatical Induction

October 28, 2018
Tower of Hanoi L - rule:
1. must move one disk at a time;
2. a larger disk cannot be on top of any smaller disks at any time
3. do it in as few moves as possible
2 Disks
3 Disk

4 Disk

Mathematical induction is a general way to prove that some statement
about the integer n is true for all n _ n0. First, we prove the statement
when n has its smallest value, n0; this is called the basis. Then we prove the
statement for n > n0, assuming that it has already been proved for all values
between n0 and n - 1, inclusive; this is called the induction. Such proof
gives in_nitely many results with only a _nite amount of work.
Recurrences are ideally set up for mathematical induction. In our case,
for example,  follows easily from  The basis is trivial, since T0 =
20 -1 = 0. And the induction follows for n > 0 if we assume that holds
when n is replaced by n - 1:
Tn = 2Tn-1 + 1
    = 2(2n-1 - 1) + 1
     = 2n - 1 :
Hence (1.2) holds for n as well. Good! Our quest for Tn has ended successfully.


Monday, October 22, 2018

Defination compiler assembler interpreter

October 22, 2018
Preprocessor
A preprocessor, generally considered as a part of the compiler, is a tool that produces input for compilers. It deals with macro-processing, augmentation, file inclusion, language extension, etc.
Compiler
A compiler is a translator program that translates a program written in (HLL) the source program and translates it into an equivalent program in (MLL) the target program. As an important part of a compiler is error showing to the programmer.
Executing a program written n HLL programming language is basically of two parts. the source
program must first be compiled translated into an object program. Then the results object program is loaded into a memory executed.
                  
Cross-compiler
A compiler that runs on the platform (A) and is capable of generating executable code for a platform (B) is called a cross-compiler.

Source-to-source Compiler
A compiler that takes the source code of one programming language and translates it into the source code of another programming language is called a source-to-source compiler.
INTERPRETER
An interpreter is a program that appears to execute a source program as if it were machine language
           Fig: Execution in Interpreter
The process of interpretation can be carried out in the following phases.
1. Lexical analysis
2. Syntax analysis
3. Semantic analysis
4. Direct Execution
  



Assembler
An assembler translates assembly language programs into machine code. The output of an assembler is called an object file, which contains a combination of machine instructions as well as the data required to place these instructions in memory.
Linker
Linker is a computer program that links and merges various object files together in order to make an executable file. All these files might have been compiled by separate assemblers. The major task of a linker is to search and locate referenced module/routines in a program and to determine the memory location where these codes will be loaded, making the program instruction to have absolute references.
Loader

Loader is a part of the operating system and is responsible for loading executable files into memory and execute them. It calculates the size of a program (instructions and data) and creates memory space for it. It initializes various registers to initiate execution.

Saturday, October 20, 2018

COMPILER DESIGN ( sheet 1 ) language processing system

October 20, 2018
Language Processing System
The hardware understands a language, which humans cannot understand. So we write programs in high-level language, which is easier for us to understand and remember. These programs are then fed into a series of tools and OS components to get the desired code that can be used by the machine. This is known as the Language Processing System.

FIG: Language Processing System





The high-level language is converted into the binary language in various phases. A compiler is a program that converts high-level language to assembly language. Similarly, an assembler is a program that converts the assembly language to machine-level language.

Youtube Banga Tutorial link

Most Popular

Football