4.1.4 · D5Computer Architecture (Deep)

Question bank — ARM architecture intro — used in embedded - aerospace

1,471 words7 min readBack to topic

True or false — justify

TRUE or FALSE: An ARM instruction like ADD R0, [R1], [R2] (add two memory words directly) is legal.
FALSE. ARM is load/store — the ALU only sees registers and immediates, so you must LDR both operands into registers first. The [R1] syntax is only valid on LDR/STR.
TRUE or FALSE: Because every ARM instruction is 32 bits, ARM code is always smaller than variable-length CISC code for the same task.
FALSE. Fixed length wastes bits on simple ops, so ARM code can be larger; that is exactly why the compact Thumb 16-bit set exists to shrink it back down.
TRUE or FALSE: A 5-stage pipeline makes each individual instruction finish 5× faster.
FALSE. Each instruction still takes 5 stages (its latency is unchanged); the pipeline raises throughput to ~1 instruction per cycle by overlapping stages of different instructions.
TRUE or FALSE: ARM designs its own fabs and manufactures the chips in your phone.
FALSE. ARM licenses the ISA/IP (the blueprint); vendors like Apple, ST, and NXP fabricate the silicon. ARM sells the contract, not the factory.
TRUE or FALSE: Conditional execution (ADDEQ) means the instruction is skipped in the pipeline, saving that cycle.
FALSE. A predicated instruction still flows through every stage; it just doesn't write its result when the condition is false. The win is avoiding a branch and its possible flush, not saving a cycle.
TRUE or FALSE: More pipeline stages is strictly better because speedup .
FALSE. Deeper pipelines pay bigger penalties on every branch misprediction and add per-stage overhead, so embedded/aerospace cores keep pipelines short for predictable timing over peak throughput.
TRUE or FALSE: The Program Counter (PC) is a special register, so ordinary instructions can never touch it.
FALSE. In ARM32 the PC is , a general-purpose register — writing to it is literally how a branch happens. That is a defining ARM quirk, not a forbidden move.
TRUE or FALSE: RISC means "fewer total instructions in the ISA than CISC."
MISLEADING/FALSE. "Reduced" refers to each instruction doing one simple thing (reduced complexity per op), not to the count of opcodes. Modern ARM has plenty of instructions.
TRUE or FALSE: Because load/store separates memory from compute, an LDR and an ADD always take the same number of cycles.
FALSE. LDR can still stall on a cache miss. Load/store makes cost more uniform and predictable, but memory latency is not literally constant.

Spot the error

What is wrong with: "ADD R6, R4, [R5] ; add the word at address R5 to R4"?
The [R5] operand is illegal for ADD. Load first: LDR R7, [R5] then ADD R6, R4, R7. Arithmetic never dereferences memory in a load/store machine.
What is wrong with: "I'll use BEQ after every compare to conditionally add 1 — branches are free in ARM"?
Branches are the opposite of free: a mispredicted branch flushes the partly-built pipeline. Prefer predication (ADDEQ) which stays straight-line and never flushes.
What is wrong with: "The CPSR flags are N Z C W (Negative, Zero, Carry, Wrap)"?
The last flag is V (oVerflow), not W. Overflow means a signed result exceeded the representable range; carry (C) is the unsigned counterpart — two different flags for two different number interpretations.
What is wrong with: "In the 5-stage pipeline the Memory stage runs for every instruction, so every op reads memory"?
Only LDR/STR actually access memory in that stage; for an ADD the Memory stage is a pass-through. The stage exists for all, but is used only by load/store.
What is wrong with: "Speedup formula , so with instruction I get a 5× speedup on a 5-stage pipe"?
With , — no speedup at all, because you paid the full 5-cycle fill for a single instruction. The limit only holds as .
What is wrong with: "ARM has 16 registers and all 16 are free scratch space for my computation"?
Three are reserved: =SP, =LR, =PC. Clobbering SP or LR corrupts your stack/return address, so you have ~13 truly free general registers.

Why questions

Why does ARM forbid the ALU from reading memory directly?
Memory latency is variable (a cache miss costs many cycles). Splitting "talk to memory" (LDR/STR) from "compute" gives each instruction a more uniform, predictable cost — essential for WCET guarantees.
Why do fixed-length instructions make the fetch stage trivial?
If every instruction is exactly 32 (or 16) bits, the CPU knows where the next one starts without decoding the current one, so fetch never waits on decode — the pipeline stays regular and predictable.
Why does ARM give the programmer so many registers?
Because the ALU can't touch memory, you need lots of on-chip scratch slots; more registers mean fewer slow memory trips, which is both faster and lower power.
Why is predictable timing worth sacrificing peak clock speed in aerospace?
Flight control must guarantee a task finishes before its deadline every single time. A simple, predictable pipeline lets engineers bound worst-case time; a faster-but-erratic core cannot give that guarantee.
Why does predication (conditional execution) help the pipeline more than a well-predicted branch?
Even a predicted branch risks a misprediction flush and disturbs fetch; predication is plain straight-line code with a fixed cycle count, so timing is deterministic — no guessing, no flush.
Why does performance-per-watt matter more than raw GHz in embedded/aerospace?
These systems run on batteries, harvested energy, or radiation-hardened power budgets; work done per joule sets how long they last and how much heat they dump, which raw clock speed ignores.

Edge cases

Edge case: what is the pipeline speedup when instruction on a -stage pipe?
— exactly no speedup, because you pay the full fill cost with nothing to overlap.
Edge case: what happens to the speedup as ?
. The one-time -cycle fill becomes negligible, so in steady state one instruction completes per cycle and you approach the ideal . It never exceeds .
Edge case: a compare CMP R0, R1 where R0 and R1 are equal — which flag is set and how does ADDEQ react?
The Z (Zero) flag becomes 1 (the subtraction gave zero). ADDEQ sees Z=1, so its condition holds and the add does execute.
Edge case: you write a value into (PC) with a normal MOV — what happens?
Execution jumps to that address, because is the program counter; a plain data instruction becomes an effective branch. This is legal ARM behaviour, not an error.
Edge case: an LDR hits a cache miss on a real-time deadline — does load/store still guarantee timing?
No — the miss can blow the budget. Load/store makes cost predictable to analyse, but WCET tools must still account for miss penalties, or the memory be locked/deterministic.
Edge case: with ADDS (add and set flags) the result overflows a signed 32-bit range — which flag captures that, and does the add still write its result?
The V (oVerflow) flag is set to 1, and the (wrapped, truncated) result is still written to the destination register. Overflow flags the problem; it does not suppress the write.