1.3.7 High and Low Level Languages Flashcards
Explain what is meant by the term “high level language”
- Written in a form that is close to our human language
- No knowledge of hardware/architecture required
- Portable - machine independent
- Examples: C#, Python etc.
Explain what is meant by the term “low level language”
- Written in a form that is close to the processor instruction set
- Knowledge of hardware/architecture is required
- Not portable - machine dependent
- Examples: assembly language and machine code
State 3 advantages of a high level language
- Easier to understand for programmers
- Portable - not machine specific
- No need to understand the architecture of a computer
- One instruction equals many processor instructions
- Much easier to debug and test
- Only need to learn a single language
- Has built in libraries and functions that can be reused
State 3 advantages of a low level language
- Program often requires less memory/RAM
- Can make use of special hardware
- Can use memory addresses directly
- Can be written to run faster (optimised)
Explain two reasons why a computer programmer may choose to write a program in a high- level language, rather than a low-level language.
- Closer to human language/English …
- …so it is easier/quicker to read/write/understand/debug
- The program can be used on many different platforms…
- …because it is compiled into object code
- They have built-in functions/libraries…
- …this saves time when writing the program
- Do not need to manipulate memory addresses directly…
- …therefore, specialist knowledge of this is not required
- Only need to learn a single language…
- …as this can be used on many different computers
Explain two reasons why a computer programmer may choose to write a program in a low-level language, rather than a high-level language.
- allows direct access to computer processor / special hardware //
- machine dependent instructions uses up less memory
- can increase the speed of processing a program // executes instructions faster
State 3 different translators
- Assembler
- Compiler
- Interpreter
State a translator that can be used to translate a low level language into machine code
- Assembler
State 2 different translators that can be used to translate a high level language into machine code
- Compiler
- Interpreter
Describe how an interpreter translates a computer program
- Translates high-level language into machine code
- Translates (the source code) line by line/statement by statement
- The interpeter is used each time the code is executed
- Stops if it finds an error and will only continue when error is fixed
Describe how a compiler translates a computer program
- Translates high-level language into machine code (object code)
- Translates (the source code) all at once
- Produces an executable file
- Produces an error report / list of errors
- Optimises the source code (to run efficiently)
Describe how an assembler translates a low level language
- Translates (the source code) all at once
- Produces an executable file
- Produces an error report / list of errors
- Optimises the source code (to run efficiently)
Assembly language: True or False?
- Assembly language uses mnemonic codes.
- Assembly language programs do not need a translator to be executed.
- Assembly language is a low-level programming language.
- Assembly language is specific to the computer hardware.
- Assembly language is machine code.
- Assembly language is often used to create drivers for hardware.
- Assembly language uses mnemonic codes. TRUE
- Assembly language programs do not need a translator to be executed. FALSE
- Assembly language is a low-level programming language. TRUE
- Assembly language is specific to the computer hardware. TRUE
- Assembly language is machine code. FALSE
- Assembly language is often used to create drivers for hardware. TRUE
Translator or Compiler?
- Translates the source code into machine code all at once
- Produces an executable file in machine code
- Executes a high-level language program one instruction at a time
- Once translated, the translator does not need to be present for the program to run
- An executable file is produced
Translator or Compiler?
- Translates the source code into machine code all at once Compiler
- Produces an executable file in machine code Compiler
- Executes a high-level language program one instruction at a time Interpreter
- Once translated, the translator does not need to be present for the program to run Compiler
- An executable file is produced Compiler
Translator or Compiler?
- A report of errors is produced at the end of translation
- The program is translated one line at a time
- The program is translated from high-level language into machine code
- An executable file is produced
- The program will not run at all if an error is detected
Translator or Compiler?
- A report of errors is produced at the end of translation Compiler
- The program is translated one line at a time Interpreter
- The program is translated from high-level language into machine code Compiler & Interpreter
- An executable file is produced Compiler
- The program will not run at all if an error is detected Compiler