Questions: Addressing Modes and Instruction Format

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A compiler needs to access element A[i] of an integer array, where the array's base address is in R1 and the index i is in R2. Which addressing mode is most appropriate?

AImmediate mode — embed the element value directly in the instruction
BDirect addressing — use a fixed memory address stored in the instruction
CScaled indexed addressing — compute address as R1 + R2 × element_size at runtime
DRegister mode — the value is already in a register, no memory access needed
Question 2 Multiple Choice

Processor A uses fixed 32-bit instructions; Processor B uses variable-length instructions (1–15 bytes). Which statement correctly identifies a tradeoff?

AFixed-length instructions have more complex decode logic but allow richer addressing modes
BVariable-length instructions simplify pipeline design but restrict addressing to immediate and register modes
CFixed-length instructions simplify pipeline design (all fetches are identical) but constrain the range of immediate values and addressing modes that fit in a fixed bit budget
DVariable-length instructions are always faster because they use fewer total bytes
Question 3 True / False

Register indirect addressing — loading from the address stored in a register rather than from the register's value — is the hardware mechanism that implements pointer dereferencing.

TTrue
FFalse
Question 4 True / False

Immediate mode addressing is the most flexible addressing mode because operands are available instantly without any memory access.

TTrue
FFalse
Question 5 Short Answer

Explain how the set of addressing modes in an instruction set reflects the data access patterns that programmers need to express in high-level languages.

Think about your answer, then reveal below.