SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Computer Language
Chapter 4
Contents
• Machine language programming
• Programming process
• Programming languages
• Levels of programming languages
• Program translator
Learning Objectives
• At the end of this chapter, students should
be able to:
– Identify and utilize the programming
processes.
– Identify the different levels of programming
languages.
– Identify and differentiate the program
translators.
Machine Language Programming
Machine Language Programming
• What is programming language?
– A language for instructing computer
• What is source code?
– A complete program in such language
• What is machine language?
– The most primitive type of programming
language that computer understands
(instruction can be executed by the CPU)
Machine Language Programming
• Earliest form of programming
• Most tedious and time consuming since it
requires programmers to:
– determine the exact set of primitive machine
actions (instructions) necessary to perform
complex task
– write down each instruction in an
understandable form to the computer
Machine Language Programming
• Computer’s instruction set are defined by the set
of data manipulation and movement functions of
which the CPU is capable to perform.
• The processing functions of a typical CPU can
be classified into 3 categories:
– Computation – perform mathematical calculation
using two numbers as input and store the result
– Comparison – compare the values of two stored
numbers and determine if they are equivalent
– Data movement – move an individual item of data
from one storage location to another storage location
Machine Language Programming
High Level Language Program
Machine Language Code
Micro Steps (Micro Code)
Memory Bus System ALU etc.
HW
Decoder
Control Signal
Language Processing
Translation from SW to HW
Programming Process
Programming Process
• What is programming Language?
– A set of rules that provide a way of telling a
computer what operations to perform.
• What is program?
– Set of step-by-step instructions that direct the
computer to do the task users want it to do
and produce the results.
Programming Process
• Programming process includes:
– define the problems
– plan the solution
• through developing an algorithm that includes the
flowchart and pseudo-code
– coding the program
– test the program
– document the program
Programming Process
• Defining a problem:
– Programmer meets users of the client
organization or system analyst will analyze
the problems.
– Written agreement is produced.
– Items of input, process and output are being
identified.
Programming Process
• Planning the solution
– Most common way of planning is by having
flow charts or write pseudo-code
– Flowchart is a pictorial diagram of an ordered
step by step solution to a problem
Programming Process
Process
Decision
Connector
Start or Stop Program
Input or Output
Direction of Flow
ANSI Standard Flow Chart Symbols
Programming Process
Example of simple flow
chart – of what to do if a
lamp doesn’t work
Programming Process
• Planning the solution
– Pseudo-code is an English-like language that
states the solution with more precision in
English but less precision than is required
when using a formal language.
– Example:
if credit card number is valid
execute transaction based on number and order
else
show a generic failure message
end if
Programming Process
• Coding the programs
– The programmer translate the logic from the flow
chart or pseudo-code to a programming language or
source code
– The programmer has to know the syntax and the
format of writing the programming
Programming Process
• Testing the program
– Involve the desk-checking, the translating, and the
debugging phases.
• Desk-checking involves a programmer sitting down to
proof-read a program.
• Translating involves a translator – using compiler or
interpreter (a program that translates the instruction into a
form the computer can understand).
• Debugging involves detecting, locating, and correcting bug
or mistakes or errors by running the program.
Programming Process
• Documenting the program
– Is necessary and is an ongoing process.
– Documentation is a written detail descriptions of the
programming cycle and specific facts about the
program.
– Typical program documentation materials include:
• The origin and the nature of the problem.
• A brief narrative description of the program.
• Logic tools such as flowcharts, pseudo-codes and/or flow
charts.
• Data record descriptions
• Program listings and testing results.
Programming Languages
Programming Languages
• Programming languages are said to be lower
(closer to the computer) or higher (closer to
people/users).
• There are five generations of programming
languages to be enlisted from the lowest to the
highest levels, which are:
– Machine language.
– Assembly language.
– High-level language (HLL).
– Very high-level language (VHLL).
– Natural language.
Programming Languages
Higher
Lower
Machine
Users
Programming Languages
• Machine language
– The lowest level of language
– Represents data as 1s and 0s (binary digits
corresponding to the “on” and “off” electrical
states (switching actions) in a computer.
Programming Languages
• Assembly language
– Uses mnemonic codes
– Mnemonic codes are abbreviations that are easy to
remember and to replace the machine language
numbers
– Even though not in English words, they are still
convenient and are preferable than numbers alone.
– Uses an assembler program to turn its program into
a machine language.
– Has disadvantages such as vary by machine,
extremely detail, making programming becomes
repetitive, tedious and prone to making errors.
Programming Languages
• High-level Language (HLL)
– More English-like – thus making it more
convenient
– FORTRAN (FORmula TRANslator) is the 1st
HLL
– Other examples of HLL are COBOL, BASIC,
ALGOL, APL, FORTH, LISP, LOGO, Modula-
2, PILOT, PLI, PROLOG and RPG.
Programming Languages
• Very high-level language (VHLL)
– Known as a 4th generation language (4GL)
– Usually nonprocedural (user need to write only
“what” is to be done but not “how”.
– A procedural language tells the computer how a task
is done (a very specific step-by-step process)
– Advantages - increase productivity, require minimal
training and allow users to be unconcern about the
HW or program structure.
Programming Languages
• Natural language
– Is named because of its resemblance to spoken
English.
– Referred to as knowledge-based language due to
its usage in interacting with a base of knowledge on
some subject, resulting in a knowledge-based
system (KBS), such as an expert system.
– Natural language excel at easy data access
– This has evolved into a language namely structured
query language (SQL).
Programming Languages
• Object-oriented programming (OOP)
– A group of languages : called object-oriented
language (OOL) group.
– OOL is based on a more active, visual programming
environment.
– Structured languages treat data and tasks
(instructions) separately.
– OOL views data and tasks together for each object
(entity that may be grouped in classes and contains
its own code).
– Current examples OOP languages are Object Logo,
JAVA, C++, Turbo Pascal, and SmallTalk.
Programming Languages
• Hybrid object-based programming
languages
– Are visual in a manner similar to OOP language but
lack certain features.
– The 1st hybrid language : HyperCard (Macintosh)
– Some object-based hybrids are classified as visual
programming languages because they are
distinguished by the ability to build programs
connecting links between various objects.
– Current examples of visual programming languages
are Object Vision and Visual Basic (VB).
Program Translator
Program Translator
• What is program translator?
– A program that transform/translate source
code into machine readable code.
• There are 3 types of program translator:
– Assembler
– Compiler
– Interpreter
Program Translator
• Assembler
– A program that translates the instruction
(assembly language code) into a form that
computer can understand (machine language
code).
MOV AX, 0005
ADD AX, 0010
ADD AX, 002
MOV [0120], AX
INT 20
Assembler
Output File
1011100000000101000000
0000000101000100000000
0000000001010010000000
0000001010001100100000
Symbolic
program
Binary
program
Program Translator
ADD AX, 0010 05 10,00
Opcode in
Assembly
Language
Operand1
Operand2
Opcode in
Machine
Language
Operand1
Operand2
Notes that:
ADD translated into
05 AX translated into
000010 translated into
1016
Assembly Language
Machine Language (Binary) Machine Language
(Hexadecimal)
MOV AX,0005 10111000 00000101 00000000 B8 05 00
ADD AX,0010 00000101 00010000 00000000 05 10 00
ADD AX,0020 00000101 00100000 00000000 05 20 00
MOV [0120],AX 10100011 00100000 00000001 A3 20 01
INT 20 11001101 00100000 CD 20
Program Translator
• Compiler
– A compiler translates a program in a
programming language
– The original program is called the source
code
– The result of translating source code is called
the object code
Program Translator
• Compiler
– How a compiler compile a program?
• Source code is read from a file by the compiler and
object code is written to a newly created file
• The source code file is named to indicate the
programming language, such as program.java
where “.java” indicates a JAVA program
• Object code filenames generally have an “.o” or
“.obj” appended to original root filename, such as
program.o or program.obj.
Program Translator
• Compiler
– Source code statements are read into the
compiler one at a time
– 3 classes of source code statements are:
• Data declaration
• Data operation
• Control structure
Program Translator
• Compiler:
– Data declaration:
• Set memory locations to store the declared data.
• The amount of memory allocated depends on the
type of the data, such as integer, real, character
etc.
• The compiler builds an internal table, known as
symbol table to keep track of the data names,
types and assigned memory addresses.
Program Translator
• Compiler
– Data operation
• As data operations are encountered in source
code, they are translated into the sequence of
machine instructions necessary to implement
those operations.
• These instruction sequences include primitive data
manipulation instructions as well as any necessary
data movement instructions.
Program Translator
• Compiler
– Control structure
• Example of control structure includes
unconditional branches (such as GOTO
statement or subroutine call), conditional
branches (such as IF-THEN-ELSE statement),
and loops (such as WHILE-DO, FOR and
REPEAT-UNTIL statement).
Program Translator
• Compiler
– Support Libraries
• The object code consists entirely of executable
machine instructions and data such as executable
code.
• Certain types of language statements, including
data declarations, control structures are converted
into executable codes (external subroutines).
• These external subroutines can be found in either
one of these places:
– Compiler library
– Library call
Program Translator
• Compiler
– Linking
• Note that, the preceding library call is not a CPU instruction.
• Library call is a reference to a set of executable code that
has been previously compiled and stored in a library for later
use.
• Therefore, it must be replaced by the corresponding library
code before application can be executed.
• A program called a linker or link editor performs this
replacement.
• The process of replacement is called linking, link editing or
binding.
Program Translator
• Interpreter
– While compilation process is in progress, link editing
and program execution cannot occur until the entire
source code file has been compiled
– In contrast, interpretation interleaves source code
translation and execution
– An interpreter reads a single statement of the source
code, translates into machine instruction, and
immediately executed
– One program (the interpreter) translates and executes
another (the source code) one statement at a time
End of Chapter 4

Weitere ähnliche Inhalte

Was ist angesagt?

Presentation on computer language
Presentation on computer languagePresentation on computer language
Presentation on computer languageSwarnima Tiwari
 
High level languages representation
High level languages representationHigh level languages representation
High level languages representationgaurav jain
 
Types of Programming Languages
Types of Programming LanguagesTypes of Programming Languages
Types of Programming LanguagesJuhi Bhoyar
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingNoel Malle
 
Features of machine language, assembly language, high level language & their ...
Features of machine language, assembly language, high level language & their ...Features of machine language, assembly language, high level language & their ...
Features of machine language, assembly language, high level language & their ...SHUBHAM PATIDAR FISHERIES ADDAA
 
FIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer LanguagesFIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer Languagesraksharao
 
classification of computer language
classification of computer languageclassification of computer language
classification of computer languageBinamraRegmi
 
Computer programming language concept
Computer programming language conceptComputer programming language concept
Computer programming language conceptAfiq Sajuri
 
What is Higher Language and Lower Language in programming.
What is Higher Language and Lower Language in programming.What is Higher Language and Lower Language in programming.
What is Higher Language and Lower Language in programming.Questpond
 
introduction computer programming languages
introduction computer programming languages introduction computer programming languages
introduction computer programming languages BakhatAli3
 

Was ist angesagt? (20)

Presentation on computer language
Presentation on computer languagePresentation on computer language
Presentation on computer language
 
Computer languages
Computer languagesComputer languages
Computer languages
 
High level languages representation
High level languages representationHigh level languages representation
High level languages representation
 
Types of Programming Languages
Types of Programming LanguagesTypes of Programming Languages
Types of Programming Languages
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Features of machine language, assembly language, high level language & their ...
Features of machine language, assembly language, high level language & their ...Features of machine language, assembly language, high level language & their ...
Features of machine language, assembly language, high level language & their ...
 
Rajesh ppt
Rajesh pptRajesh ppt
Rajesh ppt
 
FIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer LanguagesFIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer Languages
 
Computer languages
Computer languagesComputer languages
Computer languages
 
Lecture1
Lecture1Lecture1
Lecture1
 
Introduction to programming languages
Introduction to programming languagesIntroduction to programming languages
Introduction to programming languages
 
Computer Language
Computer LanguageComputer Language
Computer Language
 
classification of computer language
classification of computer languageclassification of computer language
classification of computer language
 
Computer programming language concept
Computer programming language conceptComputer programming language concept
Computer programming language concept
 
Computer Languages
Computer Languages Computer Languages
Computer Languages
 
What is Higher Language and Lower Language in programming.
What is Higher Language and Lower Language in programming.What is Higher Language and Lower Language in programming.
What is Higher Language and Lower Language in programming.
 
Computer languages
Computer languagesComputer languages
Computer languages
 
Computer programming concepts
Computer programming conceptsComputer programming concepts
Computer programming concepts
 
introduction computer programming languages
introduction computer programming languages introduction computer programming languages
introduction computer programming languages
 
Computer language
Computer languageComputer language
Computer language
 

Andere mochten auch

History of computer language
History of computer languageHistory of computer language
History of computer languageClaire Punkcor
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
 
COMPUTER INTRODUCTION
COMPUTER INTRODUCTIONCOMPUTER INTRODUCTION
COMPUTER INTRODUCTIONAmit Sharma
 
Computer Languages....ppt
Computer Languages....pptComputer Languages....ppt
Computer Languages....ppthashgeneration
 
Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)Tomer Gabel
 
Chapter 02 Computer Languages (re-upload)
Chapter 02 Computer Languages (re-upload)Chapter 02 Computer Languages (re-upload)
Chapter 02 Computer Languages (re-upload)bluejayjunior
 
Copmuter Languages
Copmuter LanguagesCopmuter Languages
Copmuter Languagesactanimation
 
Introduction to Computer Softwares
Introduction to Computer SoftwaresIntroduction to Computer Softwares
Introduction to Computer SoftwaresNaresh Dubey
 
Programming languages of computer
Programming languages of computerProgramming languages of computer
Programming languages of computerKeval Goyani
 
Programming languages
Programming languagesProgramming languages
Programming languagesvito_carleone
 
Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic conceptsAbdul Khan
 
Programming in ansi C by Balaguruswami
Programming in ansi C by BalaguruswamiProgramming in ansi C by Balaguruswami
Programming in ansi C by BalaguruswamiPriya Chauhan
 
Computer generation and language translator
Computer generation and language translatorComputer generation and language translator
Computer generation and language translatorShruti Pendharkar
 
how wifi has changed our life
how wifi has changed our lifehow wifi has changed our life
how wifi has changed our lifeaqsattiq
 
Avoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tireAvoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tireHernan Wilkinson
 

Andere mochten auch (20)

History of computer language
History of computer languageHistory of computer language
History of computer language
 
Computer Languages.
Computer Languages.Computer Languages.
Computer Languages.
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
COMPUTER INTRODUCTION
COMPUTER INTRODUCTIONCOMPUTER INTRODUCTION
COMPUTER INTRODUCTION
 
Computer Languages....ppt
Computer Languages....pptComputer Languages....ppt
Computer Languages....ppt
 
Design Pattern Automation
Design Pattern AutomationDesign Pattern Automation
Design Pattern Automation
 
Bab satu
Bab satuBab satu
Bab satu
 
Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)
 
