High-level language:-

March 14, 2011

We have seen that in order to be a good programmer, we have to mainly concentrate on the problem rather than he concerned with the details of the internal structure of the computer. In order to facilitate the programs to use computers without the need to know in detail the internal structure of the computer high-level languages were developed.

High-level languages instead of being machine based are oriented more towards the problem to be solved. These languages enable the programmer to write instructions using English words and familiar mathematical symbols. So it becomes easier for him to concentrate on the logic of his problem rather than getting involved in programming details.

High-level languages are basically symbolic languages that use English words and mathematical symbols rather than mnemonic codes. In other words a high-level language is nothing but macro instructions.

In assembly language translating work is done be assembly while in high-level language it is done by compiler.

Thus compiler is a translating program that translates the instructions of a high-level language into machine language high-level language is known as problem oriented languages because the macro instruction are especially picked to be useful for solving particular types of problems. A problem-oriented language is designed in such a way that its instructions way be written more like the language of the problem.

Advantages:

(1) Machine independent:

High-level languages are machine independents. It is very advantageous as a program written in a high-level language can be run on many different types of computers with very little or practically no effort.

(2) Easy to learn:

These languages are very similar to the languages normally used by us in our day-to-day life. A program in this language has no worry about how to store his number in the computer where to store them etc i.e. he need not know machine instructions.

(3) Fewer errors:

In case of high-level language, since the small steps carried out by the computer, he is much les likely to do error. The computer takes care of the little details and will not intro of any error of its own unless something breaks down. Compilers are designed for pointing errors.

(4) Lower program preparation cost:

Writing programs in high-level languages requires less time and effort, which ultimately leads to lower program preparation cost.

(5) Easier to maintain:

Programs written in high-level are easier to maintain. This is mainly because they are easier to understand and hence it is easier to locate, correct and modify instructions as and when desired. Removal and addition of certain instruction from a program is also possible without any complication. Thus, major changes can be incorporated with very little effort.

Disadvantages:

(1) Lower effiency:

It has lower efficiency because the programs written in high-level language take more time to run and require more main storage.

(2) Lack of hexibility:

Because the automatic features of high-level language always occur and are not under the control of the programmer. They are less flexible than assembly/ machine language. This lack of flexibility means that some tasks cannot be done in a high-level language or can be done only with great difficulty.


Assembly language:-

March 14, 2011

One of the first steps in improving the program preparation process was to substitute letter symbols mnemonics for the numeric operation of machine language.

The computer can be trained to translate a program written with symbols instead of numbers into the computer’s own machine language. Then we can write program for the computer using symbols instead of no and have the computer do its own translating.

The language, which substitutes letters and symbols for number in machine language, is assembly language. A program written in symbolic language that was symbols instead of numbers is assembly code or symbolic program.

The translator program that translates an assembly code into the computer machine code is called assembler.

A symbolic program written by programmer in assembly language is source program. After the source program has been converted into machine language by an assembler, it is referred to as an object program.

This whole process of translation occupies lot of time. Computer not only has to run the main program to get the answer but it also must first translate the original symbolic program into machine.

Advantages:

(1) Easier to understand and use:

Assembly languages are easier to understand and write. because mnemonics are used instead of numeric op-codes and suitable names are used for data.

(2) Easy to locate and correct errors:

While writing programs in assembly language. Fewer errors are made and those that are made easier to find and correct because of the use of mnemonics and symbolic field names. Further more, assemblers are so designed that they automatically catch errors. If we use an invalid mnemonic or name that has never been defined the assembler will print out error.

(3) Easier to modify:

It is easy to modify this language as it is easier to locate, correct and modify instruction and also insertion or removal of certain instructions from the program does not require change in address part of program.

(4) No worry about address?

One of the greatest advantages of assembly language is that it eliminates worry about address for instructions and data.

Limitations:

(1) Machine language:

Because each instruction in the symbolic language is translated into exactly one machine language instruction. Assembly languages are machine dependent. That’s why they are designed for the specific model of processor.

(2) Knowledge of hardware is required:

Since assembly languages are machine dependent, so the programmer must be aware of a particular machine’s characteristics and requirements as the program is written. An assembly language programmer must know how his machine works and should have a good knowledge of the logical structure of his computer to write good assembly.

(3) Machine level coding:

In case of an assembly language instructions are still written at the “machine code level” that is one assembler instruction is substitute for one machine code instruction.


Machine language:-

March 14, 2011

The set of instruction codes, whether binary or in decimal notation, which can be directly understood by the computer without the help of translating program is called Machine code or Machine language program.

Computer can be programmed to understand much different computer language there is only one language understood by the computer without any translation program which: Machine code

Machine code is fundamental language of computer and is written in string of 0’s & 1’s.

An instruction prepared in any machine language has two parts:

(1) OPCODE (operation code)

(2) OPERAND (address location memory)

Advantage:

(1) Fastest execution:

A program written in machine language can be executed very fast by the computer as CPU graphs it easily.

Disadvantages:

