INTRODUCTION TO
PROGRAMMING
Week 1
Topic
Definition of Programming Language
Types of programming language
Definition of Programming Language
Coded language used by programmers to write instructions that a
computer can understand to do what the programmer (or the
computer user) wants.
The most basic (called low-level) computer language is the machine
language that uses binary ('1' and '0') code which a computer can run
(execute) very fast without using any translator or interpreter
program, but is tedious and complex.
 The high-level languages (such as Basic, C, Java) are much simpler
(more 'English-like') to use but need to use another program (a
compiler or an interpreter) to convert the high-level code into the
machine code, and are therefore slower.
Definition of Programming Language
A programming language is a special
language programmers use to develop software
programs, scripts, or other sets of instructions for computers to
execute.
A language used to write instructions for the computer. It lets
the programmer express data processing in a symbolic manner
without regard to machine-specific details.
A programming language is an artificial language that can be
used to control the behavior of a machine, particularly a
computer
Types of programming language
1. Machine Language
2. Assembly Language
3. High level Language
Types of programming language
1. Machine Language
The fundamental language of the computer’s processor, also
called Low Level Language.
Also known as machine code or object code, is the elemental
language of computers.
Machine language is the only language a computer is
capable of understanding.
All programs are converted into machine language before
they can be executed.
Types of programming language
1. Machine Language
Consists of combination of 0’s and 1’s that represent high
and low electrical voltage.
Machine language is a collection of binary digits or bits that
the computer reads and interprets.
Programming language that can be directly understood and
obeyed by a machine (computer) without conversion
(translation).
machine languages are almost impossible for humans to use
because they consist entirely of numbers.
Types of programming language
1. Machine Language
 Example: check if low-order 4 bits of value in reg 1 = 0
2000 load load zero into reg 0
220F load load string 00001111 into reg 2
8312 AND c(reg 1) AND c(reg 2) —> reg 3 — masking
B3XY JMP jump to address XY if c(reg 3) = c(reg 0)
Types of programming language
2. Assembly Language
Assembly language is a low-level language for programming
computers.
It is similar to machine language.
Uses symbolic operation code to represent the machine
operation code.
Low-level languages are sometimes described as being
"close to the hardware."
Types of programming language
2. Assembly Language
of the numeric machine codes and otheIt implements a symbolic
representation r constants needed to program a particular CPU
architecture.
A utility program called an assembler, is used to translate assembly
language statements into the target computer's machine code.
assembly language is a low-level programming language for
microprocessors and other programmable devices.
Programs written in assembly language are converted into machine
language by specialized programs called assemblers or compilers for
their execution by the machine (computer).
Types of programming language
2. Assembly Language
Example : Add 2 numbers
name "add"
mov al, 5 ; bin=00000101b
mov bl, 10 ; hex=0ah or bin=00001010b
add bl, al ; 5 + 10 = 15 (decimal) or hex=0fh or
bin=00001111b
Types of programming language
3. High Level Language
Computer (programming) languages that are easier to learn.
Uses English like statements
High-level languages are relatively easy to learn because the
instructions bear a close resemblance to everyday language, and
because the programmer does not require a detailed knowledge of
the internal workings of the computer.
Each instruction in a high-level language is equivalent to several
machine-code instructions, therefore it is more compact than
equivalent low-level programs.
Types of programming language
3. High Level Language
high-level language is a computer programming language that
isn't limited by the computer, designed for a specific job, and is
easier to understand.
It is more like human language and less like machine language.
For a computer to understand and run a program created with a
high-level language, it must be compiled into machine language.
High-level languages are used to solve problems and are often
described as problem-oriented languages
Types of programming language
3. High Level Language
Example : C++ Add 2 numbers
#include<iostream> //header files
Void main()
{
int a, b, c; // declaration of 3 variables
cout <<“Enter two numbers:n”;
cin >>a; // read 1st number
cin >>b; // read 2nd number
c = a+b; // compute the sum
cout <<“Sum of 2 numbers is {0}”, c); //print sum
}

