O GoConqr está de visual novo! Conte para nós o que você achou.

Flashcards

Computer Science

ETHANDO 44 Inglês 30 flashcards

Flashcards do conjunto (30)

  1. 1High Level CodeHigh level code is designed for humans to read and write.
    Computers can not run high level code.
    In order to run the code, it must be translated into machine code.
    There are two options for doing this:
    Using a Compiler
    Using an Interpreter
  2. 2Low Level CodeLow level code is executed directly by the computer
    It is very difficult for humans to read and write
    There are two types of low level code:
    Machine code is written entirely in binary
    Assembly is written with words representing each binary command
  3. 3Machine CodeMachine code looks like this:
    00000001001011000000010000000011…
    Opcodes are binary values representing an instruction (such as load, store or add)
    The operands are the data that the instructions apply to. The code above could mean “Load 44 into the accumulator then store in memory location 3”
  4. 4AssemblyAs electronic computers progressed, machine code became too cumbersome to program. Assembly code uses MNEMONICS instead of binary, this is what we looked at earlier:
    Load 5
    The Little Man Computer is an assembly emulator
  5. 5InterpreterAn interpreter does not create a new file.
    It is used to execute the source code directly.
    It translates and executes the high level code line by line.
    Both python and scratch are interpreted languages.
  6. 6CompilerA compiler takes the code and translates it all in one go, creating a new executable file at the end.
    This file contains only machine code, the original high level code is not included.
    This file can be executed directly by the computer.
  7. 7Advantages Of A CompilerWhat are the advantages to using a compiler instead of an interpreter?
    Speed – a compiled program will run much faster, as all the translation has already been done.
    Security – you can distribute the executable file without the source code, making it harder to reverse engineer.
  8. 8Advantages Of A InterpreterCompatibility – your code will run on any computer that has the interpreter available. A compiled executable can only run on the computer it was compiled for.
    Debugging – easier to fix errors, as the interpreter can identify the line the error occurred on.
  9. 9Complication stagesThere are 6 stages to compilation:
    Lexical Analysis
    Symbol Table Construction
    Syntax Analysis
    Semantic Analysis
    Code Generation
    Optimisation
  10. 10Lexical AnalysisKeywords, constants and identifiers are replaced by ‘tokens’.
    Examples of keywords that would be replaced:
    if
    while
    for
  11. 11Syntax AnalysisTokens are checked to see of they match the rules (or syntax) for the language used.
    Examples:
    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.
  12. 12Semantic AnalysisVariables are checked to ensure they are of the correct data type.
    Operators are checked to ensure they are legal.
    Examples:
    5/3 can not be stored as an integer
    "cabbage"+3 can not be evaluated
  13. 13Syntax ErrorIf 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
    Examples:
    Missing semicolon
    Mismatched brackets or quotes
    An invalid operator (=> instead of >=)
    Comma used instead of dot
    Task: During which stage of compilation would each of the above syntax errors be identified?
  14. 14Code GenerationProvided 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.
  15. 15OptimisationThe 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.
  16. 16ErrorsThere are three main categories of error that can happen when programming:
    Syntax Errors
    Runtime/Execution Errors
    Logical Errors
  17. 17Syntax ErrorSyntax Errors are the easiest to fix
    These happen when you have typed some invalid code.
    These will be identified by the compiler or interpreter, which will report the exact location of the error.
  18. 18Runtime ErrorRuntime Errors are easy to fix with an interpreter but hard with a compiled executable.
    There is no invalid code, so the program compiles without errors.
    An error happens when the code tries to run.
  19. 19Logic ErrorA Logic error is the hardest error to fix.
    In a logic error, no programming mistakes have been made, and the program runs to completion without any errors, but the output is not correct. The mistake is with the design, not the programming.
  20. 20Linking ErrorsAnother error that can happen at compilation, but isn’t a syntax error as such is a linking error
    This happens if you have linked to an external library or function, and that function isn’t available.
  21. 21Rounding ErrorsOne example of a logic error that can occur is a rounding error.
    At various points in a program, numbers may get rounded to a given number of decimal places.
    Example:
    The number 4.53 may get rounded to 4.5
    This is a rounding error of 0.03
    This can cause a problem if lots of rounded numbers are combined, as the error increases each time.
  22. 22Truncation ErrorsComputers have finite numbers of bits allocated to each variable
    Sometimes a value needs to be stored that does not fit within the required number of bits.
    Some of the value gets “chopped off”, or truncated.
    This results in inaccuracies, and is called a truncation error.
  23. 23InterfaceAn interface is the mechanism by which the user controls the functions of the computer.
    In order to interface with the user, the OS provides:
    A GUI (Graphical User Interface)
    A CLI (Command Line Interface)
    File management
    System settings
    Multi-Tasking
    Error messages and support
    Customisation options
    Task management
  24. 24GUIA GUI is used by most PC and phone operating systems.
    Graphical representations of the computer’s functions are shown to the user and controlled by touchscreen or a mouse and keyboard.
    Programs often run in windows and several can be shown at the same time.
  25. 25CLIA CLI is a text-based interface.
    The user types commands, and the result is shown as text.
    Nearly every operating system provides a CLI.
    These are harder to use, but are very lightweight and robust – they use few system resources and are very unlikely to crash or break
  26. 26File ManagementFiles need to be manipulated.
    Operating systems provide an interface to the user which allows them to:
    Copy files
    Move files
    Delete files
    Sort files
    Search for files
  27. 27System settingsOperating systems enable the user to easily alter system settings.
    Settings include:
    Enabling or disabling specific hardware
    Changing the volume
    Adjusting screen resolution
    Configuring secondary storage
  28. 28MultitaskingMultitasking is allowing multiple processes appear to run simultaneously.
    CPUs don’t generally support this, so the OS simulates it by alternating which processes get CPU time.
    A GUI will generally allow different processes to run in separate windows, and be displayed side by side.
  29. 29customisationThe ability to customise the interface is a feature of most operating systems.
    Some provide options to change the colour scheme and desktop background
    Others allow a completely different desktop environment to be installed.
  30. 30Task ManagmentOperating systems manage processes and allow multitasking.
    The also provide the user with the option to quit programs, or kill unresponsive processes.
    Some also allow the user to prioritise certain processes, allowing certain apps to use the full processor speed.

Informações

Descrição
FlashCards sobre Computer Science, criado por ETHANDO 44 em 25-03-2019.
Criado por
ETHANDO 44
Visualizações
2
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?