Instruction Set Architectures (1) Flashcards

1
Q

What are the different types of MIPS registers and their purposes?

A

General-purpose registers include temporary ($t), saved ($s), argument ($a), return address ($ra), global pointer ($gp), stack pointer ($sp), and frame pointer ($fp)

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

What is the purpose of the Arithmetic and Logic Unit (ALU) in the Processing Unit?

A

It performs arithmetic and logical operations on data

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

What are the fundamental components of the von Neumann model?

A
  • Memory
  • Processing Unit
  • Input
  • Output
  • Control Unit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How is an addition operation represented in MIPS assembly language?

A

Using the ‘add’ instruction: add $d, $s, $t, where $d is the destination and $s, $t are source operands

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

How does the MIPS assembly handle the loading of immediate values?

A

Using the ‘li’ (load immediate) instruction, or through a combination of ‘lui’ (load upper immediate) and ‘ori’ (OR immediate)

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

What key functions does the Control Unit perform in a computer system?

A

It directs the operation of the processor and coordinates the activities of the other components

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

How does MIPS handle temporary variables during function calls?

A

Temporary variables can be stored in $t registers, which are not preserved across function calls

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

How do data movement instructions in MIPS function?

A

They read data from memory or write data to memory

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

What role do immediate values play in MIPS instructions?

A

Immediate values provide constants directly in the instruction for operations without requiring a separate load

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

What are the conventions surrounding caller and callee functions in MIPS?

A

The caller passes arguments and jumps to the callee, which must return the result without overwriting essential registers

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

What is the major difference between RISC and CISC architectures?

A
  • RISC (Reduced Instruction Set Computer) uses a small, highly optimised instruction set
  • CISC (Complex Instruction Set Computer) uses a larger set of instructions, including more complex ones
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the significance of the ‘shamt’ field in the R-format instruction?

A

The ‘shamt’ field specifies the amount of shift for shift operations in R-format instructions

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

How many types of instructions are defined in the MIPS ISA?

A

Three main types:
- Operate instructions
- Data movement instructions
- Control flow instructions

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

How is a MIPS function call executed with the jump and link (jal) instruction?

A

‘jal’ saves the return address in $ra and jumps to the specified function

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

What is meant by ‘word length’ in the context of the MIPS architecture?

A

In MIPS, word length is 32 bits, meaning integers and addresses are typically 32 bits long

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

How does an Instruction Set Architecture (ISA) differ from microarchitecture?

A

ISA defines the set of instructions a processor can execute, while microarchitecture refers to how those instructions are implemented in hardware

17
Q

How is the instruction format structured in MIPS?

A

There are multiple formats: R-format, I-format, and J-format, each with specific fields and layouts for different types of instructions

18
Q

Why is the concept of modular functions important in programming?

A

Modular functions enhance code reusability, readability, and maintainability by encapsulating functionality

19
Q

How are conditional branches implemented in MIPS assembly code?

A

Using instructions like ‘beq’ for branching based on equality or ‘bne’ for branching based on inequality

20
Q

How are arrays accessed in MIPS assembly programming?

A

By loading the base address into a register and using offsets to access elements

21
Q

In MIPS, how is a while loop structure typically represented in assembly?

A

Using a combination of branch instructions to check the loop condition and jump back to the start of the loop

22
Q

What is the difference between load word (lw) and store word (sw) instructions?

A

‘lw’ retrieves a word from memory into a register, while ‘sw’ stores a word from a register into memory

23
Q

What happens during a procedure return in MIPS assembly language?

A

The return address is retrieved from $ra, and control is transferred back to the caller using ‘jr $ra’

24
Q

What is the role of the stack pointer in MIPS architecture?

A

The stack pointer ($sp) points to the top of the current stack frame, managing local variables and function arguments

25
How does the R-format instruction in MIPS differ from I-format instruction?
- R-format instructions use three registers - I-format includes an immediate value
26
What instruction is used to implement a branch instruction in MIPS?
Branch instructions like 'beq' (branch if equal) and 'bne' (branch if not equal) are used
27
What are the steps involved in a for loop implementation in MIPS?
Initialize the loop variable, check the condition with a branch, perform body actions, increment the loop variable, and loop back
28
How does MIPS handle function return values?
Return values are typically stored in the $v0 register by the callee and accessed by the caller after a return
29
What is the significance of the PC or IP in the von Neumann architecture?
PC (Program Counter) or IP (Instruction Pointer) tracks the address of the next instruction to be executed
30
How are MIPS instructions encoded in terms of binary representation?
MIPS instructions are encoded as 32-bit instruction words called machine code