3.7 High- & Low-level Languages Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Instruction set

A

A set of binary numbers that match every instruction that can be understood by the CPU
*different computers may have different instruction sets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Machine code

A

(The general term for) the number code that matches numbers to instructions / binary instructions that a computer understands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Low-level language

A

LLLs relate to the specific architecture and hardware of a particular type of computer.
eg. machine code, assembly language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

4 advantages of low-level languages

A
  1. Works directly on registers/CPU; code can be executed faster
  2. Programmer has more control over what happens in computer
  3. Can use machine specific functions
  4. Code takes up less storage / memory efficient
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

4 disadvantages of low-level languages

A
  1. Difficult to read, write and understand
  2. Easier to make mistakes
  3. Time-consuming to write programs
  4. Programs written in LLL may not work on other makes of computer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Assembly language is often used to create device drivers for new types of hardware. What are device drivers?

A

Device drivers are instructions that let the CPU communicate with peripherals

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

High-level language

A
  • Closer to human language / English
  • Independent of a particular type of computer // portable language
  • A language such as Python, Java, Pascal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

3 advantages of high-level languages

A
  1. Close to human language
  2. Easier/faster to read and write
  3. Portable code - programs written in HLL can be run on any computer once they have been translated into that computer’s machine code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

3 disadvantages of high-level languages

A
  1. Take additional time to translate program to machine code
  2. Generally less memory efficient, compared to LLLs
  3. Programs are slower than low-level language programs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Translators - Assembler

A

A program that translates a program written in assembly language into machine code.

  • An executable file of machine code is produced, so assembled programs can be used without the assembler
  • executable file creates a smaller file size, so more saleable
  • An assembled program is usually distributed (sold/shared) for general use
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Translators - Compiler

A

A program that translates the whole high-level language program into machine code at once.

  • An executable file of machine code is produced, so compiled programs are used without the compiler (it will be quicker to run)
  • executable file creates a smaller file size, so more saleable
  • A report/list of errors in the code is created
  • A compiled program is distributed (sold/shared) for general use
  • However, if you make a change the program must be compiled again
  • Source code cannot be accessed, so code cannot be stolen/plagiarised
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Translators - Interpreter

A

A program that translates a high-level language program a statement at a time, and the machine code is directly executed.

  • Will identify an error as soon as it finds one in a line of code
  • No executable file of machine code is produced, so interpreted programs cannot be used without the interpreter
  • However, if you make a change you can test the effect immediately, so an interpreter is often used when a program is being developed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

2 types of error

A
  1. Syntax error - where a program statement doesn’t obey the rules of the programming language
  2. Logic error - where the program doesn’t do what the programmer wanted it to do
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why is a compiler or an interpreter needed when running a high-level program on a computer?

A
  1. Code is required to be converted into machine code/binary

2. Code needs to be produced that can be understood by the computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly