Puter Languages

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

WELCOME TO

COMPUTER SCIENCE HUB


▪ Concepts of Hardware and Software: Computer Languages,
Language Translators, Features of good language
▪ Basics Computer Organization: Von Neumann Model, Input
Unit, Output Unit, Storage Unit, Control Unit
▪ Memory Hierarchy, Primary Storage
▪ Cache Memory
▪ Registers
▪ Secondary Storage Devices
▪ Basics of Hardware Components – SMPS, Motherboard,
Add-on Cards, Ports, Memory, Adapters, Network cables,
Basic Computer Configuration
▪ How do you think we communicate with a computer?
▪ A computer cannot understand any commands that you
may give in English or in any other language.
▪ It has its own set of instructions for communication, or what
we call computer languages
▪ The user of a computer must be able to communicate with
it.
▪ That means, he must be able to give the computer
commands and understand the output that the computer
generates.
▪ This is possible due to the invention of computer
languages.
▪ A Computer language includes various languages that are
used to communicate with a Computer machine.
▪ Basically, there are two main categories of computer
languages, namely Low Level Language and High Level
Language.
▪ Low level languages are the machine codes in which the instructions
are given in machine language in the form of 0 and 1 to a Computer
system.
▪ It is mainly designed to operate and handle all the hardware and
instructions set architecture of a Computer.
▪ The main function of the Low level language is to operate, manage
and manipulate the hardware and system components.
▪ There are various programs and applications written in low level
languages that are directly executable without any interpretation or
translation.
▪ Low level language is also divided into two parts : Machine
language and Assembly language.
▪ Machine Language is one of the low-level programming
languages which is the first generation language
developed for communicating with a Computer.
▪ It is written in machine code which represents strings of 0
and 1 binary digits inside the Computer which makes it
easy to understand and perform the operations.
▪ As we know a Computer system can recognize electric
signals so here 0 stands for turning off electric pulse and 1
stands for turning on electric pulse.
▪ It is very easy to understand by the Computer and also
increases the processing speed.
▪ The main advantage of using Machine language is that
there is no need of a translator or interpreter to translate
the code, as the Computer directly can understand.
▪ But there are some disadvantages also like you have to
remember the operation codes, memory address every
time you write a program and also hard to find errors in a
written program.
▪ It is machine dependent and can be used by a single type
of Computer.
▪ Assembly Language is the second generation
programming language that has almost similar structure
and set of commands as Machine language.
▪ Instead of using numbers like in Machine languages here
we use words or names in English forms (mnemonics)and
also symbols.
▪ The programs that have been written using words, names
and symbols in assembly language are converted to
machine language using an Assembler.
▪ Because a Computer only understands machine code
languages ,we need an Assembler that can convert the
Assembly level language to Machine language so the
Computer gets the instruction and responds quickly.
▪ The main disadvantage of this language is that it is written
only for a single type of CPU and does not run on any other
CPU.
▪ But its speed makes it the most used low level language till
today which is used by many programmers.
▪ High level languages are the most used and also more considered
programming languages that helps a programmer to read, write
and maintain.
▪ It is also the third generation language that is used and also
running till now by many programmers.
▪ They are less independent to a particular type of Computer and
also require a translator that can convert the high level language to
machine language.
▪ The translator may be an interpreter and Compiler that helps to
convert into binary code for a Computer to understand.
▪ There is various high level programming languages like C,
FORTRAN or Pascal that are less independent and also
enables the programmer to write a program.
▪ The Compiler plays an important role on the Computer as
it can convert to machine language and also checks for
errors if any before executing.
▪ There are several high level languages that were used
earlier and also now like COBOL, FORTRAN, BASIC, C, C++,
PASCAL, LISP, Ada, Algol, Prolog and Java.
▪ It is user-friendly as the programs are written in English
using words, symbols, characters, numbers that needs to
be converted to machine code for processing.
Advantages
▪ Readability
▪ Machine independent
▪ Easy debugging
▪ Easier to maintain
▪ Low development cost
▪ Easy documentation
Disadvantage
▪ Poor control on hardware
▪ Less efficient
▪ Ease of use
▪ Portability
▪ Reliability
▪ Performance
▪ Cost
▪ Promote structured programming
▪ Compact code
▪ Maintainability
▪ Reusability
▪ Standardization
1)Ease of use
▪ The language should be easy in writing code for the programming and executing
them.
▪ The ease and clarity of a language depends upon its syntax
▪ It should be clear, simple and unified set of concepts.
▪ The vocabulary of language should resemble English
2) Portability
▪ The code should be constructed such a way that it could be distributed across
multiple platforms
▪ It should be independent of any particular hardware or operating system
▪ i.e. program written on one system should be able to test in another system and
perform accurately.
3) Reliability
▪ The language should perform the intended functions in satisfactory manner
through out its lifetime.
▪ Reliability is concerned with making system failure free.
▪ Language should provide support for preventing errors.
▪ The language should also detect and report errors. There should be mechanisms
to handles these errors.
4)Performance
▪ The language should not only be capable of interacting with end users but also
with the hardware.
5) Cost
▪ Primary concern before deploying language at commercial level.
▪ It include several costs such as
▪ Program execution and translation cost ,Program creation, testing and usage cost
, Program maintenance cost
6) Promote structured programming
▪ A good language should be capable of supporting structured programming.
▪ A structured program also helps programmers to visualize the problem logical
way, thereby reducing the probability of errors in the code.
7) Compact code
▪ A language should promote compact coding.
▪ Intended operations should be coded in minimum number of lines.
▪ Large codes require more testing and developing time, thereby increasing the
cost of developing an application.
8) Maintainability
▪ Application has to be maintained regularly so that it can meet changing
requirements.
▪ Maintainability is closely related to structure of code.
▪ If the original code is written in an organized way then it would be easy to modify
or add new changes.
9) Reusability
▪ The language should facilitate the adaptation of code for use in other
applications.
▪ Code is reusable when it is independent of other codes.
10) Standardization
▪ Means the extent to which the language definition has been formally
standardized
▪ Extent to which it can be reasonably expected that this standard will
be followed in a language translator.
▪ Non standardized languages become obsolete soon, produces
inferior codes, poor developers productivity, no reliability of code
▪ Translator is a computer program that translates program written in a
given programming language into a functionally equivalent program in a
different language.
▪ A program written in high-level language is called as source code.
▪ To convert the source code into machine code, translators are needed.
▪ A translator takes a program written in source language as input and
converts it into a program in target language as output.
▪ It also detects and reports the error during translation
Types of Language Translator
▪ Assembler
▪ Compiler
▪ Interpreter
▪ Assembler is a translator which is used to translate the assembly language
code into machine language code.
Advantages of using Assembler
• Very fast in translating assembly language to machine code
• Assembly code is often very efficient (and therefore fast) because it is a low
level language
• Assembly code is fairly easy to understand due to the use of English like in
Mnemonics
Disadvantages of using Assembler
▪ Assembly language is written for a certain instruction set and/or processor.
▪ Assembly tends to be optimized for the hardware it is designed for, meaning
it is often incompatible with different hardware.
▪ Lots of assembly code is needed to do relatively simple task, and complex
programs require lots of programming time.
▪ Compiler is a translator which is used to convert programs in high-
level language to low-level language.
▪ It translates the entire program and also reports the errors in
source program encountered during the translation.
▪ Interpreter is a translator which is used to convert programs in high-level
language to low-level language.
▪ Interpreter translates line by line and reports the error once it encountered
during the translation process.
▪ It directly executes the operations specified in the source program when the
input is given by the user.
▪ It gives better error diagnostics than a compiler.
SI. Compiler Interpreter
No
1 Performs the translation of a program Performs statement by statement
as a whole. translation.

2 Execution is faster. Execution is slower.

3 Requires more memory as linking is Memory usage is efficient as no


needed for the generated intermediate object code is generated.
intermediate object code.

4 Debugging is hard as the error It stops translation when the first error
messages are generated after is met. Hence, debugging is easy.
scanning the entire program only.

5 Programming languages like C, C++ Programming languages like Python ,


uses compilers. BASIC, and Ruby uses interpreters.

You might also like