Thursday, March 8, 2018

What is Compiler?

                   What is Compiler?
Compiler: Compiler is a translation Software , used to translate high level  language program in to it equivalent machine code.Also error are reported at the end of compilation process.


  • A compiler compile as a whole program.
  • A compiler detect the error at the end after compilation.
  • A compiler generate an object code. 
  • Mainly used in C, C++, & Fortaan etc
There are two phase compiler.


  1. Analysis phase 
  2. Synthesis phase
What is Analysis phase?
In this phase the source program is analysed each, Statement etc are checked  Syntactically and Semantically according to rule of the language binge used.   
What is Synthesis phase?
It perform conversion of source program (Syntactically & Semantically )in to a target/ machine code.
                               LOGICAL DECOMPOSITION OF COMPILER
As we have study that a compiler is divided in to two phase , now these two phase are further sub divided in three phases.
Analysis phase is divided into following three phases.


  • Lexical analysis phase 
  • Syntax analysis phase 
  • Semantic analysis phase 
Lexical analysis phase?
This is a very first phase of compiler it take source program as input and divided it in to smaller and meaning full parts , this small and meaning full parts are called Tokens, There are five parts which the program/ code are divided


  1.  Constant
  2. Identifiers
  3. Operators 
  4. punct
    uators
  5. Reserved  Words 
     *. The error detect in lexical phase are called lexical error.
     *. The module which perform lexical phase are called Scanner / lexical analyseer.
     *. Lexical analysis phase takes source program as input and give token as output.
           Syntax analysis phase?
This phase takes the token as input and generates a hierarchical structure called parse/ syntax tree, in order to syntactically check each and every statement written in source program according to the rule defined by the language being used.
Syntax analysis is a process and module that operate   syntax analysis is called parser / syntax analyseer.
The error detect in this phase is called syntax error.
           Semantic analysis phase?
This phase takes the parse/syntax tree as input and generate semantic parse tree. This phase is responsible to perform operation like type conversion , operators compatibility and array abound checking etc.
Module which performs this phase called semantic analyseer.
The error detected in this phase are called Semantic Error.
What is Synthesis phases?
1. Intermediate code Generation phase:
This phase is responsible to convert the source program in to three-Address code format which is normally called as intermediate code.
Why Three-Address code format?
Source code is converted in to three-address format, because Assembly language is three-address language, So the conversion of three-address code to assembly code is easier and simple.
 The module that perform this phase is called "Intermediate code Generation"
Code Optimization phase:
In this phase,the intermediate code generated in previous phase is reduced to minimum number of statement if possible.
The module of compiler that perform code optimization is called code optimizer.
Code Generation phase:
The last phase of compiler that converts the optimized code into a machine/ target code.

Tuesday, March 6, 2018

ComputerNetworks

What is computer Networks?
A computer networks is an interconnection  of various nods  , located at different places , but connected with each other via a communication links or channel me be wireless or wired connection. the main purpose of computer networks is to share recourse between each other.
 Node?
Network devices are called Node. A node can be any computer , printer are any other end devices which is capable of sending or receiving information through interconnected devices.
History of Computer Networks?
First of all in 1962 two computer are interconnected with each other successfully , After this by the help of USDoD four computer are interconnected with each other. The name of this project is ARPANet .
USDoD stand for United State Department of Defense.
ARPANet stsnd For Advance Research Project Agency.

  1. UCLA, stand for University of California at Los Angles
  2. UC Santa barbara 
  3. Stonford research institute (SRI)
  4. Uni of Utah
The communication between this four uni is called ARPANet,  Then in 1972 thirty nodes are interconnected successfully and in 1980's its extension is up to Europe via satellite and finally in 1990's Internet come to being officially for public every where in the world.
What do you mean by classification of computer networks?

  1.   Based on the Transmission mode: 
