4.1.4Computer Architecture (Deep)

ARM architecture intro — used in embedded - aerospace

2,016 words9 min readdifficulty · medium1 backlinks

WHAT is ARM?

WHY it matters for embedded/aerospace:

  • Low power → runs on batteries / harvested energy.
  • Deterministic timing → simple pipeline means you can predict worst-case execution time (WCET), essential for real-time flight control.
  • Small, cheap, scalable → from tiny Cortex-M microcontrollers to Cortex-A application processors.

WHY RISC? (deriving the philosophy from first principles)

Imagine you must design a CPU. Every instruction must be fetched, decoded, executed. Two roads:

  1. CISC (e.g., x86): one instruction can do a lot (e.g., "load from memory, multiply, store back" in a single opcode). Instructions are variable length. Decoding is complex.
  2. RISC (ARM): each instruction does one simple thing, all instructions are the same length, and only special load/store instructions touch memory.

The Load/Store principle

WHY? Memory access has unpredictable latency (cache miss!). By separating "talk to memory" (LDR/STR) from "compute" (ADD/SUB), each instruction has a more uniform, predictable cost — again helping real-time guarantees.


HOW ARM is laid out: registers

WHY many registers? Because the ALU can't touch memory, you need plenty of "scratch" slots on-chip. More registers ⇒ fewer slow memory trips ⇒ faster & lower power.


The classic 5-stage pipeline

The classic ARM stages: Fetch → Decode → Execute (and in 5-stage cores: Fetch, Decode, Execute, Memory, Write-back).

Figure — ARM architecture intro — used in embedded - aerospace

A signature ARM feature: conditional execution


Worked examples


Common mistakes (Steel-manned)


Recall Feynman: explain to a 12-year-old

Think of a CPU as a kitchen. ARM's rule is: chefs (the math part) can only cook with ingredients already on the counter (registers). If something's in the fridge (memory), one worker must fetch it to the counter first (LOAD), and put it back after (STORE). Because every recipe card is the same size and does one small step, the kitchen runs like a smooth assembly line — fast and using very little electricity. That's why ARM is in your phone and even in spaceships, where saving power and never getting confused about timing really matters.


Active recall

What does RISC stand for and what's its core idea?
Reduced Instruction Set Computer — simple, fixed-length instructions; hardware stays simple, compiler does the clever work.
In a load/store architecture, can the ALU read directly from memory?
No. You must LDR a value into a register first; arithmetic works only on registers/immediates.
Which ARM registers are special and what are they?
R13=SP (stack pointer), R14=LR (link register), R15=PC (program counter).
What four flags live in the CPSR?
N (Negative), Z (Zero), C (Carry), V (oVerflow).
Derive the pipeline time for n instructions, k stages, cycle τ.
T = (k + n − 1)·τ; speedup S = nk/(k+n−1) → k as n→∞.
Why is conditional execution good for pipelines?
It replaces small branches with predicated straight-line code, avoiding branch mispredict flushes → predictable timing.
Does ARM manufacture most ARM chips?
No — ARM licenses the ISA/IP; vendors fabricate the silicon.
Why is ARM favoured in aerospace/embedded?
Low power (performance-per-watt), simple predictable pipeline (deterministic WCET), and scalable cores.
What makes ARM's fetch stage simple?
Fixed-length instructions (32-bit, or 16-bit Thumb) — the CPU always knows where the next instruction begins.

Connections

Concept Map

instantiated by

licenses

implemented by

requires

requires

provides

enables

gives

yields

yields

optimizes

enables

enables

RISC philosophy

ARM architecture

ISA - software/hardware contract

Apple Qualcomm ST silicon

Fixed-length instructions

Load/Store only touches memory

Many registers R0..R15

Simple regular pipeline

Uniform predictable cost

Predictable WCET timing

Performance-per-watt

Embedded / Aerospace use

Hinglish (regional understanding)

Intuition Hinglish mein samjho

ARM basically ek RISC architecture hai — matlab instructions chhote, simple aur fixed-length hote hain. Idea simple hai: hardware ko simple rakho, compiler ko mehnat karne do. Isi wajah se ARM chips bahut kam power kha kar bhi achhi speed dete hain. Yehi reason hai ki aapke phone se lekar satellites aur flight computers tak, sab jagah ARM milta hai — kyunki battery aur radiation-hardened budget mein "performance per watt" sabse zaruri cheez hai.

Sabse important rule hai load/store: ALU (jo math karta hai) sirf registers ke saath kaam karta hai. Agar value memory mein hai, to pehle LDR karke register mein laao, kaam karo, fir STR se wapas bhejo. Ye separation isliye hai taaki har instruction ka cost predictable rahe — memory access slow aur unpredictable hota hai, to usse alag rakha gaya.

Pipeline ko assembly line ki tarah samjho: jab ek instruction execute ho raha hai, doosra decode ho raha hai, teesra fetch ho raha hai. Isse roughly har clock cycle mein ek instruction complete hota hai. Formula yaad rakho: total time = (k+n1)τ(k + n - 1)\tau, aur speedup kk ke kareeb pahuchta hai. Aur ARM ka ek special feature hai conditional execution (jaise ADDEQ) — chhoti if conditions ke liye branch lene ki zarurat nahi, jisse pipeline flush nahi hota aur timing predictable rehti hai. Aerospace mein yehi deterministic timing sabse badi cheez hai.

Go deeper — visual, from zero

Test yourself — Computer Architecture (Deep)

Connections