Chapter 02 Computer Languages (re-upload)
Chapter 02 Computer Languages (re-upload)Chapter 02 Computer Languages (re-upload)
Chapter 02 Computer Languages (re-upload)
 
Copmuter Languages
Copmuter LanguagesCopmuter Languages
Copmuter Languages
 
Introduction to Computer Softwares
Introduction to Computer SoftwaresIntroduction to Computer Softwares
Introduction to Computer Softwares
 
Programming languages of computer
Programming languages of computerProgramming languages of computer
Programming languages of computer
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic concepts
 
Programming in ansi C by Balaguruswami
Programming in ansi C by BalaguruswamiProgramming in ansi C by Balaguruswami
Programming in ansi C by Balaguruswami
 
Software Basics
Software BasicsSoftware Basics
Software Basics
 
Computer generation and language translator
Computer generation and language translatorComputer generation and language translator
Computer generation and language translator
 
C language basics
C language basicsC language basics
C language basics
 
how wifi has changed our life
how wifi has changed our lifehow wifi has changed our life
how wifi has changed our life
 
Avoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tireAvoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tire
 

Ähnlich wie Chapter 4 computer language

CHAPTER-1.ppt
CHAPTER-1.pptCHAPTER-1.ppt
CHAPTER-1.pptTekle12
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptxPmarkNorcio
 
