CS Test

Cards (56)

  • High-Level Language
    e.g. Python
  • Low-Level Language

    e.g. Machine Code
  • Machine Code
    Instructions written in binary, where one instruction relates to one thing the computer needs to do
  • Low-Level Languages

    • Extremely close to machine language, syntax (symbols and words) are quite far away from human language but instructions have a 1-1 correspondence to machine code
  • High-Level Languages

    • Relatively easy for programmers to use, involve a large amount of English language, one command relates to several in a low-level language, allows programs to be portable across devices and platforms
  • Computers can only understand Machine Code, so all higher-level programming languages must be translated before the computer can understand them
  • Low-level language

    A programming language that directly translates to machine code understood by the processor
  • Types of Translators
    • Assembler
    • Compiler
    • Interpreter
  • Assembler
    Converts assembly source code into machine code
  • Generations of low-level programming languages
    • First generation: Machine code
    • Second generation: Assembly code
  • Compiler
    Translates the whole program into machine code before the program is run, the machine code is saved and stored separately to the high-level code
  • Machine code
    • Instructions are directly executable by the processor
    • Written in binary code
  • Assembly code
    • Code is written using mnemonics, abbreviated text commands
    • One assembly language instruction translates to one machine code instruction
    • Needs to be translated into machine code for the computer to execute
  • Interpreter
    Translates code into machine code, instruction by instruction, the CPU executes each instruction before the interpreter moves on to translate the next instruction, does not create an independent final set of object code
  • Advantages of low-level languages
    • Complete control over the system components
    • Occupy less memory and execute faster
    • Direct manipulation of hardware
  • Machine Code
    Expressed in binary
  • Disadvantages of low-level languages

    • Difficult to write and understand
    • Machine dependent
    • More prone to errors
    • Knowledge of computer architecture is key to program effectively
  • Assembly Language
    Uses characters as well as binary, must be translated by an assembler for the computer to understand it, has a 1:1 correspondence with machine code
  • High-level programming language

    Uses English-like statements to allow users to program with easy to use code
  • Assembly language is often used to develop software for embedded systems and for controlling specific hardware components
  • Most computer programs are now written in high-level languages
  • The reason for using assembly language over machine code is that assembly language is easier for programmers to read and debug, and they are less likely to make mistakes when writing instructions in assembly language
  • Advantages of high-level languages
    • Easier to read and write
    • Easier to debug
    • Portable so can be used on any computer
    • One line of code can perform multiple commands
  • Machine code is written in binary
  • Disadvantages of high-level languages
    • The user is not able to directly manipulate the hardware
    • Needs to be translated to machine code before running
    • The program may be less efficient
  • Assembly language cannot be directly understood by the computer, it must be translated to machine code first
  • Examples of high-level languages
    • Python
    • Java
    • Basic
    • C+
  • High level language can be used on multiple devices running different hardware
  • High level language is not used to create firmware for micro-controllers, low level language is used for this as it is faster to run
  • Low level language is faster to process than high level language as it is much closer to machine code, whilst high-level language has to go through several translations first
  • High level language is much closer to human language, and contains words for commands
  • Assembly language is not better for the computer to understand than machine code, it is better for humans to understand as they are less likely to make mistakes
  • Interpreted languages have the advantage that the file that needs to be run can be transferred between machines, they are easy to test and debug, and don't require compiling each time
  • Compiled languages have the advantage that the final program is much quicker to run, there is no need for a translator for the program to run each time, and the source code file is private which is useful for commercial programs
  • Writing new firmware for a micro-controller

    Assembler is the most appropriate translator
  • Creating a new piece of software that will be sold for profit

    Compiler is the most appropriate translator
  • A program that will be run regularly without being changed
    Compiler is the most appropriate translator
  • Writing a program that will be regularly updated before running
    Interpreter is the most appropriate translator
  • Testing out an algorithm to do a particular task
    Interpreter is the most appropriate translator
  • What is system software?

    Programs that enable the computer to function.