Skip to content
Tutorials Center
My learning

Topics

Computer Organization and Architecture Tutorial

Learn Computer Organization and Architecture step by step: 67 lessons in 12 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Big Picture

  1. 1 What Is Computer Organization and Architecture? Learn the difference between computer architecture and organization, the layers from transistors to apps, and why programmers benefit from knowing the hardware.
  2. 2 The Von Neumann Model and the Fetch-Decode-Execute Cycle Understand the stored-program idea, the CPU, memory and I/O, the Harvard variant, and the instruction cycle, with a tiny Python machine you can step through.
  3. 3 Components of a Computer Tour the main parts of a computer: CPU, RAM, storage, motherboard, chipset, buses and clocks, and see how they talk with a Python model of a bus transfer.
  4. 4 Measuring Performance Learn the CPU execution time equation, clock rate, CPI, MIPS, benchmarks, speedup and Amdahl's law, with runnable calculators and plots you can change.
  5. 5 Issues in Computer Design Understand the trade-offs every computer designer faces: performance, cost and yield, power, compatibility, reliability and security, with Python models of die cost and design choices.

Data Representation

  1. 6 Number Systems and Conversions Learn positional number systems, how to convert between binary, octal, decimal and hexadecimal by hand and in Python, and why hardware uses these bases.
  2. 7 Signed Integers and Two's Complement Learn sign-magnitude, ones' complement and two's complement, value ranges, overflow and sign extension, with Python code that simulates fixed-width integers.
  3. 8 Binary Arithmetic and Overflow Learn how hardware adds, subtracts and multiplies binary numbers, what the carry and overflow flags mean, and how shifts replace multiplication.
  4. 9 Binary Multiplication and Division Algorithms Learn how hardware multiplies and divides binary numbers: shift-and-add, Booth's algorithm for signed values, restoring and non-restoring division, with Python traces.
  5. 10 Fixed-Point Numbers and the Binary Point Learn how fixed-point numbers store fractions in plain integers: the binary point, scaling, unsigned and signed ranges, and arithmetic, with Python code you can run.
  6. 11 Floating-Point Numbers and IEEE 754 See how computers store real numbers as sign, exponent and mantissa, why 0.1 + 0.2 is not 0.3, and how to decode float bits yourself with Python's struct.
  7. 12 Characters, ASCII and Unicode Learn how computers turn text into bytes: ASCII, Unicode code points, UTF-8 and UTF-16, endianness, byte order marks and the bugs encodings cause.
  8. 13 Parity, Checksums and Error-Correcting Codes Learn how parity bits, checksums, CRC and Hamming codes detect and correct bit errors in memory and networks, with working Python implementations.

Digital Logic

  1. 14 Logic Gates and Boolean Algebra Learn AND, OR, NOT, XOR, NAND and NOR gates, truth tables, Boolean laws, De Morgan's theorems and universal gates, with a Python truth-table generator.
  2. 15 Combinational Circuits Build multiplexers, decoders, encoders, half and full adders and a ripple-carry adder from simple gate functions, and test them in Python.
  3. 16 Latches, Flip-Flops and Registers See how feedback gives circuits memory: build an SR latch, a D flip-flop, registers, counters and shift registers, and simulate each one step by step in Python.
  4. 17 Building an ALU Design an arithmetic logic unit step by step: operations, control signals, the Z N C V flags, carry-lookahead logic, and a working 8-bit ALU model in Python.

Instruction Set Architecture

  1. 18 Instruction Set Architecture Learn what an instruction set architecture defines, from registers and memory model to instruction types, and compare RISC and CISC, x86, ARM and RISC-V.
  2. 19 Instruction Formats and Encoding See how an instruction becomes bits: opcode and operand fields, R, I and J formats, fixed versus variable length, with a working encoder and decoder in Python.
  3. 20 Zero-, One-, Two- and Three-Address Instructions and Stacks Compare zero-, one-, two- and three-address instruction formats, evaluate expressions on each machine type, and see how a hardware stack works, with Python code.
  4. 21 Addressing Modes Learn how instructions specify operands: immediate, direct, indirect, register, indexed, base plus offset and PC-relative modes, with a Python simulation.
  5. 22 Machine Instruction Families (8086 Style) Tour the families of machine instructions in an 8086-style processor: data transfer, arithmetic, logic, shift, string, program control and processor control, with a Python emulator.
  6. 23 Tracing Register and Flag Contents After Instructions Learn to work out register values and the C, Z, S, V and P flags after ADD, SUB, CMP, INC, AND and shifts, with worked traces and a Python flag calculator.
  7. 24 Assembly Language Basics Learn assembly language: mnemonics, labels, directives and pseudo-instructions, then write programs for a small teaching ISA and build a two-pass assembler in Python.
  8. 25 Assembly: Branches, Loops and Functions See how compare-and-jump builds if statements and loops, how call and return use the stack, and what a calling convention is, all run in a small simulator.

