Stage 1 · Lesson 3 of 7
From logic gates to a CPU
A , the processor that runs your code, is built from very simple parts called . An AND gate outputs 1 only if both inputs are 1. An OR gate outputs 1 if either input is 1.
A NOT gate flips its input. Combine gates and you get adders (circuits that add bits), (circuits that pick one of several inputs) and memory cells. Combine those and you get an arithmetic logic unit, or ALU, which does the maths.
You also get registers (tiny, fast storage slots) and a that directs them. You do not need to design chips. But building the chain once in a simulator removes the magic.
You see that a computer is layers of simple parts, each hiding the one below. This layered thinking returns in every later stage, from to network protocols.
Common trapskipping this as "hardware stuff" and then never really understanding what an instruction, a register or a clock cycle is.
A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CourseFreeCS50: Introduction to Computer Science
Harvard University · Beginner
The first weeks in C teach binary, memory, pointers and the stack and heap with excellent problem sets
- VideoFreeCrash Course Computer Science
CrashCourse · Beginner
Short videos from transistors to CPUs and memory; the quickest way to see the whole picture