Chapter 11 Intro To Programming - 241209 - 154644
Chapter 11 Intro To Programming - 241209 - 154644
Introduction to programming
What will you learn?
Introduction to
programming
Machine Language
• 1st generation of programming language
• Directly recognize by the computer
• does not need to be translated
• Instructions usesa seriesof binary digits
• The coding is tediousand time consuming
• Ready for immediate execution or run
Machine Language
Advantages Disadvantages
🞑 ready for immediate ❑ their instructions are
execution extremely cryptic
🞑 consists of instructions and difficult to learn
that are readily ❑ programs are lengthy
understood by the ❑ machine-dependent
computer ❑ not portable
Low Level Language
Assembly Language
• 2nd generation of programming language
• Symbolic instruction codes
• Meaningful abbreviation such as A for Addition
• Usesymbolic address, meaningful name that identifies a
storage location. E.gRATErefer to storage location contains
pay rate.
• Can be difficult to be learn
• Must be converted into machine language before can execute
or run
• Translated using a translator program called assemble
Low Level Language
Assembly Language
• consists of English-like abbreviations
• Some of the instructions can be understood by
human.
• Code needs to be translated to machine language
before the computer processes it.
• Example of code
• ADD 1001010,1011010
Assembly Language
🞑 Unique to particular computer.
🞑 Easier to understand
🞑 Use mnemonics symbols. E.g. “MUL” –Multiply
Low level language: Assembly Language
Examples :
🞑 Using assembly language, instructions
wages = rates * hours
can be written as:
LOA rate
D hour
MULT wages
STOR
Low level language: Assembly Language
Advantages. Disadvantages
🞑 programs are lengthy
🞑 Programs are easier to because each assembly
learn compared to language instruction
corresponds to one machine
machine language. language instruction.
❑ machine-dependent
❑ not portable
❑ Incomprehensible to
computersuntil translated
to machine language
Low level language: Assembly Language
Writing Assembly Language
High Level Language
High-Level Languages
Have to be converted to machine-language before
they can be executed
Machine independent – can run on different types of
computers and operating systems
Instruction are coded
Programmers use this languages to write programs
High Level Language
High-Level Languages
🞑 Have to be converted to machine-language before
they can be executed
🞑 Machine independent – can run on different types of
computers and operating systems
🞑 Instruction are coded
🞑 Programmers use this languages to write programs
High Level Language
◼ Examples : FORTRAN, COBOL, BASIC, Pascal, Ada, C and C++
High Level Language
Low level vs High level language
Low Level Language High Level Language
Machine dependent / not portable Machine Independent / portable
which means each language is which means there are mostly
impossible to run on the other used to write software which
can run on multiple platforms.
Nearer to machine language Nearer to human language
Codes are difficult to Easier to learn because it
understand and learn because nearer to human language.
it nearer to machine
language.
Low level vs High level language
Low Level Language High Level Language
Appropriate for developing new Appropriate to solve the scientific problem.
operating systems or writing firmware
codes for micro- controllers
Fast to process and return the output as it nearer Slower to process because they have lot
to machine code of abstraction and layers of code before they
can reach the hardware itself
LLis challenging and requires a great deal of High level is where all the creative things
experience and knowledge take place & can be debugged in much
easier manner than in low level
Much easier to program (shorter, easier to read) Much easier to program (shorter, easier to read)
Portable Portable
Program language paradigm
Computer languages are categorized according to
the approach they use to solve a problem.
A paradigm, therefore, is a way in which computer
language looks at the problem to be solved.
Paradigm of Programming Language
Procedural