By
Mrs. Venkata Sushma Chinta
Assistant Professor
Mechanical Engineering Department
CBIT.
Difference between a calculator and computer
Difference between a calculator and computer
************************************************************************************
Computer Calculator
************************************************************************************
1. Computer is an electronic machine 1. Calculator is device used to
which can accept input, Process data and do basic Mathematics
gives desires result as Output operations.
2. Computer has a temporary and 2. Calculator has a Temporary
Permanent memory . Memory.
3.Computer can be used to 3. Calculator cannot be used
to send messages, email, text ,Video for communication
Chatting. purposes.
4. Computer Can support Graphics. 4. It cannot support Graphics.
5.Computer Can be used with Gadgets 5. Calculator cannot support
like Pen drive, Speakers, Printers,Projector. gadgets.
6.Computer screen can show Images 6.Calculator shows only
Video and Number. Numbers.
Program:
A program is a set of logically related instruction that are arranged in a
sequence that directs the computer in solving a problem.
Programming:
The process of writing a program is called programming.
Programming Language
To communicate with computers, programmers need a language is called
Programming language.
Machine language (1st Generation language)
Advantages:
As CPU directly understand machine instructions it takes less execution time.
Disadvantages:
It is not user-friendly language.
The binary code is very difficult to learn and use.
Difficult to understand, modify and debug errors.
Difficult to remember machine instructions.
Machine dependent
Machine language is a collection of binary digits or bits that the computers reads and
interprets.
Assembly Language
In Assembly language symbols such as letters , digits or special characters are
used as a part of instructional code. Such a representation is called Mnemonics
codes.
It is also called second generation language.
Sum of two numbers
Program in Assembly Language
A 7
B 10
A 17
By using mnemonics like LD,ADD the readability of the program increased
significantly
LD A,7
LD B,10
ADD A,B
Program in Machine Language
Mnemonics
Machine code
0011 1100
0000 0111
0000 0110
0000 1010
1000 0000
An assembler (translator) is needed:
to translate an assembly language program in to object code.
Program
In Assembly
Language
(Source Code)
Assembler
Object
code
In Machine
Language
Assembler
Assembly language (2nd Generation language)
Advantages:
Writing program in assembly language is more convenient than writing program in Machine
language.
Disadvantages:
Assembly Language is Machine dependent (Not portable).
Programmer should know the logical structure of the computer.
The programming is difficult and time consuming.
Assembly
Language
Machine
Language
Low level
Language
Machine and Assembly languages are referred to as low-level languages since the
coding for a problem is dependent on the internal architecture of the processor.
High level language
• High level language have instructions that are similar to human language.
• High level language have a set of grammar that makes it easy for a programmer
to write programs and identify errors in them.
Sum of two numbers (In BASIC language)
Program statement:
LET X=7
LET Y=10
LET SUM=X+Y
PRINT SUM
END
A compiler (translator) is needed:
To translate a program in high level language to object code in machine
Language
Source
Program in
High
level
Compiler
Object
code
In Machine
Language
Compiler
Compiler and interpreter have different approaches to translate.
Compiler
• Compiler scans the entire program and
translates the whole of it into machine code
at once.
• A compiler takes a lot of time to analyze the
source code. However, the overall time taken
to execute the process is much faster.
• Compliers are used by programming
languages like C and C++ for example.
Interpreter
• Interpreter translates just one statement of
the program at a time into machine code.
• An interpreter takes very less time to analyze
the source code. However, the overall time to
execute the process is much slower.
• Interpreters are used by programming
languages like Ruby and Python.
High level language (3GL)
Advantages:
• Readability
• Portability
• Easy debugging
• Used in the development of software.
Examples: C, C++, Java, LATEX, MATLAB, COBOL, FORTRAN
Classification of Programming language
i. Procedural Oriented programming language
• It divides a program into small procedures called routines or functions.
• it helps programmers to easily track the program flow
• code can be reused in different parts of the program.
• Follow Top-down approach
Example: C, FORTRAN, Basic, Pascal, etc.
ii. Object-Oriented Programming language
• Object-Oriented Programming (OOP) language is based upon the objects.
• In this programming language, programs are divided into small parts called
objects.
• It is used to implement real-world entities like inheritance, polymorphism, abstraction,
etc in the program to makes the program reusable, efficient, and easy-to-use.
• OOP is faster and easier to execute, maintain, modify, as well as debug.
• Bottom-up approach
• Example: C++, Java, Python, C#, etc.
iii. Natural language
• Natural language is a part of human languages such as English, Russian, German,
and Japanese.
• The main advantage of natural language is that it helps users to ask questions in any
subject and directly respond with in seconds.
• It is used by machines to understand, manipulate, and interpret human's language.
• It is used by developers to perform tasks such as translation, automatic
summarization, Named Entity Recognition (NER), relationship extraction, and
topic segmentation.
C language
The C Language is developed by Dennis Ritchie for creating system applications that directly interact with
the hardware devices such as drivers, kernels, etc.
C programming is considered as the base for other programming languages, that is why it is known as
mother language.
It can be defined by the following ways:
1. Mother language
2. System programming language
3. Procedure-oriented programming language
4. Structured programming language
5. Mid-level programming language
Creating and Running Programs Computer hardware understands
a program only if it is coded in its
machine language.
It is the job of the programmer to
write and test the program.
There are four steps in this process:
(1)writing and editing the program,
(2) compiling the program,
(3) linking the program with the
required library modules, and
(4) executing the program.
Compiling and executing High level Language programs
A linker is special program that combines several object files, and libraries to
form a single executable program.
Loaders are a part of operating system that brings an executable file residing
on disk in to memory starts it running
• Suggested Reading:
1. M.T.Somashekar“ProblemSolvingwithC”,2nd Edition,PrenticeHallIndiaLearningPrivateLimited2018
2. AKSharma“ComputerFundamentalsandProgramming”, 2nd Edition,UniversityPress, 2018
3. PradeepDeyandManasGhosh, “ProgramminginC”,OxfordPress,2ndEdition, 2017
• References:
1. ByronGottfried, Schaum’s”Outline ofProgramming withC”,McGraw- Hill.
2. Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, Prentice Hall of India.
3. E. Balaguruswamy, Programming inANSI C, Tata McGraw-Hill.
4. ReemaTharaja “Introduction to C Programming”, Second Edition, OXFORD Press, 2015.
5. https://www.tutorialspoint.com/cprogramming/index.htm.
6. https://onlinecourses.nptel.ac.in/noc18-cs10/preview.

