Computer Languages

Generations of Programming Languages

  • First Generation (late 1940s)
    e.g. machine language
  • Second Generation (early 1950s)
    e.g. assembly language
  • Third Generation (late 1950s through 1970s)
    e.g. high level languages like COBOL, FORTRAN, BASIC, PASCAL, APL
  • Fourth Generation (late 1970 onwards)
    e.g. new range of query languages and other tools.

Classification of languages

  • Low level
  • High level

Low Level Languages:

  • Use only primitive operations of the computer.
  • Memory and registers have to be taken into consideration before one can write programs.
  • Code is machine dependent.
  • Examples: Machine Language and Assembly Language

Machine Language

  • Computation is totally based on binary numbers; all the instructions including operations, registers, data and memory locations have to be specified in binary form.
  • Machine’s circuitry is designed to understand binary without the need of any further interpretation therefore programs are executed directly.
  • First Generation Language.
  • Instruction essentially consists of:
    Operation part: Operation to be performed by the machine, known as opcode.
    Address part: Location of data on which operation is to be performed.

Advantages of Machine Language

  • Makes most efficient use of system resources like memory, registers.
  • No need of translation; directly executable code.
  • Very high execution speed due to direct manipulation of memory and registers.

Disadvantages of Machine language

  • Non portable or machine dependent code.
  • Poor programming productivity as a programmer has to convert everything into binary.
  • Requires programmer to control use of each register and storage locations have to be addressed directly and not symbolically.
  • High level of programming skill required; increased training costs.
  • Programs written are more error prone and really difficult to debug.
  • Program size is big due to non-reusable code and use of basic operations to perform complex computations.

Assembly Language

  • Second Generation language.
  • Substitute alphabetic and numeric symbols for binary code of machine language. Mnemonics for all opcodes, registers and memory locations, providing us with a more readable code.
  • Provides a facility to write reusable code, known as macros.
    Macros has two parts: macro name and macros body(containing the instructions).
    A macros name can be called at any point in the program to use the instructions in it’s body.
  • Language translator known as Assembler is required for translating the instructions into machine language.

Advantages of Assembly Language

  • Optimal use of system resources(registers and memory) because of direct use within the program.
  • Easier to use than machine languages as programmed doesn’t need to remember/calculate binary equivalents for everything(opcode, operand, registers etc.).
  • Assembler helps in detecting programming errors.
  • Facilitates reusable code by means of macros.

Disadvantages of Assembly Language

  • Programs are not directly executable as assembler is required to translate them into machine language first.
  • Non-portable or machine dependent code.
  • Although easier than machine language, it still requires high level of programming skills.
  • Knowledge of computer architecture of that particular machine required before one can write a program.

High Level Languages

  • Procedure-oriented languages and intended to be machine independent.
  • Natural language like structures, a great advancement over mnemonics of assembly language.
  • Require translators known as compilers and interpretors.
  • Portable irrespective of system architecture.
  • Programs are written using English words and familiar mathematical symbols helping the programmers to focus on logic of problem solving rather than worrying about the technical details of the system.
    Programs are more readable.

Procedures

  • Are the reusable code which can be called at any point of the program.
  • Each procedure is defined by a name and set of instructions accomplishing a particular task.
  • The procedure can be called by its name with the list of required parameters which should pass to that procedure.

Advantages of High Level Languages

  • Easier to learn than low level languages.
  • Less time required to write programs.
  • Provide better documentation.
  • Easier to maintain programs.
  • Extensive vocabulary.
  • Libraries of subroutines can be incorporated and used in many of the programs.
  • Easier to debug as translators(compilers/interpreters) display errors with proper error messages at the time of translation.
  • Programs are largely machine independent therefore require little or no modifications to run on different system architectures.

Limitations of High Level Languages

  • Long sequence of instructions for every program.
  • Additional memory space for storing compilers and interpreters.
  • High execution time as programs written are not directly executable.

Compiler Based and Interpreter based Languages

 

 

 

Note: Incomplete.

Evolution of Computers

1450 B.C. Abacus – China

1600 A.D. Napier’s Bones

  • John Napier
  • Scottish Mathematician.
  • Bones were strips of ivory with numbers written on them.

1642 A.D. Adding Machines – France

  • Blaise Pascal
  • Scientist, Philosopher and Mathematician.
  • He only nineteen years old when he invented this machine.
  • Pascaline was the name of the machine and it worked with clockwise gears and levers.
  • The machine was capable of addition and subtraction only.
  • To honour him, programming language Pascal was named after him.

