2. Computer
• The word computer comes from the word “compute” , which means,
“to calculate”
• Thereby, a computer is an electronic device that can perform
arithmetic operations at high speed
• A computer is also called a data processor because it can store,
process, and retrieve data whenever desired
• The activity of processing data using a computer is called data
processing
• Data is raw material used as input and information is processed data
obtained as output of data processing
4. Characteristics of computers
1. Automatic
2. Speed
3. Accuracy
4. Diligence
5. Versatility
6. Memory
7. No IQ
8. No feelings
9. Power of remembering
5. Evolution of computers
• Blaise Pascal invented the first mechanical adding machine in 1642
• Baron Gottfried Wilhelm von Leibniz invented the first calculator for
multiplication in 1671
• Keyboard machines originated in the United States around 1880
• Around 1880, Herman Hollerith came up with the concept of punched
cards that were extensively used as input media until late 1970s
• Charles Babbage is considered to be the father of modern digital
computers
• He designed “Difference Engine” in 1822
• He designed a fully automatic analytical engine in 1842 for performing
basic arithmetic functions
• His efforts established a number of principles that are fundamental to the
design of any digital computer
6. Some well known early computers
• The Mark I Computer (1937-44)
• The Atanasoff-Berry Computer (1939-42)
• The ENIAC (1943-46)
• The EDVAC (1946-52)
• The EDSAC (1947-49)
• Manchester Mark I (1948)
• The UNIVAC I (1951)
7. Computer languages
• Computer language or programming language is a language acceptable to a
computer system and the process of writing instructions in such a language is
known as programming or coding
• Language is a means of communication. We use natural language such as
English to communicate our ideas and emotions to others. Similarly, a
programmer use a computer language to instruct a computer what he/she
wants it to it
• Every natural language has a systematic method of using the words and
symbols in that language defined by the grammar rules of the language.
Similarly, we need to use the words and symbols of a computer language as per
the set rules, known as syntax rules of the language.
• Classification of computer language
1. Machine language
2. Assembly language
3. High level language
8. Machine language
• It is the only language that the system understands without using a
translation program
• It is written as strings of 1’s and 0’s (eg- 101100111111010011101100)
• Circuitry of the computer recognize the machine language instructions
and converts them into electrical signals
• It has 2 part format
• Opcode – tells the computer what function to perform
• Operand – where to find/store the data on which computer has to
perform operation.
OPCODE OPERAND
9. • Every computer has a set of operation codes, called, instruction set
• Typical operations included in the instruction set of computer is;
1. Arithmetic operation
2. Logical operation
3. Branch operations
4. Data movement operations for moving data between memory and
registers
5. Data movement operations for moving data between input devices
to memory and memory to output devices
• We can also write it using decimal digits if the computers circuitry
permits it
10. • Disadvantages of machine language
1. Machine dependent
2. Difficult to program
3. Error prone
4. Difficult to modify
• Advantage
1. Can be executed very fast
11. Assembly language
• A language that allows use of letters and symbols instead of numbers
for representing instructions and storage locations is called Assembly
language or symbolic language
• A program written in assembly language is called assembly language
program or symbolic program
• It uses Alphanumeric mnemonic codes (eg; ADD, SUB)
• It provides additional instructions called pseudo instructions
• We must convert assembly language program into its equivalent
machine language before executing it on the computer
12. Assembler
• It is a system software supplied by the computer manufacturer
• Translate the assembly language into machine language
• It also assembles the machine language program in main memory and
makes it ready for execution
• Once the system obtains the object code, it can execute it as many
times as required
ASSEMBLER
Assembly language program(I/P) Machine language program
(source program) (object program)
13. Advantages of assembly language
• Easier to understand and use
• Easier to locate and correct errors
• Easier to modify
• Easily relocatable
Disadvantages
• Machine dependent
• Knowledge of hardware required
• Machine level coding(time consuming & difficult)
14.
15. High level language(HLL)
• It enables the programmers to write instructions using English words
and familiar mathematical symbols and expressions
• They are machine independent
• They do not require programmers to know anything about the
internal structure of the computer
• We need a translation program called, compiler, to convert HLL into
machine language
COMPILER
High level language
Machine language
16. • It requires separate compilers for each programming language
• For example, a FORTRAN compiler can translate only source programs
written FORTRAN
21. LANGUAGE TRANSLATORS
• A translator is a program that converts source code into object code.
• Translators are needed to translate programs written in high level
languages into the machine code that a computer understands
• Generally, there are three types of translator: compilers. interpreters.
assemblers.
1. Compiler
• A compiler takes the source code as a whole and translates it into object
code all in one go. Once converted, the object code can be run unassisted
at any time. This process is called compilation.
• Compiler translate a complete source program into machine code .
• The whole source code file compiled in one go and a complete compiled
version of the file is produced.
23. • The input to an interpreter is a source program, but unlike a
compiler its output is the result of program execution instead of
object program.
• Repeated interpretation(translation + execution)of a program is
necessary for its repeated execution
27. Features of good language
1. Simplicity – a good programming language must be simple and easy to
learn and use
2. Naturalness – it should provide appropriate operators, data structures,
control structures and natural syntax to facilitate programmers to code
their problems easily and efficiently.
3. Abstraction – abstraction means the ability to define and then use
complicated operations in ways that allows programmers to ignore many
of the details
4. Efficiency – a good programming language should enable a computer
system to translate it into machine code efficiently, execute it efficiently,
and manage it with less memory space
5. Structured programming support - a good programming language should
allow the programmers to write their programs based on the concepts of
structured programming
28. 6. Compactness – in a good programming language, programmers should
be able to express the intended operations concisely without losing
readability
7. Locality - A good programming language should be such that while
writing a program a programmer need not jump around visually as
he/she prepares the text of the program
8. Extensibility - A good programming language should also allow
extension through simple, natural, and elegant mechanism
9. Suitability to its environment – In addition to being suitable to its
application area, a good programming language must also be suitable to
its operating environment.