(1) Machine dependent:

The internal design of every type of computer is different from every other     type of computer and needs different electrical signals to operate; machine language is different from computer to computer.

(2) Difficult to program:

It is necessary for the programmer either to memorize the dozens of codes for commands or to constantly refer to a reference card for preparing program the has to keep track of the storage location of data.

(3) Error prone:

As the programmer has to keep track of the storage location of data it becomes very difficult for him to concentrate fully on the logic of the problem. This results in error.

(4) Difficult to modify:

It is difficult to correct or modify machine language programs to correct it is a tedious job. Modifying a machine language program at a later date is so difficult that many programmers would prefer to code the new logic a fresh instead of incorporating the necessary modification.


what is a program and programming language?

March 14, 2011

Program:

Program is a set of well defines instructions, which are tobe process or manipulated for getting predefined and meaningful output.

Programming language:

All computer languages can be classified in the following three broad categories:

(a) Machine language

(b) Assembly language

(c) High level language


What is the operating system? Why it is required?

March 13, 2011

It is an integrated set of programs that is used to manage the various resources and over all operations of computer system.

It is required in the form of processor management, memory management, input –output management, file management, establishment and enforcement of a job priority system.


What is meant by compilation and interpretation? How do they differ?

March 13, 2011

In compilation the compiler checks the program and locates all the errors while in interpretation the interpreter checks the program and stops when error occurs.

Compilation process requires more memory rather than interpretation


1What is machine lang.?How does machine lang. differ from the high level lang.?

March 13, 2011

The set of instructions codes, whether binary or in the decimal notation, which can be directly understood by the computer without the help of translating program is called machine code or machine language.

It differs the higher level language because of the following reasons:

It has the fastest execution.

It is machine dependent.

It is more error prone rather than higher level language.

It is difficult to program and manage rather than high level language.


Gardi Immaculate ’11

March 12, 2011

-> Immaculate 2011 – Registration Form


5 basic operations performed by computer system

March 12, 2011
  • Inputting
  • Storing
  • Processing
  • Outputting
  • Controlling
  • The internal structure of a computer looks like above:

    Input unit:

    Input unit links the external environment with the computer system. Data and instruction must be entered to the computer before performing any competition. Data or instructions can be entered through input devices

    eg. Key board, or any other input devices.

    Input unit transferred this data into binary coded in short input unit performs the following function:

  • It accepts data or instructions from external world.
  • It converts these instructions and data in computer acceptable form.
  • It supplies the converted instruction & data to the computer for further processing.
  • Output unit:

    The job of output unit it is just the viewers of that any input unit it provides information reasons of computation to the output of the world. Output unit links the computer with the external world. A computer prepares results in binary code. Output unit converts these results into human acceptable forms. Inshort perform the following functions.

  • It accepts the result produced by the computer.
  • It converts these coded results to human acceptable form.
  • It supplies the converted to the outside world.
  • Storage unit:

    Before actual processing start, data & instructions entered to the computer must be stored inside the computer. Similarly, results produced by the computer are required to be stored before being passed to the output unit. The intermedial result produced by the computer must also be stored for further processing. Inshort the function of storage unit:

    • It stores all the data to be process.
    • It stores intermedial results.
    • It stores final result are realize an output device.

    ALU:

    ALU is the place where actual execution of the instructions takes places during the processing operations. All calculations & comparisons are made in the ALU. The data and instructions stored in the primary storage are transphered as where required. Intermedial results are also transphered back to the ALU for the final processing. After completion of processing the final results are send to storage units from ALU.

    Number of arithmetic & logical operation that a computer can perform is determined by the design to perform the four basic arithmetic operations. They are +,-,*,/. The logic operations like <,=,>.

    Control unit:

    ALU dose not know what should be done with the data likewise, output unit dose not know when the result should be displayed. By selecting, interning and seeing to the execution of the program the CU is able to maintain order and direct the operations of the entire system CU doesn’t perform any actual processing on data yet it is known as a central nervous system for the comforts of the computer.

    It manages co-ordinates the entire system.

    


    What is Object Oriented Programming?

    September 14, 2010

    Object

    An object is a region of storage that defines both state & behavior.

    State
    is represented by a set of variables & the values they contain.

    Behavior
    is represented by a set of methods & the logic they implement.
    Thus, an object is a combination of a data & the code that acts upon it.
    Objects are instance of a class.
    Objects are the basic runtime entities in an object-oriented system.
    Object  take  up  space  in  memory  and  have  an  associated  address  like  a  record  in
    Pascal or structure in C.
    The arrangement of bits or the data in an object’s memory space dete rmines  that
    object’s state at given moment
    Objects are runtime instance of some class.
    For Example:
    Person p1,p2;
    p1 = new person();
    p2 = new person();

    Class
    A class is a template from which objects are created. That is objects are instance of a
    class.
    When you create a class, you  are creating a new data-type. You can  use this type to
    declare objects of that type.
    Class defines structure and behavior (data & code) that will be shared by a   set
    of objects