LEC 1 Flashcards

1
Q

Memory Machine

A
  • Input/Output communicates information between memory and outside world
  • CPU manipulates information from memory
  • CPU interprets information from memory as data or instructions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How many can 8 bits represent?

A

255

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

What is 16 bytes in bits in SIMD mode?

A

128

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

How is byte sequence interpreted as?

A

data in continuous bit sequences

Instructions with distinct fields

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

What is operation field?

A

what is to be done

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

What is operand fields?

A

what is to be manipulated

  • absolute value
  • register number
  • address of value in memorry
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Where does the CPU fetch instructions from?

A

The memory

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

What type of sequences does the memory have?

A

Byte sequence

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

What does the program counter do?

A
  • Register
  • Holds memory address for next instruction-
  • Automatically increment after each instruction
  • Branch instruction changes instruction sequence
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the examples of instructions to manipulate registers?

A

• E.g. load register with value from memory
address
• E.g. add value to register
• E.g. store value from register at memory address

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

Instructions can also change program

counter with an example?

A

To change order of execution
E.g. branch to new address
E.g. branch to new address depending on values in
other registers

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

What can instructions do ?

A
  • manipulate registers

- Change program counter

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

Machine code is very hard to?

A
  • write
  • read
  • debug
  • not portable between different CPUS
  • very rarely constructed by hand
  • as fast as it gets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the characteristics of assembly language?

A

 One to one correspondence with machine code
• No loss of efficiency
 Assembly language is CPU specific
• No universal assembly language
• Not portable between CPUs
 Translated to machine code by assembler program
• How to write very first assembler…?
 Improvement from machine code but very limited
abstractions
 Hard to read/write/debug
 Specialist skill
 E.g. device drivers, BIOS, small embedded systems,
(part of) computer OS

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

What is the textual memory description of assembly language?

A
  • Address -> Label

* Bit sequence ->Constant

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

What is the textual instruction fields of assembly language?

A
• Operations ->mnemonics
• Operands
Value -> Constants
Address->Label
Register ->Mnemonic
17
Q

What is C’s overview?

A

Strict, strongly typed, imperative system
programming language

Combines high-level constructs with low
level access to type representations and
memory

18
Q

What does stack in memory organisation contain?

A
• Allocated
automatically
• Global declarations
• Local declarations
• Function parameters
19
Q

what does heap do in memory organisation?

A
  • Allocated by program
  • C.f. Java “new”
  • No garbage collection
20
Q

what does type var_name do?

A

• Allocates space for new variable of type

called name on stack

21
Q

what does var_name do?

A
• Can contain letters, digits and “_”
• Must start with a letter
• C convention
lower case = variable name
UPPER CASE = symbolic constant
22
Q

Can group declarations for same type?

A

yes

23
Q

What does the amount of space for type depend on?

A

type
platform
compiler

24
Q

How to measure type sizes in bytes?

A

int sizeof(type)

returns the number of bytes for type

25
Q

Declaration: type name

A

Associates name with enough memory for

type

26
Q

&name

A

Address of 1st byte allocated to variable

name

27
Q

What is constant? as expression

A

value of constant

28
Q

What is name? as expression

A

value from memory