Computer Systems pt.2 Flashcards

1
Q

What is a low level programming language?

A

A programming language that sits close to the computer’s instruction set e.g. assembly and machine code

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

What is high level programming language?

A

A programming language that is close to natural spoken language e.g. Python, Javascript

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

What is a translator?

A

A program that converts source code to machine code

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

What are the 3 types of translators?

A

Compilers - high level
Assemblers - assembly
Interpreters - high level

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

What is a compiler?

A

A program which takes source code, and translates it into machine code all in one go. Once converted, the object code can run unassisted at any time. Will not run unless all errors in the source code are fixed.

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

What are the advantages and disadvantages of compilers?

A

File can be run without assistance - A
Can take a long time
Cannot be run if there is an error in the code - D
Errors only shown at the end - D

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

What is an interpreter?

A

Converts source code into machine code 1 line at a time. Must be present before a computer program is able to run

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

What are the advantages and disadvantages of interpreters?

A

Program runs very slowly - D
Translator must be present before a program is able to run - D
Programmers can identify errors

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

What is the use of interpreters?

A

Used during testing/ developing stages, programmers can quickly identify errors and correct them

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

What is an assembler?

A

Only used for assembly language - converts assembly mnemonics to machine code

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

What is assembly language and where is it used?

A

Often used in embedded systems - set of commands which represent machine code. Often used for controlling hardware components.
It is closely related to machine code
It has a 1:1 correspondence with machine code = 1 instruction in assembly corresponds to one instruction in machine code

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

Why does every type of processor have its own type of instruction set?

A

It sets the rules for hardware and software interface, defines what the CPU does and ensure compatibility. Essential when working with application development, assemblers and compilers.
Machine code is specific to the type or family of processors

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

What are the characteristics of assembly language?

A

Assembly - programmers can express programs using simple commands, these could be easily translated into machine code. These languages were closely mapped to machine architecture.
They are written for a specific processor.
They are difficult to understand, but programs are incredibly efficient.

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

What is short code?

A

The first ever high level language:
Statements were expressed as mathematic expressions rather than machine instructions. Source code was not compiled, but executed through an interpreter every time the program was run.
It is 50 times slower than machine code.

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

What is source code?

A

Introduced as computers became more complex and got more memory and faster processor speed, therefore it was now possible for the program to interact with the hardware directly.
Common examples include Python, C# or Javascript.

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

Where is assembly language used?

A

Embedded systems and device drivers

17
Q

What are the characteristics of low level programming languages?

A

Involves machine code and assembly (assembly is usually used, as it is translated into machine code by an assembler).
One instruction translated into one machine code instruction.
Works for only one type of processor only.
Programmer works with memory directly.
Code is harder to write and understand.
It is memory efficient and fast to excecute.

18
Q

What are the characteristics of high level programming languages?

A

Source code written in aforementioned examples.
Translated by compilers or interpreters.
Makes the writing of programs easier as it is closer to spoken English language.
One source code instruction translates to many machine code instructions.
Code can run on different types of processors.
Programmer has lots of data structures to use (like built in functions).
Less memory efficient.
Code can be slower to execute if not optimised.