Discover / Computer science fundamentals / Reading path

Computer science fundamentals: the best books to understand how computing works

@codesherpaBeginner → Expert
9
Books
95
Hours
5
Stages
Not yet rated

This curriculum builds a genuine, bottom-up understanding of how computers work — starting from the physical logic of bits and gates, rising through hardware architecture and memory, then reaching the world of operating systems and software. Each stage assumes the vocabulary of the last, so reading in order is essential; by the end, the learner will be able to trace a running program all the way down to the electrons.

1

Bits, Logic & the Machine

Beginner

Understand how information is represented in binary, how logic gates compute, and how those gates combine into the circuits that make a computer possible.

Study plan for this stage

Pace: 8–10 weeks, ~40–50 pages/day. "Code" (first 4–5 weeks, ~300 pages) covers foundational representation and logic; "The Elements of Computing Systems" (remaining 4–5 weeks, ~300 pages) builds circuits and architecture. Allocate 1–2 days per chapter for reflection and exercises.

Key concepts
  • Binary representation: how decimal numbers, text, and images are encoded as sequences of 0s and 1s
  • Logic gates (AND, OR, NOT, XOR) and Boolean algebra: the fundamental building blocks of computation
  • Combinational logic: how gates combine to perform arithmetic and data manipulation without memory
  • Sequential logic and flip-flops: how circuits store state and enable memory
  • From gates to chips: how simple gates scale into adders, multiplexers, and ALUs
  • The Von Neumann architecture: CPU, memory, and control flow as integrated systems
  • Machine language and assembly: how high-level intent translates into electrical signals
You should be able to answer
  • How would you represent the decimal number 42 in binary, and why is binary the natural choice for digital computers?
  • Draw a truth table for an XOR gate and explain why it differs from an OR gate.
  • How do flip-flops enable a circuit to 'remember' information, and what role do they play in building a computer's memory?
  • Describe how a half-adder combines logic gates to add two single bits, and how full-adders chain together to add multi-bit numbers.
  • What is the Von Neumann architecture, and how do the CPU, memory, and control unit interact to execute a program?
  • How does machine language relate to the physical logic gates in a computer, and what does an instruction actually do at the circuit level?
Practice
  • Encode a short message (e.g., your name) as binary using ASCII, then decode a binary string back to text by hand.
  • Build truth tables for AND, OR, NOT, and XOR gates; then design a truth table for a 2-bit multiplexer and verify it with logic gates.
  • Simulate a half-adder and full-adder using online logic gate simulators (e.g., Logisim or CircuitVerse); add two 4-bit numbers step-by-step.
  • Construct a 1-bit flip-flop (SR latch or D flip-flop) using NAND or NOR gates; test how it holds state when inputs change.
  • Design a 4-bit register using flip-flops and verify that it stores and retrieves a 4-bit value correctly.
  • Trace through a simple machine-language program (e.g., load a value, add two numbers, store the result) and map each instruction to the gates and memory locations it activates.

Next up: Mastering binary representation, logic gates, and circuit design provides the foundation to understand how software instructions are executed at the hardware level—preparing you to explore how programming languages, compilers, and operating systems orchestrate these circuits to solve real-world problems.

Code
Charles Petzold · 1999 · 393 pp

The perfect starting point — Petzold builds a computer from scratch using only flashlights and telegraph relays, making binary, logic gates, and circuits feel completely intuitive before any jargon appears.

The Elements of Computing Systems
Noam Nisan · 2005

Known as 'Nand to Tetris,' this book has the reader construct a full computer — from a single NAND gate up to a working CPU and assembler — cementing everything Petzold introduced with hands-on depth.

2

How the CPU Really Works

Beginner

Develop a clear mental model of processor architecture — instruction sets, registers, the fetch-decode-execute cycle, and how assembly language maps to hardware.

Study plan for this stage

Pace: 4–5 weeks, ~40–50 pages/day. Start with "But How Do It Know" (1–2 weeks, lighter pace to build intuition), then move to "Computer Organization and Architecture" (2–3 weeks, denser material requiring deeper study).

