3.6.2.1 Classification of Programming Languages. Flashcards

1
Q

Why did we write programs in a low level language?

A

Because there was limited speed and memory. These languages directly manipulated the processor, required a great deal of effort on the part of the programmer and were prone to errors.

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

Why were high level languages developed?

A

They were developed to allow for instructions to be communicated to a computers processor, making the job of programming far easier.

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

Outline what is meant by a low level language.

A

The earliest electronic computers could only be programmed with low-level languages.
Programs written in low-level languages are specific to the type of processor they are
written for and directly affect the computer’s processor.

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

Define what is meant by machine code.

A

Binary code that a machine can understand an execute.
Used to represent instructions.
Uses only the binary digits 1 and 0 to represent instructions aka binary code that a machine can underst Programs written in machine code are long and extremely difficult to understand. Because of this, machine code programs are prone to errors and difficult to debug.

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

Outline the two types of a lower-level language.

A

There are two categories of low-level languages, machine code and assembly language.

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

Why are programmers not constrained when using machine code?

A

Because the machine code directly manipulates a computers processor, it is a very powerful paradigm.

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

Do programmers have to translate machine code before execution?

A

There is no need to translate before execution, making the paradigm useful for embedded systems and real time applications, where speed of execution is paramount.

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

Give examples of a high-level programming language.

A

Java.

Python.

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

What is an imperative language?

A

A programming language that gives a command to do something.

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

Why are imperative languages high-level?

A

They allow a programmer to think about the program as an algorithm and to not be concerned about how each tiny step is executed in machine code.

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

What must be done to a program before execution?

A

The program must be translated into machine code.

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

What is 1GL?

A

An abbreviation for first generation language. Aka a low-level programming language such as machine code or assembly language.

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

What is a 2GL.

A

An abbreviation for second generation language. Aka a high-level programming language such as java or python.

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

Why was assembly language developed?

A

They were developed with the intention of simplifying the process of writing computer programs.

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

Define a mnemonic.

A

A system such as a pattern of letters, ideas, or associations which assists in remembering something.

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

Outline STO.

A

Mnemonic for storing the contents of the accumulator into the addressed location.

17
Q

Outline LDA.

A

Mnemonic for loading the contents of the memory address or integer into the accumulator.

18
Q

Define an instruction set.

A

the set of bit patterns/binary codes for the machine operations that a processor has been designed to perform

19
Q

Define an op-code.

A

The part of the machine code instruction that denotes the basic machine operation, e.g. ADD.

20
Q

Define and operand.

A

The part of the machine code instruction that represents a single item of binary data or the address of a single item of binary data.

21
Q

Outline the advantages and disadvantages of machine code.

A

Not portable.

Code is difficult for humans to understand.

Errors are very difficult to spot and correct.

Machine code is directly executed by processors.

22
Q

Outline the advantages and disadvantages of assembly code.

A

Programs are processor specific.

Mnemonics help to
make code slightly
easier for humans to
understand.

Debugging is easier
than with machine code
but still far more difficult
than with high-level
languages.
An assembler must be
used before a program
is executed, but each
instruction has a 1-to-1
correlation to a
machine code
instruction so
translation is quick
23
Q

Outline the advantages and disadvantages of a high-level language.

A

Portable. Programs are
not specific to certain
processors.

Code uses English,
making it easy for
humans to understand.

Named variables,
indentation and
commenting make
debugging fairly easy.

A compiler or interpreter
must be used to
translate source code
into object code before
it can be executed. This
can be time consuming
24
Q

Outline what is meant by a 1-to-1 correlation.

A

Each assembly language instruction has a 1-to-1 correlation to a machine code instruction.
For example, the assembly language instruction MOV R2, R1 might be the exact
equivalent of the machine code instruction 11011101.