CPU Design

  1. 26 CPU Registers and the Instruction Cycle in Detail Meet the registers inside a CPU (PC, IR, MAR, MDR, accumulator, flags) and trace fetch, decode, execute and interrupt cycles step by step with a Python model.
  2. 27 Register Transfer and Micro-operations Learn register transfer notation (R2 <- R1), bus and memory transfers, and arithmetic, logic and shift micro-operations, with a Python register-transfer simulator.
  3. 28 The CPU Datapath Follow data through a processor: program counter, instruction memory, register file, ALU, data memory and multiplexers, with a Python datapath model.
  4. 29 The Control Unit: Hardwired and Microprogrammed Learn how a control unit turns opcodes into control signals, as logic gates or as microcode in a ROM, with Python models of both and a cycle count comparison.
  5. 30 Building a Single-Cycle CPU Combine the datapath and the control unit into a complete single-cycle CPU, run real programs on a Python simulator, and see why one cycle per instruction is slow.
  6. 31 Instruction Pipelining Learn how a five-stage pipeline overlaps instructions, why it raises throughput but not latency, and how to compute speedup, with Python timing charts.
  7. 32 Pipeline Hazards: Structural, Data and Control Learn the three kinds of pipeline hazards, how stalls, forwarding and scheduling fix them, and watch them appear in a Python pipeline simulator.
  8. 33 Branch Prediction See how CPUs guess the outcome of branches, compare static, 1-bit, 2-bit and history-based predictors, and measure their accuracy on loop traces in Python.
  9. 34 Superscalar, Out-of-Order and Speculative Execution Learn how modern CPUs issue several instructions per cycle, rename registers, reorder work, speculate past branches, and why Spectre exists. With demos.
  10. 35 Dynamic Scheduling: Scoreboarding and Tomasulo's Algorithm Learn how hardware reorders instructions at run time: scoreboarding, Tomasulo's reservation stations, register renaming and the common data bus, with a Python simulator.
  11. 36 VLIW, EPIC and Classes of ILP Architectures Compare superscalar, superpipelined and VLIW processors, see how a compiler packs instructions into bundles, and try a Python bundle scheduler with latencies.

Memory Hierarchy

  1. 37 The Memory Hierarchy and Locality Understand why computers use layers of memory from registers to disk, how speed, size and cost trade off, and how to measure temporal and spatial locality.
  2. 38 RAM, ROM, SRAM, DRAM and Flash Learn how SRAM, DRAM, ROM and flash store bits, why DRAM needs refresh, how SSDs differ from hard disks, with worked capacity and bandwidth calculations.
  3. 39 Memory Interleaving and Main-Memory Design Build main memory from chips: size and expand RAM, decode addresses, and use low-order interleaving across banks to raise bandwidth, with Python simulations.
  4. 40 Byte- and Word-Addressable Memory Learn what an address names in byte- and word-addressable memory, how to compute address bits and capacity, and how decoders select chips, with Python calculators.
  5. 41 Cache Memory Basics Learn what a CPU cache is, how hits, misses and AMAT are calculated, and how an address splits into tag, index and offset, with a Python address tool.
  6. 42 Direct, Associative and Set-Associative Mapping Compare direct-mapped, fully associative and set-associative cache placement, see conflict misses appear and disappear, and run a cache simulator class.
  7. 43 Replacement and Write Policies Learn how a cache chooses a victim (LRU, FIFO, random) and how it handles stores (write-through, write-back, write-allocate), with Python simulations.
  8. 44 Cache Performance and the Three Cs Classify cache misses as compulsory, capacity or conflict, compute AMAT for multilevel caches, and see how loop order changes the miss rate in Python.
  9. 45 Cache Coherence and Memory Consistency Understand how multicore caches stay in sync: the MESI protocol, false sharing and memory consistency models, with a MESI simulator and a litmus test.

