4.1.4 · HinglishComputer Architecture (Deep)

ARM architecture intro — used in embedded - aerospace

1,896 words9 min readRead in English

4.1.4 · Coding › Computer Architecture (Deep)


ARM KYA hai?

Embedded/aerospace ke liye WHY matters:

  • Low power → batteries / harvested energy pe chalta hai.
  • Deterministic timing → simple pipeline matlab aap worst-case execution time (WCET) predict kar sakte ho, jo real-time flight control ke liye zaroori hai.
  • Small, cheap, scalable → tiny Cortex-M microcontrollers se lekar Cortex-A application processors tak.

RISC KYO? (philosophy ko first principles se derive karna)

Socho tumhe ek CPU design karna hai. Har instruction ko fetch, decode, execute karna padega. Do raaste hain:

  1. CISC (e.g., x86): ek instruction bahut kuch kar sakti hai (e.g., "load from memory, multiply, store back" ek hi opcode mein). Instructions variable length ki hoti hain. Decoding complex hoti hai.
  2. RISC (ARM): har instruction ek simple kaam karti hai, saari instructions same length ki hoti hain, aur sirf khaas load/store instructions memory ko touch karti hain.

Load/Store principle

KYU? Memory access ki latency unpredictable hoti hai (cache miss!). "Memory se baat karo" (LDR/STR) aur "compute karo" (ADD/SUB) ko alag karke, har instruction ki ek zyada uniform, predictable cost hoti hai — phir se real-time guarantees mein madad karta hai.


ARM kaise laid out hai: registers

Zyada registers KYU? Kyunki ALU memory ko touch nahi kar sakta, toh on-chip "scratch" slots ki achi khaasi zaroorat hoti hai. Zyada registers ⇒ kam slow memory trips ⇒ faster aur lower power.


Classic 5-stage pipeline

Classic ARM stages: Fetch → Decode → Execute (aur 5-stage cores mein: Fetch, Decode, Execute, Memory, Write-back).

Figure — ARM architecture intro — used in embedded - aerospace

ARM ki ek khaas feature: conditional execution


Worked examples


Common mistakes (Steel-manned)


Recall Feynman: ek 12-saal ke bache ko samjhao

CPU ko ek kitchen samjho. ARM ka rule hai: chefs (math wala part) sirf counter pe rakhe ingredients (registers) se hi cook kar sakte hain. Agar kuch fridge mein hai (memory), toh ek worker ko pehle use counter pe laana padega (LOAD), aur kaam ke baad wapas rakhna padega (STORE). Kyunki har recipe card same size ki hai aur ek chota sa step karta hai, kitchen ek smooth assembly line ki tarah chalta hai — fast aur bahut kam bijli use karke. Issi liye ARM tumhare phone mein hai aur spaceships mein bhi, jahan power bachana aur timing ke baare mein kabhi confuse na hona sach mein important hai.


Active recall

RISC ka full form kya hai aur uska core idea kya hai?
Reduced Instruction Set Computer — simple, fixed-length instructions; hardware simple rehta hai, clever kaam compiler karta hai.
Load/store architecture mein, kya ALU seedha memory se read kar sakta hai?
Nahi. Pehle LDR se value register mein laani padti hai; arithmetic sirf registers/immediates pe kaam karta hai.
ARM ke kaunse registers special hain aur woh kya hain?
R13=SP (stack pointer), R14=LR (link register), R15=PC (program counter).
CPSR mein kaunse chaar flags hote hain?
N (Negative), Z (Zero), C (Carry), V (oVerflow).
n instructions, k stages, cycle τ ke liye pipeline time derive karo.
T = (k + n − 1)·τ; speedup S = nk/(k+n−1) → k as n→∞.
Conditional execution pipelines ke liye achha kyun hai?
Yeh chote branches ko predicated straight-line code se replace karta hai, branch mispredict flushes avoid hote hain → predictable timing.
Kya ARM zyataar ARM chips manufacture karta hai?
Nahi — ARM ISA/IP license karta hai; vendors silicon fabricate karte hain.
ARM aerospace/embedded mein kyun preferred hai?
Low power (performance-per-watt), simple predictable pipeline (deterministic WCET), aur scalable cores.
ARM ka fetch stage simple kya banata hai?
Fixed-length instructions (32-bit, ya 16-bit Thumb) — CPU ko hamesha pata hota hai agli instruction kahan se shuru hoti hai.

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