CS core subjects

Stage 1 · Lesson 3 of 7

From logic gates to a CPU

How a computer runs a program

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

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

Mark this stage as not done?