Session01 basics programming
Session01 basics programmingSession01 basics programming
Session01 basics programmingHarithaRanasinghe
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptxcrAmth
 
Lecture_1_Introduction_to_Programming.pptx
Lecture_1_Introduction_to_Programming.pptxLecture_1_Introduction_to_Programming.pptx
Lecture_1_Introduction_to_Programming.pptxChewe Lulembo
 
Introduction to computer programming
Introduction to computer programming Introduction to computer programming
Introduction to computer programming VanessaBuensalida
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterHossam Hassan
 
Introduction to programming language (basic)
Introduction to programming language (basic)Introduction to programming language (basic)
Introduction to programming language (basic)nharsh2308
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & LanguagesGaditek
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & LanguagesGaditek
 

Ähnlich wie Chapter 4 computer language (20)

CHAPTER-1.ppt
CHAPTER-1.pptCHAPTER-1.ppt
CHAPTER-1.ppt
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptx
 
Session01 basics programming
Session01 basics programmingSession01 basics programming
Session01 basics programming
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptx
 
Program Logic and Design
Program Logic and DesignProgram Logic and Design
Program Logic and Design
 
PROG0101_CH02.pptx
PROG0101_CH02.pptxPROG0101_CH02.pptx
PROG0101_CH02.pptx
 
