Architecture 08 Flashcards

1
Q

What is MIPS32?

A

A RISC ISA with 32 32-bit general purpose registers (r0..r31)

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

What are the MIPS32 conventions for register purpose?

A
r0 = $zero = 0
r29 = $29 = $sp (stack pointer)
r30 = $30 = $fp (frame pointer)
r31 = $31 = $ra (return address)
$hi/$lo = result of multiplication/division
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Past Paper Question: In the MIPS32 instruction set architecture, name the 3 general types of instruction format. For each one, briefly describe what fields each 32 bit instruction contains

A
R-type
• Arithmetic and logic instructions
• Instruction contains 3 registers
I-type
• Load/store or branch instruction
• Instruction contains 2 registers and 1 immediate address
J-type
• Jump instruction
• No registers, only immediate address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

For I-type instructions, what can the immediate address be?

A
  • A displacement for a register (index mode)

* An immediate value (immediate mode)

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

Past Paper Question: Name the five stages in the MIPS processor pipeline and briefly describe what each does.

A

IF (Instruction Fetch)
• Fetch the next instruction
ID (Instruction Decode)
• Decode the instruction and fetch operands from registers
EX (Execute)
• Perform the arithmetic/logic operation specified by the opcode
MEM (Memory)
• Perform memory read or write, if needed
WB (Write Back)
• Store the result back to the registers

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

Past Paper Question: What is the pipeline in a CPU?

A

A hardware configuration which means the results from one hardware unit are passed to the next hardware unit. In MIPS, there is a 5-stage pipeline and at any time the pipeline contains 5 instructions.

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

Past Paper Question: Briefly describe each of the following three types of pipeline hazard: structural hazard, data hazard, control hazard.

A

Hazards arise due pipeline stalling, caused by delays in instruction execution
• A structural hazard is when two tasks can’t be completed simultaneously because they need the same hardware
• A data hazard is when the output of one instruction is the input to another
• A control hazard is when a conditional branch changes which instructions should be executed

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

Past Paper Question: Briefly explain the term forwarding, and what problem related to the pipeline it solves

A
  • When ID hardware notices a data hazard, set up a direct connection between ALU outputs and inputs
  • Uses a relevant value in the next instruction at the same time as it is written to destination register
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Past Paper Question: Briefly explain the term branch prediction, and what problem related to the pipeline it solves

A
  • When the processor predicts the output of a conditional statement and executes one block of code as opposed to both outcomes
  • It looks for a condition being the same value over and over again for example in a loop, then assumes the same result.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Past Paper Question: Briefly explain the term out-of-order execution, and what problem related to the pipeline it solves

A
  • An instruction fetched and dispatched to a queue, then waits until its input operands are available
  • If the operands are available it can leave the queue before older instructions
  • The instruction is carried out then the result is put in queue with other results, which are popped in order
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is meant by the term scalar processor?

A

Even with pipelining we can still only execute one instruction per cycle

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

What is meant by the term superscalar?

A

A processor has different EX units, so one could execute different instructions simultaneously if they don’t require the same EX unit. If you were to do them simultaneously on different EX units, IF and ID stages need to be duplicated

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

What is meant by hyper threading?

A

Utilising idle parts of a processor by making the os think there are twice as many processors as there actually are, which avoids many hazards

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