Pipelining Flashcards

1
Q

How many and what kinds of registers are present in the MIPS architecture?

A

There are 32 registers from r0 to r31.

Each of these registers are 32 bits and they are all equivalent except for r0 which is always 0 and r31 which is used for jal.

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

What are the special registers from r0 to r31 in MIPS architecture?

A

The special registers are r0 and r31

r0: Used to store 0
r31: Used for jal (Jump and Link) instruction to store the return address of call

There are also 2 special registers $hi and $lo to store the results of multiplicatin and division.

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

What are the aliases for the registers in MIPS (r29, r30, r31)?

A

r29: $29: Stack pointer:
r30: $30: frame pointer
r31: $31: return address

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

What type of architecture does the MIPS use for accessing memory and stuff?

A

MIPS uses load store architecture, which means that memory is only used to :

  • Load data onto registers.
  • Store data from registers

Some operands can be immediate values instead of registers

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

What are the 3 types of instruction formats in MIPS?

A

The three types of instruction formats are R type, I type and J Type instructions.

  • R-Type: Acts on registers
  • I-type: Immediate
  • J-Type: Jump instructions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you compile a file to mips assembly ( call.c )

A

clang -S call.c -o call.s -target mips

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

What is the fetch-execute cycle in MIPS

A

There are 5 stages in the FE cycle in MIPS:

  1. IF: Instruction fetch - fetch the instructions from the memory, increment the program counter.
  2. ID: Decode the instruction, analyse the opcode and gather the operands.
  3. EX: Execute the instruction, do computations and calculate jumps.
  4. MEM: Access memory if needed
  5. WB: Write back to memory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a pipeline stall?

A

Delays because the execution of one instruction depends on the result of the previous instruction.

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

What are the causes of pipeline stalls?

A

Structural Hazard: 2 tasks can’t be executed simultaneously because they both require the use of the same hardware.

Data Hazard: The output of one instruction is the input of the other instruction

Control Hazard: When conditional branching changes the instruction to be executed next.

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

Solutions for structural hazard and what’s the drawback?

A

Duplicating the execution units and the drawback is that this is expensive.

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

Solutions for data hazards.

A

if one instruction is writing to certain registers, then stall the instructions which require those registers.

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

What is data forwarding or bypassing?

A

Data forwarding or bypassing is when the ID detects a data hazard and then forwards the result to the next instruction at the same time it is being written to the destination register through the ALU outputs and the inputs.

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

What is the nop in assembly?

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