Programming languages

  • 1.
    By Mrs. Venkata SushmaChinta Assistant Professor Mechanical Engineering Department CBIT.
  • 2.
    Difference between acalculator and computer
  • 3.
    Difference between acalculator and computer
  • 4.
    ************************************************************************************ Computer Calculator ************************************************************************************ 1. Computeris an electronic machine 1. Calculator is device used to which can accept input, Process data and do basic Mathematics gives desires result as Output operations. 2. Computer has a temporary and 2. Calculator has a Temporary Permanent memory . Memory. 3.Computer can be used to 3. Calculator cannot be used to send messages, email, text ,Video for communication Chatting. purposes. 4. Computer Can support Graphics. 4. It cannot support Graphics. 5.Computer Can be used with Gadgets 5. Calculator cannot support like Pen drive, Speakers, Printers,Projector. gadgets. 6.Computer screen can show Images 6.Calculator shows only Video and Number. Numbers.
  • 5.
    Program: A program isa set of logically related instruction that are arranged in a sequence that directs the computer in solving a problem. Programming: The process of writing a program is called programming. Programming Language To communicate with computers, programmers need a language is called Programming language.
  • 8.
    Machine language (1stGeneration language) Advantages: As CPU directly understand machine instructions it takes less execution time. Disadvantages: It is not user-friendly language. The binary code is very difficult to learn and use. Difficult to understand, modify and debug errors. Difficult to remember machine instructions. Machine dependent Machine language is a collection of binary digits or bits that the computers reads and interprets.
  • 9.
    Assembly Language In Assemblylanguage symbols such as letters , digits or special characters are used as a part of instructional code. Such a representation is called Mnemonics codes. It is also called second generation language.
  • 10.
    Sum of twonumbers Program in Assembly Language A 7 B 10 A 17 By using mnemonics like LD,ADD the readability of the program increased significantly LD A,7 LD B,10 ADD A,B Program in Machine Language Mnemonics Machine code 0011 1100 0000 0111 0000 0110 0000 1010 1000 0000
  • 11.
    An assembler (translator)is needed: to translate an assembly language program in to object code. Program In Assembly Language (Source Code) Assembler Object code In Machine Language Assembler
  • 12.
    Assembly language (2ndGeneration language) Advantages: Writing program in assembly language is more convenient than writing program in Machine language. Disadvantages: Assembly Language is Machine dependent (Not portable). Programmer should know the logical structure of the computer. The programming is difficult and time consuming.
  • 13.
    Assembly Language Machine Language Low level Language Machine andAssembly languages are referred to as low-level languages since the coding for a problem is dependent on the internal architecture of the processor.
  • 14.
    High level language •High level language have instructions that are similar to human language. • High level language have a set of grammar that makes it easy for a programmer to write programs and identify errors in them.
  • 15.
    Sum of twonumbers (In BASIC language) Program statement: LET X=7 LET Y=10 LET SUM=X+Y PRINT SUM END
  • 16.
    A compiler (translator)is needed: To translate a program in high level language to object code in machine Language Source Program in High level Compiler Object code In Machine Language Compiler
  • 17.
    Compiler and interpreterhave different approaches to translate. Compiler • Compiler scans the entire program and translates the whole of it into machine code at once. • A compiler takes a lot of time to analyze the source code. However, the overall time taken to execute the process is much faster. • Compliers are used by programming languages like C and C++ for example. Interpreter • Interpreter translates just one statement of the program at a time into machine code. • An interpreter takes very less time to analyze the source code. However, the overall time to execute the process is much slower. • Interpreters are used by programming languages like Ruby and Python.
  • 18.
    High level language(3GL) Advantages: • Readability • Portability • Easy debugging • Used in the development of software. Examples: C, C++, Java, LATEX, MATLAB, COBOL, FORTRAN
  • 19.
  • 20.
    i. Procedural Orientedprogramming language • It divides a program into small procedures called routines or functions. • it helps programmers to easily track the program flow • code can be reused in different parts of the program. • Follow Top-down approach Example: C, FORTRAN, Basic, Pascal, etc.
  • 21.
    ii. Object-Oriented Programminglanguage • Object-Oriented Programming (OOP) language is based upon the objects. • In this programming language, programs are divided into small parts called objects. • It is used to implement real-world entities like inheritance, polymorphism, abstraction, etc in the program to makes the program reusable, efficient, and easy-to-use. • OOP is faster and easier to execute, maintain, modify, as well as debug. • Bottom-up approach • Example: C++, Java, Python, C#, etc.
  • 22.
    iii. Natural language •Natural language is a part of human languages such as English, Russian, German, and Japanese. • The main advantage of natural language is that it helps users to ask questions in any subject and directly respond with in seconds. • It is used by machines to understand, manipulate, and interpret human's language. • It is used by developers to perform tasks such as translation, automatic summarization, Named Entity Recognition (NER), relationship extraction, and topic segmentation.
  • 23.
    C language The CLanguage is developed by Dennis Ritchie for creating system applications that directly interact with the hardware devices such as drivers, kernels, etc. C programming is considered as the base for other programming languages, that is why it is known as mother language. It can be defined by the following ways: 1. Mother language 2. System programming language 3. Procedure-oriented programming language 4. Structured programming language 5. Mid-level programming language
  • 24.
    Creating and RunningPrograms Computer hardware understands a program only if it is coded in its machine language. It is the job of the programmer to write and test the program. There are four steps in this process: (1)writing and editing the program, (2) compiling the program, (3) linking the program with the required library modules, and (4) executing the program.
  • 25.
    Compiling and executingHigh level Language programs A linker is special program that combines several object files, and libraries to form a single executable program. Loaders are a part of operating system that brings an executable file residing on disk in to memory starts it running
  • 26.
    • Suggested Reading: 1.M.T.Somashekar“ProblemSolvingwithC”,2nd Edition,PrenticeHallIndiaLearningPrivateLimited2018 2. AKSharma“ComputerFundamentalsandProgramming”, 2nd Edition,UniversityPress, 2018 3. PradeepDeyandManasGhosh, “ProgramminginC”,OxfordPress,2ndEdition, 2017 • References: 1. ByronGottfried, Schaum’s”Outline ofProgramming withC”,McGraw- Hill. 2. Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, Prentice Hall of India. 3. E. Balaguruswamy, Programming inANSI C, Tata McGraw-Hill. 4. ReemaTharaja “Introduction to C Programming”, Second Edition, OXFORD Press, 2015. 5. https://www.tutorialspoint.com/cprogramming/index.htm. 6. https://onlinecourses.nptel.ac.in/noc18-cs10/preview.

Editor's Notes

  • #9 Language is a mode of communication that is used to share ideas, opinions with each other. Long ago people used to remember the  computer code in binary format. That time there is no concept of programming languages. They have to write the program in machine understandable language. I.e., 0 and 1.You can imagine how hard it is to remember the code and write  that code.
  • #11 1GL
  • #18 The time and cost of creating machine and assembly language programs were quite high. This motivated the development of high level languages.
  • #21 A compiler always generates an intermediary object code. It will need further linking. Hence more memory is needed.. An interpreter does not generate an intermediary code. Hence, an interpreter is highly efficient in terms of its memory. A compiler generates the error message only after it scans the complete program and hence debugging is relatively harder while working with a compiler. An interpreter Keeps translating the program continuously till the first error is confronted. If any error is spotted, it stops working and hence debugging becomes easy.
  • #26 Email filters, Smart assistants, Search results, Predictive text, Language translation, Digital phone calls, Data analysis, Text analytics