it define direction of data flow.
their are three mode of data flow define shortly as under

  • Simplex: its uni-directional means the data can send only in one direction. e.g Use in printer etc
  • Half Duplex: Bi-directional means the data can send on both direction but not at a time (only one can send data at a time)
  • Full Duplex: By directional means send and receive data on both direction at a time.
      2.   Based on Time in Transmission:

  • Synchronous time transmission: 
  • Asynchronous time transmission:
      3.   Based on Authentication:

  • peer to peer Networks: In peer to peer networks one computer can send the request and full fill the request e.g Bit Tarrent 
  • client Server Networks: The client can send request only and full fill the request is the responsibility of Server.
      4.  Based on Geographical   location:

  • LAN: Local area networks use in Building, organization. 
  • MAN: Metropolitan area networks use i same city between two or more building of same organization e.g two are more branches of one college in one city. 
  • WAN: Wide area network use all over the world e.g internet.
  • CAM: campus area network use in small campus, school ect.
  • HAN:Home area network use in home , shop.
      5.   Based on Reliability:

  • connection oriented: Establish a session connection between sender and receiver before communication e.g TCP stand for Transmission control protocol. 
  • Connection less communication: No session connection is establish before communication e.g UDP stand for User Data gram Protocol

     

What is OOAD?

Q : What is OOAD?
Ans : OOAD stand for Object Oriented Analysis of Design, 
before OOAD we use TM, TM stand for Traditional methodology, 
In early days means 1970's software consist on 5 kloc (5000 loc) consider as small scale software but gradually in mid of 1980's medium scale  software are developed    which consist on 50 kloc (50,000loc), In the end of 1980's a large scale software are developed consist on 50 lac loc the stronger one.
now as the size of software are expended the traditional methodologies was facing difficulties. then concept of OOAD was a emerged.
Here Question arises that why TM failed in medium and large scale but not in small scale software? 
Because software are comprise of Operation and Data. means proper management of data and operation are much necessary. The main focus of TM was on operation and have less attention on data, this is the major reason of failing of TM.
Why OOAD was success to overcome in medium and large scale software?
Because OOAD give equal important to both operation and data. the main concept of OOAD consist on class & object. structure of class in this subject is!!!
class is the blue print of an object.
object is the instance of a class.
 For Example: class
President = class name 
president name , country name , tenure , age = Attribute/data 
 Reign = Operation 
  Here, President is a class with attributes Name , Country , Tenure , Age and operation/action is region. e.g Who is Reign of pakistan ?
Mamnoon Hussain.
       

Natural Language Processing (NLP)

         What is Natural language processing(NLP)?                                 
 Natural language processing NLP
NLP Stand for Natural Language.
It is the branch of AI.
Now a days the researcher try to to make such a system that are able to understand natural language. so in the beginning computer only understand machine language(i.e 0 &1),But after this researcher can developed an intermediate level language and then gradually introduce High level language and now NLP are expected in next few year.
Who was the first computer programmers?
The first computer programmers is a female name Ada lovelace. Ada is also a computer language related with the first programmer mentioned above.
Before digital computer mechanical computer works instead of digital computer.

   










Monday, March 5, 2018

Expert System (ES)

                                                                EXPERT SYSTEMS
"It is an intelligent computer program which works at the level of human expert, receives some facts & returns Solution/expertise" 

  • ES stand for Expert System
  • ES is the first branch of Artificial intelligent
  • different Expert system are now working in different countries i.e ACE Automated cable Expert.
  • Human Expert (HE) has limited life , but software are forever.
  • In some situation the HE is not be able to work (i.e he is sick etc) but ES never retire, never become sick they are forever.
                                                                            Structure of ES

  1. It must have a user interface, User will provide facts to ES.
  2. ES must have a knowledge base, 
knowledge Base = Database + Rule
Database is just a collection of files.
Rules are also provided that what to do & how to do.
     3. Interface Engine is not a H/W it is just a parts of computer programs.which conclude the results on the basis of facts provide by the user. 

What is Compiler?

                   What is Compiler? Compiler: Compiler is a translation Software , used to translate high level  language program in to it...