Computer Architecture

Computer architecture is where the gates and registers from digital logic finally get assembled into a working CPU, and it also returns to the fetch-decode-execute cycle this series introduced in its very first topic, now explained in real depth. An instruction is a single operation the CPU knows how to perform — add two numbers, load a value from memory, compare two registers — encoded as raw binary exactly as covered in data representation; assembly language is a thin, human-readable layer directly on top of that binary, one line per instruction, with mnemonics like ADD or LOAD standing in for the actual bit patterns, which is as close to the hardware as a programmer can get without writing 1s and 0s by hand. The CPU executes instructions through the repeating fetch, decode, execute cycle already named in this series' first topic: fetch pulls the next instruction from memory using a register, decode figures out which operation it specifies and which registers or memory addresses it touches, and execute actually performs it — addition and comparison run through an arithmetic logic unit built directly from the half-adders and full-adders of digital logic, while a control unit, also just more logic gates, sequences the whole cycle and decides which hardware components get used on any given step. A register, already introduced as a handful of flip-flops, is the CPU's fastest possible storage — reading or writing one register costs a single clock cycle, with nothing faster available on the chip. A cache sits directly between the registers and main memory as a small, fast layer that keeps a copy of recently used data, because RAM access is dramatically slower than a register and most programs reuse the same small set of data and instructions repeatedly, a principle called locality, so a cache hit is far cheaper than a cache miss, where the CPU has to wait for RAM instead. The memory hierarchy arranges every storage tier available to a computer — registers, then cache, then RAM, then disk, the same two tiers introduced back in the very first topic of this series — from fastest-and-smallest at the top to slowest-and-largest at the bottom, and every tier below the top exists purely as a cost tradeoff: faster memory is dramatically more expensive per byte, so a real system layers cheap, large, slow storage underneath small amounts of expensive, fast storage and relies on locality to keep the common case fast. This entire chapter — instructions, the fetch-decode-execute cycle, and the memory hierarchy that feeds it — is the hardware picture the next topic, operating systems, has to manage and share safely across every program running on the machine at once.

Fetch
program counter points to the next instruction in memory
Decode
control unit figures out the operation and its operands
Execute
ALU performs the operation using the gates from digital logic
Store result, advance program counter
then the cycle repeats from fetch again
The Memory Hierarchy: Speed vs. Size vs. Cost Faster memory is always smaller and always more expensive per byte Registers 1 clock cycle, fastest on the chip Cache a few cycles, holds recently used data RAM (main memory) hundreds of cycles, a cache miss waits here Disk / SSD thousands of cycles, slowest, biggest, cheapest locality, reusing the same small set of data, is why caching works at all
Inside One CPU Cycle Built from nothing but the gates and registers from digital logic Program counter a register holding the next address Control unit decodes the instruction, sequences the hardware ALU adders and gates do the actual computation Reg- isters an ADD mnemonic in assembly is one line, but underneath it is binary: an opcode plus register numbers, matching the exact bit patterns the control unit decodes, every one of these boxes is only logic gates

Take computer architecture further

Ask the copilot about this term, or have our engineers assess it against your process.