Key concepts
  • The fetch-decode-execute cycle: how the CPU retrieves, interprets, and executes instructions in a loop
  • Registers: small, fast storage locations that hold data and control information during instruction execution
  • Instruction sets: the vocabulary of operations a CPU understands (load, store, arithmetic, logic, branch)
  • Assembly language: low-level symbolic representation that maps directly to machine instructions
  • Memory hierarchy and addressing: how the CPU accesses data from registers, cache, and main memory
  • Control signals and the datapath: how the control unit directs data flow through the processor
  • Clock cycles and timing: how synchronization enables coordinated instruction execution
  • Instruction encoding: how operations, operands, and addressing modes are represented in binary
You should be able to answer
  • Explain the fetch-decode-execute cycle in your own words. What happens in each phase, and why is it fundamental to all CPU operation?
  • What is the purpose of registers, and how do they differ functionally from main memory? Why does the CPU need both?
  • Given a simple assembly instruction (e.g., ADD R1, R2, R3), trace how it flows through the fetch-decode-execute cycle and identify which control signals are asserted.
  • How does an instruction set define what a CPU can do? Name at least five categories of instructions and give an example of each.
  • Describe the relationship between assembly language and machine code. How does an assembler translate symbolic mnemonics into binary instructions?
  • What role does the clock play in CPU operation? How do clock cycles coordinate the movement of data through the datapath?
