CS core subjects

Stage 1 of 8 · 7 lessons · ~4 weeks

How a computer runs a program

Binary, logic, the CPU, memory and the path from source code to machine instructions. Every other subject in this roadmap sits on top of this picture.

Start: Binary, hexadecimal and integers

Lessons· one lesson for each topic, in this order

  1. 1Binary, hexadecimal and integers
  2. 2Text encodings and floating point
  3. 3From logic gates to a CPU
  4. 4The fetch, decode, execute cycle
  5. 5The memory hierarchy and caches
  6. 6Program memory: the stack and the heap
  7. 7Compilers, interpreters and bytecode

Do this

  • Convert ten numbers between decimal, binary and hex by hand, including negative numbers in two's complement.
  • Print 0.1 + 0.2 in two languages and explain the output in writing.
  • Build the first two or three Nand2Tetris projects (gates and the adder) in the online simulator.
  • Compile a small C function with optimisations off and read its assembly output on Compiler Explorer.
  • Write a recursive function that overflows the stack on purpose and note the depth it reached.
  • Draw the memory layout of a running program: code, globals, stack and heap.
  • Draw your source-to-process diagram and explain it aloud to a classmate in five minutes.

Start with· follow one of these

Practise

Keep handy

  • A topic map of the whole CS curriculum to check your coverage against, stage by stage

  • Short explanations from researchers when one idea, such as floating point, will not click

Also worth your time

Before moving on: A one-page diagram, in your own words, that follows a small C or Python program from source file to running process: compilation or interpretation, memory layout, the fetch, decode, execute loop and where the data sits in the memory hierarchy.

Tauseef's advice
Most students skip this because it feels like first-year material, then struggle in operating systems because they never understood memory. Spend two focused weeks here. Build a few chips in Nand2Tetris if you can; nothing else makes the layers click as fast.

Mark this stage as not done?