Please enable JavaScript.
Coggle requires JavaScript to display documents.
Unit 8 - Program Constructor - Coggle Diagram
Unit 8 - Program Constructor
Introduction
Computers need instructions, called programs to tell that what to do
In order for the computer to understand Python code, it must be put in a way the computer can understand (1s and 0s)
However we speak different languages than computers for example they speak in binary (0s and 1s)
we are learning to program using a language like python, this is a example of high level program language.
Translators
Computers can only execute in binary machine code
Assemblers
Assembly language is a low level programming language that the computer can almost understand
An OpCode is short for operation code and is a single instruction executed by the CPU
Compilers
Syntax Analysis
Tokens are checked to see if they match the spelling and grammar expected, using standard language
If errors are found, error messages are produced
We use the term translators to cover all types of software that converts code from one to another. Compilers, interpreters and assemblers are all types of translators
Compilers
Lexical Analysis
Comments and unneeded spaces are removed
Keywords are replaced by tokens
A symbol table holds the address of variables
Code generation
Code optimisation may be employed to make it run faster and better
Machine code is generated
Interpreters
An interpreter analyses the source code statement by statement as execution proceeds
Advantages are:
Usually occupies less storage
Less complex and cheaper