Lecture_1_Introduction_to_Programming.pptx
Lecture_1_Introduction_to_Programming.pptxLecture_1_Introduction_to_Programming.pptx
Lecture_1_Introduction_to_Programming.pptx
 
sege.pdf
sege.pdfsege.pdf
sege.pdf
 
Introduction to computer programming
Introduction to computer programming Introduction to computer programming
Introduction to computer programming
 
Compilers.pptx
Compilers.pptxCompilers.pptx
Compilers.pptx
 
programming.pptx
programming.pptxprogramming.pptx
programming.pptx
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Introduction to Compiler design
Introduction to Compiler design Introduction to Compiler design
Introduction to Compiler design
 
An introduction-to-programming
An introduction-to-programmingAn introduction-to-programming
An introduction-to-programming
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
 
Ic lecture8
Ic lecture8 Ic lecture8
Ic lecture8
 
Presentation-1.pptx
Presentation-1.pptxPresentation-1.pptx
Presentation-1.pptx
 
Introduction to programming language (basic)
Introduction to programming language (basic)Introduction to programming language (basic)
Introduction to programming language (basic)
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 

Kürzlich hochgeladen

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 

Kürzlich hochgeladen (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

Chapter 4 computer language

  • 2. Contents • Machine language programming • Programming process • Programming languages • Levels of programming languages • Program translator
  • 3. Learning Objectives • At the end of this chapter, students should be able to: – Identify and utilize the programming processes. – Identify the different levels of programming languages. – Identify and differentiate the program translators.
  • 5. Machine Language Programming • What is programming language? – A language for instructing computer • What is source code? – A complete program in such language • What is machine language? – The most primitive type of programming language that computer understands (instruction can be executed by the CPU)
  • 6. Machine Language Programming • Earliest form of programming • Most tedious and time consuming since it requires programmers to: – determine the exact set of primitive machine actions (instructions) necessary to perform complex task – write down each instruction in an understandable form to the computer
  • 7. Machine Language Programming • Computer’s instruction set are defined by the set of data manipulation and movement functions of which the CPU is capable to perform. • The processing functions of a typical CPU can be classified into 3 categories: – Computation – perform mathematical calculation using two numbers as input and store the result – Comparison – compare the values of two stored numbers and determine if they are equivalent – Data movement – move an individual item of data from one storage location to another storage location
  • 8. Machine Language Programming High Level Language Program Machine Language Code Micro Steps (Micro Code) Memory Bus System ALU etc. HW Decoder Control Signal Language Processing Translation from SW to HW
  • 10. Programming Process • What is programming Language? – A set of rules that provide a way of telling a computer what operations to perform. • What is program? – Set of step-by-step instructions that direct the computer to do the task users want it to do and produce the results.
  • 11. Programming Process • Programming process includes: – define the problems – plan the solution • through developing an algorithm that includes the flowchart and pseudo-code – coding the program – test the program – document the program
  • 12. Programming Process • Defining a problem: – Programmer meets users of the client organization or system analyst will analyze the problems. – Written agreement is produced. – Items of input, process and output are being identified.
  • 13. Programming Process • Planning the solution – Most common way of planning is by having flow charts or write pseudo-code – Flowchart is a pictorial diagram of an ordered step by step solution to a problem
  • 14. Programming Process Process Decision Connector Start or Stop Program Input or Output Direction of Flow ANSI Standard Flow Chart Symbols
  • 15. Programming Process Example of simple flow chart – of what to do if a lamp doesn’t work
  • 16. Programming Process • Planning the solution – Pseudo-code is an English-like language that states the solution with more precision in English but less precision than is required when using a formal language. – Example: if credit card number is valid execute transaction based on number and order else show a generic failure message end if
  • 17. Programming Process • Coding the programs – The programmer translate the logic from the flow chart or pseudo-code to a programming language or source code – The programmer has to know the syntax and the format of writing the programming
  • 18. Programming Process • Testing the program – Involve the desk-checking, the translating, and the debugging phases. • Desk-checking involves a programmer sitting down to proof-read a program. • Translating involves a translator – using compiler or interpreter (a program that translates the instruction into a form the computer can understand). • Debugging involves detecting, locating, and correcting bug or mistakes or errors by running the program.
  • 19. Programming Process • Documenting the program – Is necessary and is an ongoing process. – Documentation is a written detail descriptions of the programming cycle and specific facts about the program. – Typical program documentation materials include: • The origin and the nature of the problem. • A brief narrative description of the program. • Logic tools such as flowcharts, pseudo-codes and/or flow charts. • Data record descriptions • Program listings and testing results.
  • 21. Programming Languages • Programming languages are said to be lower (closer to the computer) or higher (closer to people/users). • There are five generations of programming languages to be enlisted from the lowest to the highest levels, which are: – Machine language. – Assembly language. – High-level language (HLL). – Very high-level language (VHLL). – Natural language.
  • 23. Programming Languages • Machine language – The lowest level of language – Represents data as 1s and 0s (binary digits corresponding to the “on” and “off” electrical states (switching actions) in a computer.
  • 24. Programming Languages • Assembly language – Uses mnemonic codes – Mnemonic codes are abbreviations that are easy to remember and to replace the machine language numbers – Even though not in English words, they are still convenient and are preferable than numbers alone. – Uses an assembler program to turn its program into a machine language. – Has disadvantages such as vary by machine, extremely detail, making programming becomes repetitive, tedious and prone to making errors.
  • 25. Programming Languages • High-level Language (HLL) – More English-like – thus making it more convenient – FORTRAN (FORmula TRANslator) is the 1st HLL – Other examples of HLL are COBOL, BASIC, ALGOL, APL, FORTH, LISP, LOGO, Modula- 2, PILOT, PLI, PROLOG and RPG.
  • 26. Programming Languages • Very high-level language (VHLL) – Known as a 4th generation language (4GL) – Usually nonprocedural (user need to write only “what” is to be done but not “how”. – A procedural language tells the computer how a task is done (a very specific step-by-step process) – Advantages - increase productivity, require minimal training and allow users to be unconcern about the HW or program structure.
  • 27. Programming Languages • Natural language – Is named because of its resemblance to spoken English. – Referred to as knowledge-based language due to its usage in interacting with a base of knowledge on some subject, resulting in a knowledge-based system (KBS), such as an expert system. – Natural language excel at easy data access – This has evolved into a language namely structured query language (SQL).
  • 28. Programming Languages • Object-oriented programming (OOP) – A group of languages : called object-oriented language (OOL) group. – OOL is based on a more active, visual programming environment. – Structured languages treat data and tasks (instructions) separately. – OOL views data and tasks together for each object (entity that may be grouped in classes and contains its own code). – Current examples OOP languages are Object Logo, JAVA, C++, Turbo Pascal, and SmallTalk.
  • 29. Programming Languages • Hybrid object-based programming languages – Are visual in a manner similar to OOP language but lack certain features. – The 1st hybrid language : HyperCard (Macintosh) – Some object-based hybrids are classified as visual programming languages because they are distinguished by the ability to build programs connecting links between various objects. – Current examples of visual programming languages are Object Vision and Visual Basic (VB).
  • 31. Program Translator • What is program translator? – A program that transform/translate source code into machine readable code. • There are 3 types of program translator: – Assembler – Compiler – Interpreter
  • 32. Program Translator • Assembler – A program that translates the instruction (assembly language code) into a form that computer can understand (machine language code). MOV AX, 0005 ADD AX, 0010 ADD AX, 002 MOV [0120], AX INT 20 Assembler Output File 1011100000000101000000 0000000101000100000000 0000000001010010000000 0000001010001100100000 Symbolic program Binary program
  • 33. Program Translator ADD AX, 0010 05 10,00 Opcode in Assembly Language Operand1 Operand2 Opcode in Machine Language Operand1 Operand2 Notes that: ADD translated into 05 AX translated into 000010 translated into 1016 Assembly Language Machine Language (Binary) Machine Language (Hexadecimal) MOV AX,0005 10111000 00000101 00000000 B8 05 00 ADD AX,0010 00000101 00010000 00000000 05 10 00 ADD AX,0020 00000101 00100000 00000000 05 20 00 MOV [0120],AX 10100011 00100000 00000001 A3 20 01 INT 20 11001101 00100000 CD 20
  • 34. Program Translator • Compiler – A compiler translates a program in a programming language – The original program is called the source code – The result of translating source code is called the object code
  • 35. Program Translator • Compiler – How a compiler compile a program? • Source code is read from a file by the compiler and object code is written to a newly created file • The source code file is named to indicate the programming language, such as program.java where “.java” indicates a JAVA program • Object code filenames generally have an “.o” or “.obj” appended to original root filename, such as program.o or program.obj.
  • 36. Program Translator • Compiler – Source code statements are read into the compiler one at a time – 3 classes of source code statements are: • Data declaration • Data operation • Control structure
  • 37. Program Translator • Compiler: – Data declaration: • Set memory locations to store the declared data. • The amount of memory allocated depends on the type of the data, such as integer, real, character etc. • The compiler builds an internal table, known as symbol table to keep track of the data names, types and assigned memory addresses.
  • 38. Program Translator • Compiler – Data operation • As data operations are encountered in source code, they are translated into the sequence of machine instructions necessary to implement those operations. • These instruction sequences include primitive data manipulation instructions as well as any necessary data movement instructions.
  • 39. Program Translator • Compiler – Control structure • Example of control structure includes unconditional branches (such as GOTO statement or subroutine call), conditional branches (such as IF-THEN-ELSE statement), and loops (such as WHILE-DO, FOR and REPEAT-UNTIL statement).
  • 40. Program Translator • Compiler – Support Libraries • The object code consists entirely of executable machine instructions and data such as executable code. • Certain types of language statements, including data declarations, control structures are converted into executable codes (external subroutines). • These external subroutines can be found in either one of these places: – Compiler library – Library call
  • 41. Program Translator • Compiler – Linking • Note that, the preceding library call is not a CPU instruction. • Library call is a reference to a set of executable code that has been previously compiled and stored in a library for later use. • Therefore, it must be replaced by the corresponding library code before application can be executed. • A program called a linker or link editor performs this replacement. • The process of replacement is called linking, link editing or binding.
  • 42. Program Translator • Interpreter – While compilation process is in progress, link editing and program execution cannot occur until the entire source code file has been compiled – In contrast, interpretation interleaves source code translation and execution – An interpreter reads a single statement of the source code, translates into machine instruction, and immediately executed – One program (the interpreter) translates and executes another (the source code) one statement at a time