Mapa mental
unit 4: software 22 (1)
Conteúdo do mapa
unit 4: software 22 (1)
high level language
- designed to resemble a natural language such as English
- + easier for people to read and understand + likely to be fewer errors due to the ease of use
- uses commands that perform complex instructions - can not be executed by a CPU - requires translation into machine code
- best to use for large, complex applications where speed of execution is not critical: word processor, video game
- uses commands that perform complex instructions - can not be executed by a CPU - requires translation into machine code
- + easier for people to read and understand + likely to be fewer errors due to the ease of use
- e.g. python, scratch
- designed to resemble a natural language such as English
low level language
- uses the instruction set of a CPU and does not resemble a natural language
- - hard for people to understand and read - harder to find and correct errors
- + executed directly by the CPU so can be made highly efficient
- e.g. little man computer assembly, machine code
- best to use when speed of execution or memory usage is important, or when a program interfaces directly with hardware: engine management, device drivers
- e.g. little man computer assembly, machine code
- + executed directly by the CPU so can be made highly efficient
- - hard for people to understand and read - harder to find and correct errors
- uses the instruction set of a CPU and does not resemble a natural language
stages of compilation
- lexical analysis
- symbol table construction
- syntax analysis
- semantic analysis
- code generation
- code optimisation
- code optimisation may be employed to make it more efficient/faster/less resource intensive
- machine code is generated
- code optimisation
- variables are checked to ensure that they have been properly declared and used
- variables are checked to ensure that they are of the correct data type - operations are checked to ensure that they are legal for the type of variable being used
- code generation
- tokens are checked to see if they match the syntax for the programming language - if syntax errors are found, error messages are produced
- semantic analysis
- a symbol table is created which holds the addresses of variables, labels and subroutines
- syntax analysis
- comments and unneeded spaces are removed - keywords, constants and identifiers are replaced by 'tokens'
- symbol table construction
- lexical analysis
program construction
- assemblers
- translate assembly language to machine code
- each operator and operand is replaced with its binary equivalent - no need for analysis of code or complex function creation
- translate assembly language to machine code
- compilers
- translate high level code to machine code
- complex translation - each line of high-level code can require many machine code instructions
- translate high-level code all at once - this machine code can be distributed and executed on only compatible computers
- programs can be distributed without releasing the source code -> harder for competitors to copy their code - machine code files are fast to execute
- translate high-level code all at once - this machine code can be distributed and executed on only compatible computers
- complex translation - each line of high-level code can require many machine code instructions
- translate high level code to machine code
- interpreters
- translate high level code to machine code
- complex translation - each line of high-level code can require many machine code instructions
- do not create an executable file - translate and execute one line at a time - source code is distributed and executed by the user - execution is slower, as the translation must take place before each line can run
- programs will run on any computer with the interpreter (no need to compile multiple versions) - easier to find runtime errors, as the location of the error can be shown
- do not create an executable file - translate and execute one line at a time - source code is distributed and executed by the user - execution is slower, as the translation must take place before each line can run
- complex translation - each line of high-level code can require many machine code instructions
- translate high level code to machine code
- assemblers
errors
- syntax error
- occurs when text that is not valid code is found
- e.g. print('hello) - missing quote - imput("name: ") - spelling error
- occurs when text that is not valid code is found
- linking error
- occurs when a program tries to import a function from a file that doesn't exist
- truncation error
- occurs when data must be shortened (truncated) to fit
- could result in missing text or an inaccurate value
- occurs when data must be shortened (truncated) to fit
- runtime error
- occurs when the program tries to perform an impossible operation
- e.g. dividing by zero, adding a string to an int
- occurs when the program tries to perform an impossible operation
- rounding error
- occurs when a value is rounded and loses accuracy
- logical error
- program executed and exists with no errors, but the program has not done what was expected
- hard to detect and fix as no errors are produced
- e.g. a prime number checker that says 20 is prime, a quiz that marks an answer incorrectly
- hard to detect and fix as no errors are produced
- program executed and exists with no errors, but the program has not done what was expected
- syntax error
Informações
- Descrição
- GCSE Computing Mapa Mental sobre unit 4: software 22 (1), criado por Rebecca Hall em 08-03-2022.
- Criado por
- Rebecca Hall
- Visualizações
- 0
- Avaliação