C1: Intro Prog Concepts/Von Neumann Model Flashcards
What does memory consist of in the von Neumann Model.
Memory consists of addressable memory
cells (usually one byte per cell) which can
be read and written freely by a program
What is a program in the von Neumann Model?
A program consist of (binary) commands
(or instructions) that are stored in memory
and can be loaded by the CPU
What is data in the von Neumann Model?
Data is also stored in memory and can be
loaded or stored by commands
How is a program executed by the CPU in the von Neumann Model?
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
What is procedural programming?
a program is structured
into smaller sub programs (procedures / functions),
which can be called by other procedures
What is structured programming?
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
What is OOP?
a program consists of
objects that communicate by sending and receiving
messages
What is an ‘attribute’ in Programming languages?
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
What are language constructs in programming?
Syntax and semantics. ex: integer variable definitions, if-then-else control structures, class declarations, etc
What is a binding in a prog. lang.?
The process of assigning a value to an
attribute is called binding.
What are the types of bindings in a prog lang.?
static (before runtime) or dynamic (at runtime)
Name an abstraction of memory transformations.
operators (specifies memory transformations)
Name some abstractions of a sequence
Control structures and subprograms
What is a compiler?
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++
What is an interpreter?
Interpreter reads program instructions and
executes them directly
• Example: classical BASIC interpreter, script
languages
• Often more ‘dynamic’