Practice
  • After 'But How Do It Know': Build or simulate a simple 8-bit CPU (using a tool like Logisim, Digital, or even paper-and-pencil) that implements a minimal instruction set (load, store, add, jump). Trace one instruction through fetch-decode-execute.
  • Write assembly code for a simple task (e.g., add two numbers, find the maximum of three values) using a real or simulated ISA (x86, ARM, MIPS, or the one from Stallings' examples). Hand-assemble at least one instruction into binary.
  • Create a detailed diagram of the datapath (ALU, registers, memory interface, control unit) and annotate it with the control signals needed for three different instruction types (arithmetic, load, branch).
  • Work through Stallings' end-of-chapter problems on instruction formats, addressing modes, and control signals. Focus on problems that require you to decode instructions or predict control signals.
  • Implement a simple instruction decoder in pseudocode or a hardware description language (Verilog/VHDL) that takes a binary instruction and outputs the correct control signals.
  • Compare two different instruction set architectures (e.g., x86 vs. ARM, or RISC vs. CISC) by examining how they encode the same operation. Discuss trade-offs in instruction length, complexity, and decoding.

Next up: This stage establishes the foundational mental model of how a processor executes instructions; the next stage will build on this by exploring how multiple instructions are optimized through pipelining, caching, and parallelism, and how operating systems manage hardware resources.

But How Do It Know
J. Scott Clark · 2009 · 206 pp

A slim, accessible book that walks through the design of a simple CPU step by step, bridging the gap between the logic-gate world and a real instruction-executing processor.

Computer organization and architecture
William Stallings · 1987 · 708 pp

A canonical textbook that formalizes CPU internals — pipelines, caches, memory hierarchies, and I/O — giving the learner the standard vocabulary used by every professional in the field.

3

Memory, Data Structures & Algorithms

Intermediate

Understand how programs use memory, how data is organized and manipulated efficiently, and why algorithmic thinking is central to writing software that scales.

Study plan for this stage

Pace: 6–8 weeks, ~25–30 pages/day. Start with "Computer Science Distilled" (weeks 1–3, ~200 pages), then move to "Grokking Algorithms" (weeks 4–8, ~400 pages). Allocate 2–3 days per major algorithm family in Grokking Algorithms for deeper practice.

Key concepts
  • Memory models: how RAM, pointers, and references work; stack vs. heap allocation
  • Fundamental data structures: arrays, linked lists, stacks, queues, trees, and hash tables—their trade-offs in access, insertion, and deletion
  • Big O notation and complexity analysis: how to reason about time and space efficiency of algorithms
  • Core algorithmic patterns: sorting, searching, recursion, and divide-and-conquer strategies
  • Graph fundamentals: representation, traversal (BFS/DFS), and pathfinding as applied in real systems
  • Dynamic programming: recognizing overlapping subproblems and memoization as an optimization technique
  • Practical algorithm selection: matching the right data structure and algorithm to a problem's constraints
You should be able to answer
  • Explain the difference between stack and heap memory allocation, and give an example of when each is used.
  • What is Big O notation, and why is O(n log n) preferable to O(n²) for sorting large datasets?
  • Compare arrays and linked lists: what are the time complexities for access, insertion, and deletion, and when would you choose one over the other?
  • Describe how a hash table works and why it achieves O(1) average-case lookup despite collisions.
  • Walk through a breadth-first search (BFS) and depth-first search (DFS) on a graph; when is each appropriate?
  • What is dynamic programming, and how does memoization prevent redundant computation in recursive algorithms?
Practice
  • Implement a singly linked list with insert, delete, and search operations; measure and compare performance against an array for the same operations.
  • Implement three sorting algorithms (e.g., bubble sort, merge sort, quicksort) and empirically verify their Big O complexities by timing them on datasets of increasing size (100, 1,000, 10,000 elements).
  • Build a hash table from scratch (or study one in your language's standard library) and trace through collision resolution; then solve 3–5 problems requiring hash tables (e.g., finding duplicates, two-sum).
  • Implement BFS and DFS on a graph; apply each to a real problem (e.g., shortest path in an unweighted graph, topological sort).
  • Solve 5–10 dynamic programming problems (e.g., Fibonacci with memoization, coin change, longest common subsequence) to internalize the pattern of identifying subproblems.
  • Refactor a slow algorithm you've written (or find one online) by choosing a better data structure or algorithmic approach; document the performance improvement with before/after measurements.

Next up: Mastery of memory, data structures, and algorithmic thinking equips you to reason about system design, optimize real-world applications, and approach complex problems systematically—the foundation for the next stage on software architecture and design patterns.

Computer Science Distilled
Wladston Ferreira Filho · 2017 · 180 pp

A concise, visual bridge book that covers data structures, algorithms, and computational thinking without overwhelming detail — ideal for transitioning from hardware to software concepts.

Grokking Algorithms: An illustrated guide for programmers and other curious people
Aditya Y. Bhargava · 2016 · 256 pp

Uses rich illustrations to make core algorithms (search, sort, graphs, dynamic programming) genuinely understandable, building the intuition needed before tackling a heavier algorithms text.

4

Operating Systems & the Software Stack

Intermediate

Understand what an operating system does — processes, threads, memory management, file systems, and system calls — and how it mediates between hardware and the programs running on top.

Study plan for this stage

Pace: 8–10 weeks, ~40–50 pages/day (Chapters 8–12 of CS:APP focus on systems; plan 5–6 days/week with review days)

Key concepts
  • Process abstraction: how the OS creates the illusion of multiple programs running simultaneously through context switching and process control blocks
  • Virtual memory: address translation, page tables, TLBs, and how the OS isolates processes while sharing physical memory
  • Memory management: heap allocation, fragmentation, garbage collection concepts, and malloc/free internals
  • Exceptional control flow: signals, interrupts, and traps as the OS's mechanism to handle asynchronous events and system calls
  • File systems and I/O: how the OS abstracts disk storage, manages file descriptors, and coordinates data movement between memory and peripherals
  • Concurrency and synchronization: race conditions, deadlocks, semaphores, and mutual exclusion primitives
  • System call interface: how user programs request OS services and the boundary between user and kernel mode
You should be able to answer
  • How does the operating system use context switching and process control blocks to run multiple processes on a single CPU?
  • Explain the role of virtual memory and page tables in protecting processes from each other while efficiently sharing physical RAM.
  • What is the difference between a process and a thread, and why might a program use multiple threads instead of multiple processes?
  • How do signals and exception handling allow the OS to respond to asynchronous events like I/O completion or user interrupts?
  • Describe the steps involved in a system call: how does a user program transition from user mode to kernel mode and back?
  • What are the main causes of race conditions in concurrent programs, and how do synchronization primitives like semaphores prevent them?
Practice
  • Write a simple C program that forks multiple child processes and uses wait() to synchronize them; observe process IDs and parent-child relationships.
  • Implement a basic memory allocator (malloc/free) using sbrk() or mmap() to understand heap fragmentation and coalescing.
  • Create a multi-threaded program using pthreads that accesses a shared counter; introduce a race condition, then fix it using mutex locks.
  • Write a signal handler that catches SIGINT (Ctrl+C) and SIGUSR1, demonstrating asynchronous event handling and signal safety.
  • Use strace to trace system calls made by a real program (e.g., ls, cat); identify which syscalls are invoked and in what order.
  • Implement a simple producer-consumer program using semaphores to synchronize access to a bounded buffer.
  • Write a program that maps a file into memory using mmap() and observe how page faults and virtual memory work in practice.

Next up: This stage builds the mental model of how operating systems manage hardware resources and mediate between applications and the machine, preparing you to explore advanced topics like distributed systems, networking, or specialized OS architectures that depend on these foundational abstractions.

Computer Systems: A Programmer's Perspective (3rd Edition)
Randal E. Bryant · 2015 · 1128 pp

The definitive book for understanding the full software-hardware interface — linking, loading, virtual memory, caching, and system-level I/O — tying together every layer studied so far.

5

Computation, Languages & the Limits of Computing

Expert

Grasp the theoretical foundations of computer science — what computation itself means, how programming languages are built, and what problems computers fundamentally cannot solve.

Study plan for this stage

Pace: 12–14 weeks, ~40–50 pages/day (Sipser: 6–7 weeks; SICP: 6–7 weeks). Allocate 3–4 days per week for reading, 2–3 days for exercises and reflection.

Key concepts
  • Formal definitions of computation: finite automata, context-free grammars, Turing machines, and their expressive power
  • The Church-Turing thesis and its implications for what can and cannot be computed
  • Decidability and the halting problem—proof that some problems have no algorithmic solution
  • Computational complexity: P, NP, and NP-completeness; the limits of tractable computation
  • Programming languages as formal systems: syntax, semantics, and the relationship between language design and computational theory
  • Procedures, abstraction, and higher-order functions as tools for managing complexity in code
  • Data structures and their role in implementing abstract computational models
  • Metalinguistic abstraction: writing interpreters and evaluators to understand how languages work
You should be able to answer
  • What is a Turing machine, and why does the Church-Turing thesis matter for understanding the limits of computation?
  • Explain the halting problem: what is it, why is it undecidable, and what does this tell us about computation?
  • What is the difference between decidable and recognizable languages, and why does this distinction matter?
  • Define P, NP, and NP-complete problems. Why is the P vs. NP question important, and what would it mean if P = NP?
  • How do finite automata, context-free grammars, and Turing machines relate in terms of computational power?
  • What is a programming language, formally? How do syntax and semantics relate to computation?
  • How do procedures and higher-order functions enable abstraction in SICP, and why is this important for managing complexity?
  • What is an interpreter, and how does writing one deepen your understanding of how languages work?
Practice
  • Design and trace through finite automata for simple languages (e.g., strings matching a pattern); implement a DFA simulator
  • Build context-free grammars for small languages and parse example strings by hand; implement a simple recursive descent parser
  • Implement a Turing machine simulator that accepts/rejects strings for a specific language; trace its execution step-by-step
  • Work through Sipser's proofs of undecidability (halting problem, Rice's theorem) by hand; attempt to construct a reduction proof for a new problem
  • Analyze algorithms for NP-complete problems (e.g., SAT, traveling salesman); implement brute-force and heuristic solutions; measure their performance
  • Implement core SICP procedures from scratch: recursive and iterative factorial, Fibonacci, tree recursion; measure time and space complexity
  • Write higher-order functions (map, filter, fold) and use them to solve problems; refactor imperative code into functional style
  • Build a simple Scheme interpreter (or extend one from SICP exercises) that evaluates expressions, handles variable binding, and supports user-defined procedures

Next up: This stage equips you with the theoretical vocabulary and mental models to reason rigorously about what computation means, what languages can express, and what problems are fundamentally unsolvable—preparing you to design systems, optimize algorithms, and make principled trade-offs in the next stage of applied computer science.

Introduction to the Theory of Computation
Michael Sipser · 2005 · 400 pp

The gold-standard text on automata, formal languages, computability, and complexity — written with unusual clarity, it reveals the mathematical bedrock beneath every program ever written.

Structure and Interpretation of Computer Programs (SICP)
Harold Abelson · 1985 · 542 pp

A legendary MIT text that uses Scheme to expose the deep ideas behind programming languages — abstraction, recursion, interpreters, and compilers — completing the journey from bits to thought.

Discussion

Keep reading

Paths that share books, cover the same subject, or open a related topic.

Shares 2 books

How to learn Programming

Beginner11books100 hrs4 stages
More on Deep learning

Deep learning: a reading path from neural networks to modern architectures

Intermediate8books63 hrs5 stages
More on Ethical hacking & penetration testing

Ethical hacking and penetration testing: an ordered reading path into offensive security

Beginner9books78 hrs4 stages
More on Computer networking

Computer networking: a reading path from packets to protocols

Beginner8books114 hrs4 stages