Week 4 Flashcards

1
Q

What is the Octal System?

A

Base 8

symbols: 0,1,2,3,4,5,6,7

4096 512 64 8 1

8^4 8^3 8^2 8^1 8^0

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

What is the Binary System?

A

Base 10

10000 1000 100 10 1

10^4 10^3 10^2 10^1 10^0

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

What is the Hexadecimal System?

A

Base 16

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

65536 4096 256 16 1

16^4 16^3 16^2 16^1 16^0

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

What is the purpose of memory?

A

Stores both code and data

Memory is divided into units of 1 byte (8 bits)

Memory with 2^n addressable units requires n-bit addresses

8 bits = 256 addresses

32 bit = 2^32 addresses (roughly 4gb)

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

What is the CPU (Central Processing Unit)

A

Controls the execution of instructions

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

What are Registers (hint: memory locations)?

A

Small, fast memory locations within CPU

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

What is the purpose of General Purpose Registers?

A

Data storage, address calculations and arithmetic operations

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

What is the purpose of Special Purpose Registers?

A

One that has a specific control or data handling task to carry out

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

What is the Stack Pointer?

A

Points to the top of the stack

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

What is the Base Pointer (hint: current frame)?

A

Points to the start (base) of the current frame

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

What is the Link Register (LR) (hint: function completion)?

A

Stores return address for after function completion

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

What is a Program Counter (PC)?

A

Stores the address of the next instruction to be executed

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

What is the Arithmetic Logic Unit (ALU)?

A

The ALU handles arithmetic and logical operations

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

What is the Status Register (hint: contains)?

A

Contains status and mode bits

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

What are Assembly Languages?

A

Simple Instructions

Difficult programming language

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

What is Branching (Branch Instructions)?

A

Branch instructions will “jump” to a different instruction

They do so by changing the program counter

17
Q

What is Temporal Locality?

A

Items accessed recently are likely to be accessed again soon

If you want to discard data, start with the one that has not been requested in a long time

18
Q

What is Spatial Locality?

A

Items located near each other in memory are likely to be accessed within a short period of time

Most programs exhibit spatial location

Copy additional memory locations into the cache

19
Q

What are the 2 outcomes of a memory request?

A

Cache hit

Cache miss

20
Q

What is a Cache Hit?

A

Cache contains the data (faster data return)

21
Q

What is a Cache Miss?

A

Cache does not contain requested data - first read from memory

22
Q

What are the 3 Cache Designs?

A

Direct Mapping

Fully-associative Mapping

Set-associative Mapping

23
Q

What is a Direct-Mapped Cache?

A

Each block of main memory maps to one unique cache line

24
Q

What are the pros and cons of a Direct-Mapped Cache?

A

Pros:

Simple, easy to implement and search

Cons:

Inefficient use of the cache space

25
Q

What is a Fully-Associative Cache?

A

Each block of main memory can map to any line of the cache

26
Q

What are the pros and cons of a Fully-Associative Cache?

A

Pros:

Flexible

Cons:

Takes a long time to search

27
Q

What is a Set-Associative Cache?

A

Cache divided into N cache sets

Each cache set consists of S lines

Each block of main memory maps to one unique cache set

28
Q

What are the 2 options with dealing with a Write Hit?

A

Write-Back - initially write only to cache, write into memory if being replaced

Write-Through - Write into both cache and memory

29
Q

What are the pros and cons of Write-Back?

A

Pros:

Fast writes

Cons:

Mechanism for cache coherence

30
Q

What are the pros and cons of Write-Through?

A

Pros:

Consistency between the cache and memory

Cons:

Slow writes

31
Q

What are the 2 options with dealing with a Write-Miss?

A

Write around - write into memory only

Write allocate - fetch from memory and write into cache

32
Q

What are the pros and cons of Write around?

A

Pros:

Avoids unnecessary cache access and cache pollution

Cons:

Does not utilise temporal locality

33
Q

What are the pros and cons of Write allocate?

A

Pros:

Exploits spatial and temporal locality

Cons:

Potential unnecessary cache access and cache pollution

34
Q

What is Virtual Memory?

A

Use disk storage as if it was main memory

analogy: Main memory is the cache of the disk

35
Q

What is Demand Paging?

A

Only load a page when there is a request for it

36
Q

What are the pros and cons of Demand Paging?

A

Pros:

More processes can be loaded into memory

Cons:

CPU spends too much time swapping pages - Thrashing

37
Q

What is Pre-Paging?

A

Guess which pages will be requested and pre-load them

38
Q

What are the pros and cons of Pre-Paging?

A

Pros:

Less overhead when page predictions are accurate

Cons:

Resources wasted on loading unused pages