Reduced Instruction Set Computers (RISC) Flashcards

1
Q

What is an ISA?

A

The repertoire of instructions that the processor can perform

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

What are the 2 types of ISA?

A
  1. Common commercial ISAs
  2. Open source ISAs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Give 2 examples of common commercial ISAs and state if they are RISC or CISC

A
  1. Intel (CISC)
  2. ARM (RISC)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Give an example of an open source ISA

A

RISC-V

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

What are the 3 main points in RISC philosophy?

A
  1. Make the common case fast
  2. Orthogonal instruction set design
  3. Simple instruction decode
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain what ‘make the common case fast’ means

A

Don’t optimise rare cases at the expense of resources that could be used for the benefit of the common case eg. cache space
Use a sequence of existing, simple instructions instead of adding a new, complex instruction

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

Explain what orthogonal instruction set design is

A

This is where all instructions can use all addressing modes
Eg. all arithmetic instructions use the same operands
Registers are general purpose instead of being specialised

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

How does RISC make instruction decoding simpler?

A

Instructions are a fixed length eg. 32 bits

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

What characterises RISC instructions?

A

Small, highly-optimised set of simple instructions. Use a sequence of existing simple instructions instead of adding new complex ones.

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

What characterises CISC instructions?

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

Does RISC need ROM?

A

No because instructions can be cached

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

What optimisations can be performed with RISC instructions?

A

The compiler can be optimised to optimise the order in which the instructions are presented to the processor

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

What are the two different types of RISC instruction?

A

Load/store and arithmetic

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

What is the difference between load/store instructions and arithmetic instructions in RISC?

A

Arithmetic instructions can be done between registers (multiple registers can be accessed in one clock cycle) with no operand in memory, whereas load/store require a memory access

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

Give 3 reasons why ISA’s don’t matter

A

Most of performance and energy use on a processor is due to:
1. Algorithms
2. Application code
3. Compilers

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

Give a reason why ISA’s do matter

A

If using proprietary closed-source software, you don’t have access to the code. If your ISA catches bit rot, you can no longer compile this source code

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

What is RISC-V?

A

Free and open source ISA developed at UC Berkeley

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

What does it mean that RISC-V is a modular ISA?

A

It has a small standard base ISA with multiple standard extensions

18
Q

What is a register file?

A

Memory. It is multi-ported, so can access multiple registers in one clock cycle so read/write different locations at the same time. It also provides very low latency access

19
Q

What is an immediate value?

A

A constant that is stored in the encoding of an instruction. This value is immediately available from the instruction, without needing register or memory access

20
Q

Different types of instructions have different ?

21
Q

What is the width of a RISC-V instruction?

22
Q

How many integer registers are there in RISC-V

A

31 integer registers x1-x31, plus x0 zero register

23
Q

Which registers are always in a fixed location in the instruction encoding? What do they do?

A

rs1, rs2 and rd
Values to operate on are retrieved from rs1 and rs2 and the result is stored in rd

24
What would happen if we wanted to add more registers?
They would need to be encoded in our instruction encoding, which puts pressure on the encoding as we would need more bits for each instruction which is harder to pipeline and requires more power consumption
25
What is memory usage like in RISC-V?
There is a linear address space for both instructions and data. Optional page-based virtualisation
26
Add A and B and store the result in C
add C, A, B
27
Add 3 to A
addi A, A, 3
28
Put constant -5 into A
addi A, x0, -5
29
Load a word of data from A and put into B
lw B, 0(A) Address calculation is A+0
30
Branch back by 4 instructions if A=B
beq A, B, -4 The pc is the value that is changed to implement flow control. This subtracts 4 from the pc value
31
What does the assembler do?
Converts assembly language into binary machine code. Each part of the encoding is converted to binary separately and then stuck together
32
Write a jump-and-link instruction. What does this do?
jal rd, immediate Does: 1. rd = pc + 4 (incrementation after jal) 2. pc = pc + signExtend(immediate)
33
What is call immediate equivalent to?
jal ra, immediate
34
What is equivalent to ret?
jalr zero, ra, 0 This sets the pc to the return address jalr adds a register offset which is added to the immediate
35
What is a calling convention?
A scheme for how functions receive parameters from their caller and return the result, specifying whether the caller or callee saves the register values of these parameters
36
Why do we have a calling convention?
It is inefficient to make the caller save all registers when they are not overwritten by callee, and vv
37
Is return address caller or callee saved?
Caller
38
Is stack pointer caller or callee saved?
Callee
39
What are the advantages of RISC over CISC?
RISC is simpler and lower power and still provides similar performance
40
What is CISC?
ISA where a single instruction can execute several low-level operations, like loading data and performing arithmetic, all in one command. This reduces the number of instructions needed for complex tasks
41
Why does CISC still dominate the PC space?
Due to requirements for backwards compatability
42
What space does RISC dominate?
Mobile and microcontroller