Virtual Memory and Storage

  1. 46 Virtual Memory and Paging Learn how virtual memory gives each process a private address space: pages, frames, page tables, page faults and multi-level translation, simulated in Python.
  2. 47 TLBs and Page Replacement Algorithms See how the TLB hides page-table cost and how FIFO, LRU, Clock and Optimal page replacement compare, including Belady's anomaly, with Python simulations.
  3. 48 Disks, SSDs and RAID Compute hard-disk access time from seek and rotation, see why SSDs need garbage collection and wear management, and rebuild a failed disk with RAID 5 parity.

Input/Output

  1. 49 I/O Organization: Polling, Interrupts and DMA See how the CPU talks to devices: controllers, memory-mapped I/O, polling, interrupts and DMA, with Python simulations that compare their cost.
  2. 50 I/O Interfaces, Handshaking and Priority Interrupts Learn how I/O interfaces connect devices: isolated versus memory-mapped ports, strobe and handshake transfers, and daisy-chain priority interrupts, with Python models.
  3. 51 Buses and Interconnects Learn how buses carry address, data and control signals, how arbiters share them, and how to calculate bandwidth for DDR memory, PCIe, USB and SATA.
  4. 52 Interfacing: 8255 PPI, 8254 Timer and a Microcomputer System See how a microprocessor, memory and I/O chips form a microcomputer: address decoding, the 8255 PPI control word and modes, and the 8254 timer, with Python models.

Parallel Architectures

  1. 53 Parallel Processing and Flynn's Taxonomy Learn SISD, SIMD, MISD and MIMD, multicore designs, shared versus distributed memory, and the limits of speedup with Amdahl and Gustafson, with plots.
  2. 54 SIMD, Vector Processing and GPUs Understand vector instructions, why NumPy feels like SIMD, how a GPU organizes threads into warps, and the difference between latency and throughput.

Real-World Machines and Performance

  1. 55 Power, Energy and Thermal Limits Learn why chips stopped getting faster by clock speed: dynamic power, voltage and frequency scaling, dark silicon and big.LITTLE, with Python calculations.
  2. 56 Inside Modern Processors: x86, ARM and RISC-V Tour real microarchitecture: how x86, ARM and RISC-V cores differ, what a system-on-chip contains, why accelerators multiply, and where chip design is heading.
  3. 57 Writing Cache- and CPU-Friendly Code Turn hardware knowledge into faster programs: data layout, loop tiling, branch-free code, alignment and NumPy versus loops, tested with runnable models.

Projects

  1. 58 Project: A Complete Mini CPU Simulator Design a tiny 16-bit instruction set, write an assembler, and build a fetch-decode-execute simulator that runs factorial and Fibonacci programs.
  2. 59 Project: A Configurable Cache Simulator Build a cache simulator with adjustable size, block size and associativity, feed it address traces, classify every miss and plot hit rates in Python.
  3. 60 Project: A Pipeline Hazard Visualizer Parse small assembly programs, find data hazards, and draw five-stage pipeline charts with and without forwarding, including load-use and branch stalls.
  4. 61 Project: A Virtual Memory Manager Build a virtual memory simulator with a two-level page table, a TLB, demand paging and FIFO, LRU and Clock replacement, then measure address traces.
  5. 62 Project: A Gate-Level Logic Simulator Write a netlist simulator that uses only NAND gates, then build NOT, AND, OR, XOR, a ripple-carry adder, latches, a register and a counter from it.

Practice and Interview

  1. 63 Practice: Data Representation and Digital Logic Solve exercises on base conversion, two's complement, IEEE 754 floats, logic gates and adders, then check every answer with short Python programs.
  2. 64 Pipeline Speedup, CPI and Exam-Style Calculations Master pipeline arithmetic: speedup with unequal stages, throughput, CPI with load-use, branch and structural stalls, and pipeline depth trade-offs, with worked problems and Python checks.
  3. 65 Practice: CPU, Pipeline, Cache and Virtual Memory Work through exercises on CPI, Amdahl's law, pipeline stalls, cache mapping, AMAT, page tables and page replacement, with solutions you can verify in Python.
  4. 66 Computer Organization Interview Questions Frequently asked computer organization and architecture interview questions on CPU, pipelining, cache, memory and number systems, with answers and runnable checks.
  5. 67 Computer Organization Cheat Sheet A quick reference for computer organization: number ranges, IEEE 754 formats, performance equations, pipeline, cache, paging and I/O formulas, with runnable calculators.