week 1 - INTRO TO PROGRAMMING.pptx

  • 1.
  • 2.
    Topic Definition of ProgrammingLanguage Types of programming language
  • 3.
    Definition of ProgrammingLanguage Coded language used by programmers to write instructions that a computer can understand to do what the programmer (or the computer user) wants. The most basic (called low-level) computer language is the machine language that uses binary ('1' and '0') code which a computer can run (execute) very fast without using any translator or interpreter program, but is tedious and complex.  The high-level languages (such as Basic, C, Java) are much simpler (more 'English-like') to use but need to use another program (a compiler or an interpreter) to convert the high-level code into the machine code, and are therefore slower.
  • 4.
    Definition of ProgrammingLanguage A programming language is a special language programmers use to develop software programs, scripts, or other sets of instructions for computers to execute. A language used to write instructions for the computer. It lets the programmer express data processing in a symbolic manner without regard to machine-specific details. A programming language is an artificial language that can be used to control the behavior of a machine, particularly a computer
  • 5.
    Types of programminglanguage 1. Machine Language 2. Assembly Language 3. High level Language
  • 6.
    Types of programminglanguage 1. Machine Language The fundamental language of the computer’s processor, also called Low Level Language. Also known as machine code or object code, is the elemental language of computers. Machine language is the only language a computer is capable of understanding. All programs are converted into machine language before they can be executed.
  • 7.
    Types of programminglanguage 1. Machine Language Consists of combination of 0’s and 1’s that represent high and low electrical voltage. Machine language is a collection of binary digits or bits that the computer reads and interprets. Programming language that can be directly understood and obeyed by a machine (computer) without conversion (translation). machine languages are almost impossible for humans to use because they consist entirely of numbers.
  • 8.
    Types of programminglanguage 1. Machine Language  Example: check if low-order 4 bits of value in reg 1 = 0 2000 load load zero into reg 0 220F load load string 00001111 into reg 2 8312 AND c(reg 1) AND c(reg 2) —> reg 3 — masking B3XY JMP jump to address XY if c(reg 3) = c(reg 0)
  • 9.
    Types of programminglanguage 2. Assembly Language Assembly language is a low-level language for programming computers. It is similar to machine language. Uses symbolic operation code to represent the machine operation code. Low-level languages are sometimes described as being "close to the hardware."
  • 10.
    Types of programminglanguage 2. Assembly Language of the numeric machine codes and otheIt implements a symbolic representation r constants needed to program a particular CPU architecture. A utility program called an assembler, is used to translate assembly language statements into the target computer's machine code. assembly language is a low-level programming language for microprocessors and other programmable devices. Programs written in assembly language are converted into machine language by specialized programs called assemblers or compilers for their execution by the machine (computer).
  • 11.
    Types of programminglanguage 2. Assembly Language Example : Add 2 numbers name "add" mov al, 5 ; bin=00000101b mov bl, 10 ; hex=0ah or bin=00001010b add bl, al ; 5 + 10 = 15 (decimal) or hex=0fh or bin=00001111b
  • 12.
    Types of programminglanguage 3. High Level Language Computer (programming) languages that are easier to learn. Uses English like statements High-level languages are relatively easy to learn because the instructions bear a close resemblance to everyday language, and because the programmer does not require a detailed knowledge of the internal workings of the computer. Each instruction in a high-level language is equivalent to several machine-code instructions, therefore it is more compact than equivalent low-level programs.
  • 13.
    Types of programminglanguage 3. High Level Language high-level language is a computer programming language that isn't limited by the computer, designed for a specific job, and is easier to understand. It is more like human language and less like machine language. For a computer to understand and run a program created with a high-level language, it must be compiled into machine language. High-level languages are used to solve problems and are often described as problem-oriented languages
  • 14.
    Types of programminglanguage 3. High Level Language Example : C++ Add 2 numbers #include<iostream> //header files Void main() { int a, b, c; // declaration of 3 variables cout <<“Enter two numbers:n”; cin >>a; // read 1st number cin >>b; // read 2nd number c = a+b; // compute the sum cout <<“Sum of 2 numbers is {0}”, c); //print sum }