C1: Intro Prog Concepts/Von Neumann Model Flashcards

1
Q

What does memory consist of in the von Neumann Model.

A

Memory consists of addressable memory
cells (usually one byte per cell) which can
be read and written freely by a program

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

What is a program in the von Neumann Model?

A

A program consist of (binary) commands
(or instructions) that are stored in memory
and can be loaded by the CPU

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

What is data in the von Neumann Model?

A

Data is also stored in memory and can be

loaded or stored by commands

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

How is a program executed by the CPU in the von Neumann Model?

A

A program is executed by the CPU sequentially by
1. loading a command from memory,
2. executing it (e.g. adding two data items), including
loading data from memory and storing results,
3. loading the next command,
4. etc.

The address of the next command (i.e. where to find it
in memory) is stored in the instruction counter register
 (Conditional) Jump commands can be used to explicitly
set the command counter and thus change the control
flow

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

What is procedural programming?

A

a program is structured
into smaller sub programs (procedures / functions),
which can be called by other procedures

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

What is structured programming?

A

in addition to calling
procedures there are only three control structures: (1)
sequence, (2) iteration (WHILE), (3) selection (IFTHEN-ELSE)
 Object oriented programming: a program consi

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

What is OOP?

A

a program consists of
objects that communicate by sending and receiving
messages

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

What is an ‘attribute’ in Programming languages?

A
The set of properties that characterize all language constructs (e.g. variables,
types, procedures, objects). Ex: common attributes of variables: value
 name
 scope
 address
 type
 lifetime
 mutability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are language constructs in programming?

A
Syntax and semantics. ex:  integer variable definitions, if-then-else
control structures, class declarations, etc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a binding in a prog. lang.?

A

The process of assigning a value to an

attribute is called binding.

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

What are the types of bindings in a prog lang.?

A

static (before runtime) or dynamic (at runtime)

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

Name an abstraction of memory transformations.

A

operators (specifies memory transformations)

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

Name some abstractions of a sequence

A

Control structures and subprograms

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

What is a compiler?

A

Compiler generates code from program
• Can perform correctness checks in the process
• Can optimise generated code, e.g. for multi-cores
• Generated code can be executable code,
intermediary code, or a program in another language
(trans-compiling),
ex: C, C++

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

What is an interpreter?

A

Interpreter reads program instructions and
executes them directly
• Example: classical BASIC interpreter, script
languages
• Often more ‘dynamic’

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

What is a Just in Time Compiler?

A

Just-in-time compiler is a way of combining compiler and interpreter:
• Reads, executes and analyses program instructions
• Performs code optimizations at runtime

17
Q

What is a linker?

A

In addition to a compiler, the linker combines several compiled program parts. ex: C, C++

18
Q

What is a loader?

A

In addition to a compiler, the loader loads program into memory, assigns actual
addresses (typically part of OS or shell), ex: C, C++

19
Q

What is a language runtime?

A

In addition to a compiler, the language runtime provides additional code to execute a program on a concrete machine.

 Handles program initialisation and clean-up
 Performs necessary runtime checks
 Manages error handling
 Performs dynamic memory management
 Usually realised as a combination of compiler generated code, libraries and OS calls
 Different languages provide different runtime
environments!
• Java: very powerful (Java Virtual Machine)
• C: minimalistic