Advanced CPU Design Flashcards

1
Q

What is a subroutine?

A

A self-contained piece of code which can be called from the main program

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

What is the best way to store the return address during a subroutine?

A

In a stack

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

What is the main problem with using stacks?

A

Stack-overflow

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

How do we help minimise stack-overflow?

A

Dedicate memory for any elements that overflow

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

What does the stack pointer register do?

A

Stores the address of the most recent data element added to the stack

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

What is an interrupt in programming?

A

A signal to jump to another piece of code outside the main program

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

What are the two CPU access modes?

A

Privileged mode
Restricted mode

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

What is privileged mode used for?

A

Used by the kernel and gives it access to memory, real addresses, OS code execution, the stack, and IRQ timer

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

What is restricted mode used for?

A

Used by user programs and uses pre-processed virtual addresses

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

What swaps from privileged mode to restricted mode?

A

The IRQ timer callback

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

What is an instruction set?

A

A complete set of instructions that are understood by a given CPU

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

What do instruction sets depend on?

A

Data types, instruction types, addressing modes, and instruction format

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

What is the FPU?

A

Floating point unit

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

Why do we use the FPU?

A

Floating point operations use so many resources that it is more efficient to have a dedicated unit. However, the FPU is usually built-into the CPU

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

What is pipe lining?

A

The CPU breaks instructions down into multiple steps and stores them, this allows the CPU to perform multiple operations simultaneously

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

What can cause hazards in pipe lining?

A

branching

17
Q

How can we avoid branch hazards?

A

write code to avoid it, pipe line stalling, eager execution, branch prediction

18
Q

How does branch predictions work?

A

It assumes that all branches are taken as most branches arise from loops. Programmers will leave hints so that these loops can be spotted and dealt with

19
Q

What is operand forwarding?

A

It lets pipelining stages access results in-between other stages.

20
Q

What is out of order execution?

A

Executing instructions not in the order they appear in the program

21
Q

What is CISC?

A

An instruction set. Focuses on hardware and includes complex, multi-clock instructions. Small code sizes where the compiler doesn’t have to do much work, however, the code is very complex. Uses little RAM

22
Q

What is RISC?

A

An instruction set. Focuses on software, and uses reduced, single clock instructions. Larger code sizes means the compiler has a lot of work to do, however, the code is simple. Uses a lot of RAM.