1692 A.D. Multiplying Machine – Germany

  • Gottfried von Leibniz
  • Improved upon Pascal’s machine and introduced a mechanism to carry out
    automatic multiplication.
  • He is best know for his work with Isaac Newton in developing a branch of mathematics which we know as calculus.
  • This device was capable of performing addition, subtraction,
    multiplication and division. Could perform square root function too although
    not always accurately.

1813 A.D. Difference Engine – England

  • Charles Babbage
  • An Englishman who was working on his doctorate, need to perform complex
    calculations within given time period.
  • Invented steam powered Difference Engine which could perform complex
    calculations and print them out as well.

Early 1800s Jacquard Loom – France

  • Joseph Marie Jacquard
  • He was a weaver who developed a programmable loom.
  • It used large cards with holes punched in them to control the pattern
    automatically.
  • Others adapted the punch cards as primary form of input and they were in
    use about 30 years ago.

1862 A.D. Arithrometer – France

  • Charles Xavier Thomas
  • Invented the first calculator with with commercial prospects.
  • Won a gold medal for this inventions at the International Exhibition in
    London.
  • His machine performed addition, subtraction, multiplication, division
    and square root functions accurately.

1863 A.D. Analytical Engine – England

  • Charles Babbage
  • Conceived of a mechanism which could carry out long sequence of
    calculations under automatic control.
  • Ability to store 1000, 50 digit numbers in one second and multiply 20
    digit numbers in three minutes.
  • A form of punched cards was to be used for inputting data.
  • Plans could not be materialized due to technological limitations of that
    time.
  • First person to conceive of the “Stored Program Concept“.
  • Recognized as “the father of computers“.
  • Analytical Engine was finally developed in 1991 and is on display at
    Charles Babbage Institute at Minnesota.
  • Was accompanied by Augusta Ada Byron
    • Daughter of famous poet Lord Byron.
    • Excellent Mathematician who contributed tremendously to Babbage’s
      work.
    • First female computer scientist and programmer.
    • Computer programming language Ada has been named in her honour.

1896 A.D. Punch Card Machine – USA

  • Dr. Hermann Hollerith
  • Used cards with holes punched in them to speed up the collation job of the American Census of 1880.
  • Holes were punched through cards to indicate presence of a particular criteria in a respondent.
  • Holes punched in the card enabled wire brushes in the machine touch a metal plate which carried charge.
  • Charge was transmitted to electric counters which incremented the numbers.
  • Founded Tabulating Machine Company in 1896.
  • In 1911, Tabulating Machine Company merged with two other companies to form Computing Tabulating Recording Company.
  • Marketing expert Thomas Watson Sr. led the company and the company had a great success.
  • In 1924, the name of the company was converted to International Business Machine Corporation.

1930s Turing Machine – England

  • Alan Turing
  • He was a mathematician who published a paper in late 1930s, describing capabilities and limitations of a hypothetical general purpose computing machine “Turing Machine”.
  • Also helped in developing Robinson, the British Computer that was used to decode the messages encrypted by German Enigma Machine.
  • In 1950, he published a book “Computer Machinery and Intelligence” which proposed the “Turing Test of Artificial Intelligence” which basically explains that the computer is capable of interacting with the user.

1939 – Atanasoff Berry Computer(ABC)

  • Professor John Atanasoff accompanied by graduate student named Clifford Berry.
  • Built a special purpose electronic computer which was capable of solving problems of equations.

1944 A.D. Mark-I

  • Dr. Howard Aiken

 

Note: The list is incomplete and will be updated.

Unit 4. Processor and Memory

Have skipped some sections related to introduction/basics of CPU, CU, Registers, Interrupt etc. Might post them here sometime later.

Program Interrupts

Program Interrupt refers to the transfer of program control from a currently running program to another subroutine as a consequence of an external or internal request.

After a program has been interrupted and the service routine has been executed, the processor must return to exactly the same state that it was in, when the interrupt occured.

Types of Interrupts

  1. External Interrupts
  2. Internal Interrupts
  3. Software Interrupts

Continue reading “Unit 4. Processor and Memory”

Instruction Sets – RISC and CISC

Instruction set design includes opcode and operand specifications. Two basic categories of Instruction Set or Instruction Set Architecture are:

Reduced Instruction Set Computers(RISC)

For faster execution of instructions, instructions should be fewer in number so that they make less use of memory. The type of computers using fewer instructions and executing them at faster speed are called Reduced Instruction Set Computers.

RISC Characteristics

Continue reading “Instruction Sets – RISC and CISC”