Mapa mental
Unit 4: Software
Contenido del mapa
Unit 4: Software
low level programming
- assembly
- little man computer
- fetch-execute cycle
- Instructions are fetched from main memory
- Values are placed in the accumulator
- The ALU (Arithmetic and Logic Unit) is used to add values
- Values are placed in the accumulator
- Assembly language works directly with main memory, the accumulator and the ALU
- Assembly is a low level language that uses mnemonics and labels for opcodes and memory addresses
- Low level languages use the opcodes that the CPU can execute
- They are easily translated into machine code
- Low level language are useful when speed of execution is critical or when writing software which interfaces directly with the hardware, e.g. device drivers
- advantages
- direct control over the CPU
- code can be very efficient
- direct access to memory and registers
- disadvantages
- difficult to work with
- only works on the CPU for which it was written
- Low level languages use the opcodes that the CPU can execute
- Assembly is a low level language that uses mnemonics and labels for opcodes and memory addresses
- Instructions are fetched from main memory
- fetch-execute cycle
- little man computer
- Computers (specifically, CPUs) execute machine code
- Machine code is a sequence of opcodes (instructions) and operands (data) stored as binary
- assembly
high level programming
- High Level Languages are designed to be easy for people to use
- They use commands that resemble natural language like English
- advantages
- easy to work with
- fewer errors
- can be translated for different CPUs
- disadvantages
- code must be translated to run
- translated code may not be efficient
- advantages
- They use commands that resemble natural language like English
- A CPU can not execute them, so they must be translated to machine code in a complex process
- They are easy to work with and less likely to produce mistakes
- High level languages are used when the execution speed is not critical, e.g. in common productivity applications, such as a word processor
- They are easy to work with and less likely to produce mistakes
- High Level Languages are designed to be easy for people to use
translation
- CPUs can only execute machine code
- assembler
- Assembly language is translated to machine code
- Assembly is directly translated to machine code, with no change in structure
- Assembly language is translated to machine code
- high level languages
- High level languages are translated to machine code by either a compiler or an interpreter
- Compilers translate the code to machine code in one go, producing an executable file
- advantages
- fast - translation is done in advance
- secure - source code is not distributed
- compiled code is used when speed is important, or when the program is only intended for a single system e.g. games or office software
- disadvantages
- locked to a single type of CPU
- harder to debug
- advantages
- Interpreters translate the machine code line by line while it is running
- advantages
- cross-platform compatible - runs on any system with an interpreter
- easier to debug - as the source code that caused an error can be shown
- disadvantages
- slower - translation takes a lot of CPU time, and has to happen while the program is running
- interpreted code is used when compatibility with different platforms is important e.g. browser-based software
- source code must be distributed
- slower - translation takes a lot of CPU time, and has to happen while the program is running
- advantages
- Compilers translate the code to machine code in one go, producing an executable file
- High level languages are translated to machine code by either a compiler or an interpreter
compilation stages
- 6 stages
- lexical analysis
- comments and unneeded spaces are removed
- keywords, constants and identifiers are replaced by "tokens"
- e.g. if, while & for
- keywords, constants and identifiers are replaced by "tokens"
- comments and unneeded spaces are removed
- symbol table construction
- created to hold variable addresses, labels and subroutines
- e.g.
- e.g.
- created to hold variable addresses, labels and subroutines
- syntax analysis
- tokens are checked to see if they match the rules (or syntax) for the language used
- e.g. - does every open bracket have a close bracket? - does an if command end with a colon?
- if syntax errors are found, error messages are produced
- e.g. - does every open bracket have a close bracket? - does an if command end with a colon?
- tokens are checked to see if they match the rules (or syntax) for the language used
- semantic analysis
- variables are checked to see if they are properly declared and used
- variables are checked to ensure they are of the correct data type
- operators are checked to ensure they are legal
- e.g. - 5/3 can not be stored as an integer - "cabbage"+3 can not be evaluated
- operators are checked to ensure they are legal
- variables are checked to ensure they are of the correct data type
- variables are checked to see if they are properly declared and used
- lexical analysis
- syntax error
- if any of these steps detects a problem, a syntax error is produced
- a syntax error is an error that prevents the code compiling - it is caused by something in the code that is not valid for that programming language
- e.g. - missing semicolon - mismatched brackets or quotes - and invalid operator - comma used instead of full stop
- a syntax error is an error that prevents the code compiling - it is caused by something in the code that is not valid for that programming language
- if any of these steps detects a problem, a syntax error is produced
- code generation
- provided there have been no syntax errors produced, the machine code is now generated
- complex algorithms are used to create machine code instructions that perform the same task as the high level code
- provided there have been no syntax errors produced, the machine code is now generated
- optimisation
- the generated code is scanned for repetitions or known inefficiencies that can be replaced with loops or more efficient code
- this step is a big factor in the quality and expense of a compiler. A good compiler will produce better, more efficient machine code than a poor one
- the generated code is scanned for repetitions or known inefficiencies that can be replaced with loops or more efficient code
- 6 stages
errors
- syntax error
- occurs when the code is not valid, usually the result of a typing mistake
- code with a syntax error will not compile or at all run
- occurs when the code is not valid, usually the result of a typing mistake
- runtime error
- runtime errors are usually easy to fix in interpreted languages, as the line that caused the error can be shown
- occurs while a program is running, and is often the result of an unexpected user input
- runtime errors are usually easy to fix in interpreted languages, as the line that caused the error can be shown
- logic error
- a mistake in the design
- will not cause the program to break or halt, but will produce an unexpected output
- a mistake in the design
- linking error
- occurs when a program is unable to successfully import or link to an external file
- rounding error
- the difference between a value we want to store, and the value that is actually stored after any rounding takes place
- truncation error
- occurs if some data requires more bits to store than is available, resulting in some data being lost
- syntax error
operating systems
- CPU
- multi-tasking
- splits processor time between different programs, making them appear to run simultaneously
- manages processor by allocating time to running processes
- multi-tasking
- Security
- authenticates users and prevents access to restricted files
- Peripherals
- external hardware devices
- drivers used to map OS codes to hardware codes
- OS needs a driver to work with newer hardware
- Backing Store
- cloud
- local
- manages backups of important data
- Memory (RAM)
- splits memory into pages to prevent programs from reading each other's data
- Interrupts
- pauses currently running processes to run specific code
- software
- triggered by programs
- hardware
- triggered by keyboards, mice etc.
- CPU
Imágenes y archivos del mapa
Información
- Descripción
- GCSE Computing Mapa Mental sobre Unit 4: Software, creado por Rebecca Hall el 23/06/2021.
- Creado por
- Rebecca Hall
- Visitas
- 2
- Valoración