Nov 19, 2026·Pranesh Mahanta·21CSS201T — Computer Organization and Architecture
Why and how computers do many things at once — Flynn’s classification, the promises and limits of parallel execution, and a case study of the ARM processor with its Thumb set, encoding, load/store architecture and the ARM7/ARM5 generations.
For decades single processors grew faster simply by raising the clock frequency. That road ended: transistor densities kept rising but power dissipation grew faster than performance, forcing designers to keep clocks moderate and instead put many processing cores on one chip. At the same time, demand exploded from workloads that are naturally concurrent — graphics, machine learning, scientific simulation, web servers serving thousands of clients. Parallelism is the answer on both sides: it converts extra transistors into performance by letting many operations proceed simultaneously rather than making one instruction stream arbitrarily fast.
Sequential time: T1 = total work done on one processor.
Parallel time: TN = time using N processors. Speedup S(N) = T1/TN.
Efficiency = S(N)/N.
Parallelism is not free performance: it must be exposed by the programmer or compiler, coordinated by hardware, and paid for in communication and synchronisation overhead. The rest of this unit is about the architectures that make that trade worthwhile.
2Types of parallelism
Parallelism appears at several levels of a machine simultaneously. Bit-level parallelism widens the datapath — a 32-bit adder computes in one step what a 4-bit adder does in eight. Instruction-level parallelism (ILP) overlaps instructions of a single program through pipelining, superscalar issue and out-of-order execution. Data-level parallelism applies one operation to many data elements at once, in vector units and SIMD extensions. Task-level (thread) parallelism runs independent threads or processes on separate cores. These levels compose: a modern SoC combines wide datapaths, deep pipelines, SIMD units and many cores.
Type
Granularity
Where it lives
Example
Bit-level
within one operation
datapath width
32-bit adder vs byte-serial adder
Instruction-level
adjacent instructions
pipeline, superscalar, OoO
5-stage pipeline issuing 2 IPC
Data-level
arrays / vectors
SIMD & vector units
NEON: 4 × 32-bit lanes per instruction
Task-level
threads / processes
multicore, clusters
8 cores running 8 render tiles
Temporal vs spatial parallelism is the textbook pairing: a pipeline shares one unit over time (temporal), while an array of processors duplicates units in space (spatial). SIMD and multicore belong to the spatial family; pipelining to the temporal one.
3Applications of parallelism
Parallel machines earn their complexity wherever the work decomposes into independent pieces. Classic domains include weather and climate modelling, computational fluid dynamics, finite-element structural analysis and molecular dynamics — grids of cells updated by the same stencil over and over. Graphics and image processing are inherently per-pixel parallel, which is why GPUs evolved into SIMD-heavy many-core engines and now dominate machine-learning training. Data-centre workloads parallelise across requests: database queries, web serving, map-reduce analytics. Even embedded systems use parallelism — DSP chains for audio and video codecs apply SIMD instructions to sample streams in real time.
Scientific simulation: finite-difference grids, N-body problems, Monte Carlo sampling.
Media and graphics: shaders, video encoding, image filters — one instruction, many pixels.
Machine learning: matrix multiplication dominated, mapped to GPUs and tensor units.
Enterprise and web: request-level parallelism across server cores and clusters.
The common pattern is regularity: parallel hardware pays off when the same operation repeats over large, independent data. Irregular, branch-heavy, pointer-chasing workloads parallelise poorly and stay single-thread bound.
4Challenges of parallelism and Amdahl’s law
Real programs contain inherently serial sections — setup, I/O, global reductions — that no number of processors accelerates. Amdahl’s law quantifies the ceiling: if fraction f of the work is serial, the best speedup on N processors is 1/(f + (1 − f)/N), and as N grows the speedup saturates at 1/f no matter how many processors are added. Beyond Amdahl, practical challenges include synchronisation overhead (locks and barriers cost time and serialise), load imbalance (the slowest thread sets the finish time), communication cost (moving data between cores or nodes can cost more than computing on it), and memory-bandwidth limits shared by all cores.
Amdahl’s law: S(N) = 1 / ( f + (1 − f)/N ), f = serial fraction of total work.
Limiting speedup as N → ∞: S = 1/f.
Worked problem · applying Amdahl’s law
(a) A program has 5% of its work in an inherently serial section. What speedup is achieved on 64 processors, and what is the maximum possible speedup? (b) Repeat for 10% serial on 32 processors.
(a) f = 0.05, N = 64:
S = 1/(0.05 + 0.95/64) = 1/(0.05 + 0.014844) = 1/0.064844 ≈ 15.42.
Maximum speedup = 1/f = 1/0.05 = 20 — even infinitely many processors only twenty-fold the speed. (b) f = 0.10, N = 32:
S = 1/(0.10 + 0.90/32) = 1/(0.10 + 0.028125) = 1/0.128125 ≈ 7.80.
Maximum speedup = 1/0.10 = 10. Observation: in both cases the machine is idle-dominated by the serial tail: 64 processors finish in the time of roughly 15, because the serial 5% pins the whole run to its duration.
Amdahl assumes the problem size is fixed. Gustafson’s counterpoint: with scaled-up problems the parallel fraction grows with N, so measured speedups can keep rising — both views appear in examination questions, so know which assumption each makes.
5Flynn’s classification: SISD, SIMD, MISD, MIMD
Michael Flynn (1966) classified computer architectures by the number of concurrent instruction streams and data streams visible at the machine level, giving the four-way taxonomy used ever since. It describes the machine’s organisation rather than its implementation details, which is exactly why it survives: it tells you how the hardware presents parallelism to the software.
Figure — Flynn’s four quadrants, organised by instruction streams (horizontal) and data streams (vertical), with the characteristic architectures of each.
Worked problem · SIMD array processor timing
An SIMD array processor has 16 processing elements (PEs), each capable of one vector-element operation in 4 clock cycles. A vector operation must be applied to 256 elements, and broadcasting one instruction to all PEs takes 2 cycles. Compare the cycle counts of the same operation on a single-PE (SISD) machine and on the array processor, and compute the speedup.
SISD time: one element at a time: 256 × 4 = 1024 cycles. SIMD time: 256 elements / 16 PEs = 16 elements per PE; each PE does 16 × 4 = 64 cycles of work. Add the broadcast: 2 + 64 = 66 cycles. Speedup: 1024 / 66 ≈ 15.5. Check against Amdahl: 15.5 of a maximum 16 confirms the broadcast overhead costs only a few percent — SIMD is efficient precisely because the “serial fraction” here is one 2-cycle broadcast per instruction.
6SISD and SIMD in depth
SISD is the organisation of every classic uniprocessor: one instruction stream fetched from one memory, one data stream, sequential semantics. Note that a pipelined or superscalar SISD machine still classifies as SISD — Flynn’s taxonomy counts architecturally visible streams, and a pipeline presents a single sequential stream to the programmer. SIMD machines replicate the datapath but not the control: one control unit broadcasts each instruction to many processing elements, each of which holds its own data and its own local memory or registers. Synchronous lockstep execution makes SIMD ideal for regular loops over arrays and hopeless for code dominated by data-dependent branches, where most PEs would sit idle under their masks.
SIMD execution: each PE computes PEi ← f(Di) in lockstep; a mask register disables inactive PEs.
Modern descendants of SIMD hide inside ordinary CPUs: SSE/AVX on x86, NEON on ARM, and the vector lanes of GPU shader units. The programmer writes explicit vector instructions, or the compiler auto-vectorises regular loops.
7MISD and MIMD organisations
MISD — many instruction streams applied to a single data stream — is the rarest category: examples are systolic arrays pumping one datum through a chain of computing cells, and triple-redundant fault-tolerant flight computers that run several programs on the same input and vote on the result. MIMD is the workhorse of real parallel computing: fully independent processors execute independent instruction streams on independent data. MIMD machines divide by how processors see memory. In shared-memory systems (SMP, multicore chips, NUMA servers) all processors address one common memory and communicate by reading and writing it; in distributed-memory systems (clusters, message-passing MPPs) each node has private memory and communicates by explicit message passing.
Aspect
Shared memory (MIMD-SM)
Distributed memory (MIMD-DM)
Communication
load/store to common memory
explicit messages between nodes
Programming model
threads, OpenMP
message passing, MPI
Bottleneck
memory bus and coherence traffic
network latency and bandwidth
Examples
multicore CPU, SMP server
compute cluster, supercomputer nodes
The dominant MIMD programming style is SPMD (single program, multiple data): every processor runs the same program but on its own portion of the data, branching by its own identity. It is how nearly all MPI codes are written, even though the hardware is MIMD.
8ARM processor: cores and CPU structure
ARM implements a classic RISC philosophy: a load/store architecture (only dedicated load and store instructions touch memory), fixed-length instructions, a large register file and simple address generation. In ARM state the CPU offers sixteen visible 32-bit registers R0–R15, with R13 serving as the stack pointer (SP), R14 as the link register (LR) that receives return addresses on CALL, and R15 as the program counter (PC). The current program status register (CPSR) holds the condition flags N, Z, C, V plus interrupt-mask and mode bits — and nearly every ARM instruction can execute conditionally by encoding the condition in its leading four bits. Family history runs from ARM7 through ARM9/ARM11 to the Cortex-M/R/A lines, each adding pipeline depth, caches and extensions while keeping the architectural base.
Register
Name
Role
R0–R12
general purpose
operands and results; some hold arguments per the calling convention
R13
SP
stack pointer for push/pop operations
R14
LR
link register — return address saved by a call (BL)
R15
PC
program counter; reads as current instruction + 8 in ARM7 3-stage pipeline
CPSR
status
N, Z, C, V flags; I/F interrupt masks; processor mode
ARM supports two instruction states: ARM state with 32-bit encodings and Thumb state with 16-bit encodings, switchable at run time. The next section explains why Thumb exists.
9The Thumb instruction set
Thumb is a compressed 16-bit encoding of a functional subset of the ARM instruction set. Because Thumb instructions are half the width, a program occupies roughly 65–70% of the memory its ARM equivalent needs, which cuts cost and power in embedded systems with narrow memory buses and improves fetch efficiency from 16-bit memories. The price is a smaller instruction repertoire: Thumb drops some conditional execution on most instructions, restricts register access (many operations touch only the low registers R0–R7), and sometimes needs two Thumb instructions where ARM needs one, so execution takes somewhat more instructions for the same job.
ARM instruction: 32 bits, full register set, per-instruction conditional execution.
Thumb instruction: 16 bits, mostly R0–R7, tighter encodings, ≈30–35% code-size saving.
Both states execute on the same core and can be intermixed by BX (branch and exchange).
Worked problem · Thumb code density
A firmware routine compiles to 200 ARM instructions. Its Thumb equivalent needs 300 Thumb instructions (more instructions for the same job). Compute the memory each version occupies, the percentage saving of Thumb, and comment on fetch efficiency over a 16-bit memory bus.
ARM version: 200 × 4 bytes = 800 bytes. Thumb version: 300 × 2 bytes = 600 bytes. Saving: (800 − 600)/800 = 25% less memory despite needing 50% more instructions. Fetch efficiency: over a 16-bit bus each ARM fetch delivers half an instruction, so a 32-bit instruction consumes two bus cycles; Thumb fetches one instruction per cycle, keeping the pipeline fed from narrower memory. Conclusion: for memory-limited embedded designs, Thumb’s 25% saving plus single-cycle fetches usually outweighs the extra instructions executed.
Thumb-2 (later technology) mixed 16- and 32-bit encodings in one state, recovering most of the missing instructions while keeping the density — it is why modern Cortex-M processors run only Thumb-2 code.
10Instruction encoding format
An ARM instruction is a fixed 32-bit word whose top four bits are the condition field (1110 = AL, always execute; 0000 = EQ, execute if Z = 1; 0001 = NE; and so on). The remaining 28 bits vary by instruction class. The data-processing format is the one to memorise: bits 27–26 = 00, bit 25 (I) selects an immediate operand, bits 24–21 hold the opcode (ADD = 0100, SUB = 0010, MOV = 1101, CMP = 1010…), bit 20 (S) sets flags, then Rn, Rd, and a 12-bit operand2 field — either an 8-bit immediate with a 4-bit rotate, or a register with an optional shift. Load/store, branch, multiply and coprocessor classes reuse the same top bits with different layouts.
Example layout: E = 1110 (always), 3A = 0011 1010 → I = 1, opcode = 1101 = MOV, S = 0.
Worked problem · decoding and encoding
(a) Decode the 32-bit instruction word E3A0000116: give its condition, class, opcode, destination register and effective operation. (b) Encode MOV R1, #5 into the same format and write the resulting word in hexadecimal.
(a) Decode E3A00001: in binary 1110 0011 1010 0000 0000 0000 0000 0001.
cond = 1110 = AL (always execute). Bits 27–25 = 001 → data processing, immediate operand (I = 1). Opcode bits 24–21 = 1101 = MOV, S = 0. Rn = 0000 (unused for MOV), Rd = 0000 = R0. Rotate = 0000, imm8 = 00000001 = 1. Meaning: MOV R0, #1 — load the constant 1 into R0. (b) Encode MOV R1, #5: cond = 1110; class bits 001 (immediate); opcode MOV = 1101; S = 0; Rn = 0000; Rd = 0001 (R1); rotate = 0000; imm8 = 00000101.
Assembled: 1110 0011 1010 0001 0000 0000 0000 0101 = E3A01005. Check: the word differs from E3A00001 only in the Rd and imm8 fields — exactly the two operands that changed.
The 12-bit operand2 encodes 8-bit immediates rotated by any even number of positions, so a constant like 0xFF000000 is reachable as 0xFF rotated right by 8 — but an arbitrary 32-bit constant is not, and the assembler then loads it from a literal pool instead.
11Memory load and store instructions
ARM touches memory only through load (LDR — read memory into a register) and store (STR — write a register to memory); all arithmetic works on registers. Sizes come in word (32-bit), halfword (LDRH/STRH) and byte (LDRB/STRB) forms. Addressing is written [Rn, offset] and comes in three behaviours: pre-indexed[Rn, #off] computes Rn + off for the access but leaves Rn unchanged; pre-indexed with writeback[Rn, #off]! also updates Rn to Rn + off; and post-indexed[Rn], #off accesses at Rn first, then updates Rn. Offsets may be a register (optionally shifted). Block forms LDM/STM move several registers in one instruction, which is how prologue/epilogue code saves and restores the register set around a call.
Initially R1 = 2000H, and memory holds M[2000H] = 11H and M[2008H] = 5AH (each a byte for byte forms; treat the LDR forms as word reads at the stated addresses). For each instruction state the value loaded and the final value of R1: (a) LDR R0, [R1, #8]; (b) LDR R0, [R1, #8]!; (c) LDR R0, [R1], #8; (d) STR R2, [R1, #-4].
(a) LDR R0, [R1, #8] (pre-index, no writeback): address = 2000H + 8 = 2008H → R0 = M[2008H] = 5AH; R1 stays 2000H. (b) LDR R0, [R1, #8]! (pre-index with writeback): address = 2008H → R0 = 5AH; R1 is updated to 2008H. (c) LDR R0, [R1], #8 (post-index): access at the old R1 = 2000H → R0 = M[2000H] = 11H; then R1 becomes 2000H + 8 = 2008H. (d) STR R2, [R1, #-4] (store): address = 2000H − 4 = 1FFCH, where R2 is written; R1 remains 2000H. Pattern: the position of the ! and the offset side decide whether the address is adjusted before or after the access — (b) and (c) both end with R1 = 2008H but load different bytes.
Post-indexed load/store is the natural array-walk idiom: one instruction reads the element and advances the pointer, which is exactly why the ARM load/store model suits tight DSP and copy loops.
12Basics of I/O operations
Peripherals are reached either by memory-mapped I/O, where device registers occupy ordinary address-space locations and are read/written with normal load/store instructions (the ARM way), or by port-based I/O with dedicated IN/OUT instructions and a separate address space (the 8086 way). Data transfer then runs under one of three disciplines: programmed I/O (polling) has the CPU repeatedly test a status flag — simple but wastes cycles; interrupt-driven I/O lets the device signal the CPU, which services it only when needed; DMA (direct memory access) hands the transfer to a controller that moves whole blocks between device and memory without CPU involvement, leaving the processor free except for setup and a completion interrupt.
Figure — a memory map of a typical ARM system: code, RAM and peripheral registers all live in one address space, so loads and stores serve both data and I/O.
Worked problem · DMA transfer time and CPU availability
A disk interface transfers 8 KB of data to memory through a DMA controller running at 4 × 106 bytes/s. The CPU (100 MHz, 4 cycles per instruction) is involved only in setting up the DMA and handling the completion interrupt. (a) How long does the transfer take? (b) Roughly how many instructions can the CPU execute during the transfer?
(a) 8 KB = 8192 bytes. Time = 8192 / (4 × 106 B/s) = 2.048 × 10−3 s ≈ 2.05 ms. (b) In 2.048 ms the CPU completes 2.048 × 10−3 × 100 × 106 = 204,800 cycles; at 4 cycles per instruction that is 204,800/4 = 51,200 instructions executed concurrently. Comparison: under polling, those same 204,800 cycles would be spent testing a status flag — DMA recovers essentially the whole window for useful work.
Polling is still the right choice for tiny, fast devices where an interrupt’s save/restore overhead exceeds the wait itself; the disciplines are chosen per device, not per machine.
13Case study: ARM7 architecture
The ARM7 family — the best-known part being ARM7TDMI — implements the ARMv4 architecture with a classic 3-stage pipeline: Fetch, Decode and Execute. It is a von Neumann machine: one memory interface serves both instructions and data, so instruction and data fetches share the same bus and a load occupying the memory stage cannot overlap with an instruction fetch. The suffixes name its features: T = Thumb 16-bit instruction support, D = on-chip debug, M = fast 32×8 multiplier, I = ICE in-circuit emulation. With no caches and a small die, ARM7 became the workhorse of low-power embedded controllers and, historically, of early mobile phones.
Figure — the ARM7 three-stage pipeline: once filled, the fetch, decode and execute stages stay busy with consecutive instructions, one completing each cycle.
In the 3-stage pipeline the PC value read by an instruction is two instructions ahead (current + 8 bytes in ARM state) — the reason PC-relative literal addresses in hand-written ARM code must account for the pipeline offset.
14Case study: ARM5 (ARMv5) architecture
The ARMv5 generation (implemented by cores such as ARM9E and ARM10 — the syllabus’s “ARM5”) deepens the pipeline to five stages — Fetch, Decode, Execute, Memory and Write — and moves to a Harvard organisation with separate instruction and data caches, so instruction fetch and data access no longer contend for one port. ARMv5TE adds DSP enhancements: 16 × 16 multiplies (SMULxy) and multiply-accumulate (SMLAxy) instructions, and saturating arithmetic (QADD, QSUB) that clamps results instead of overflowing — essential in audio and video processing. The v5TEJ variants add Jazelle, hardware execution of Java bytecode. Compared with ARM7, an ARMv5-class core runs faster per MHz, handles loads and stores in dedicated stages, and still exposes the same ARM/Thumb architectural model to software.
Feature
ARM7 (ARMv4)
ARMv5-class (ARM9E/ARM10)
Pipeline
3 stages (F, D, E)
5 stages (F, D, E, M, W)
Memory organisation
von Neumann, single bus, no cache
Harvard, separate I- and D-caches
Multiply
32 × 8 fast multiplier (M extension)
16 × 16 MAC (SMULxy/SMLAxy, DSP)
Arithmetic extras
standard flags, wrap-around
saturating QADD/QSUB for DSP
Instruction states
ARM + Thumb (TDMI)
ARM + Thumb, ± Jazelle (v5TEJ)
The five-stage split matters most for memory instructions: with memory access in its own stage (M) and writeback isolated (W), a load no longer stretches the execute stage, which is what allows the higher clock and better load throughput per MHz than ARM7.