The Alphabet: Binary & Gates
Before we can write poetry, we need letters. In digital logic, our "letters" are 0 and 1 (Voltage Low and High).
-
Abstraction
We ignore the complex physics of transistors and pretend they are simple switches. Is it on (1) or off (0)?
-
Boolean Logic
We use math to describe decisions. "I will go outside IF it is sunny AND I have time." This is an AND gate.
"The Traffic Cop"
The Words: Combinational Logic
We combine letters to make words. Combinational logic circuits have no memory. Their output depends only on the current input right now.
The Multiplexer (MUX)
The most important circuit in CPU design. It's a digital switch. "If Select is 0, let path A through. If Select is 1, let path B through." This allows data to flow to different places.
The Adder
By clever arrangement of XOR and AND gates, we teach the circuit how to add binary numbers (1+1=10). This is the heart of the ALU.
The Sentences: Sequential Logic
Words are useful, but sentences tell a story over time. Sequential logic introduces Time and Memory.
The Flip-Flop
A gate that can "remember" a 1 or a 0 even after the input changes. It only updates when the Clock ticks.
- Registers: A row of flip-flops to store a whole number (like 4 bits).
- Counters: Circuits that count up (0, 1, 2...) on every clock tick. Essential for the Program Counter.
The Heartbeat (Clock Signal)
The Brain: The Microprocessor
This is the summit. We combine everything—Logic, Memory, MUXes, and Time—to create a machine that can follow instructions.
Fetch
The "Address Generator" (Counter) points to a specific shelf in memory. The system grabs the number sitting there.
Decode
The "Controller" looks at that number. It uses its internal ROM (Microcode) to translate "Number 1" into "Turn on the Adder circuits."
Execute
The "Datapath" (ALU + Registers) obeys. Data flows through the MUXes, gets added/subtracted, and settles into the Accumulator.
Why Does This Matter?
Every smartphone, laptop, and server on Earth works exactly like this 4-bit machine, just with billions more switches and faster clocks. You have just built the fundamental atom of the modern world.