A deep-dive for curious 15-year-olds

How a Calculator Thinks
vs. How an LLM & GPU Think

Two machines. Both run on nothing but electricity and tiny switches. One gives you an exact answer, the other gives you its best guess. Let's open both up and see the gears turn โ€” with flowcharts, diagrams and worked examples.

๐Ÿงฎ Part 1 โ€” The Calculator

The obedient switch-flipper

A calculator has zero understanding of math. It doesn't "know" that 2+2 is 4. It's just a maze of electric switches wired so cleverly that the right answer falls out the other end.

๐Ÿš‚ Analogy โ€” the railway switchyard. Imagine numbers are trains and the wires are train tracks. A calculator is a giant switchyard where every lever is pre-set. You send trains in one end, they get automatically routed through thousands of switches, and they always arrive at the correct platform. Nobody is "thinking" โ€” the tracks just are the answer.

The big picture: press a button โ†’ see a number

Keypad you press "5" Encoder 5 โ†’ 0101 (binary) Registers holds the numbers ALU Arithmetic Logic Unit โ€” the "brain" adds with gates Display shows "8" Everything is just 0s and 1s โ€” OFF and ON switches โ€” the whole way through.

Figure 1 โ€” A calculator is a one-way assembly line. Input โ†’ convert to binary โ†’ compute โ†’ convert back โ†’ show.

Step 1 โ€” Everything becomes 0s and 1s

Computers can't store the number "5" directly. They only have switches, and a switch is either ON = 1 or OFF = 0. So we count in binary (base-2) instead of the decimal (base-10) we use.

8s4s2s1s
0101 = 4 + 1 = 5

Just like decimal columns are 1000/100/10/1, binary columns are 8/4/2/1. Turn on the 4 and the 1 โ†’ that's 5.

Step 2 โ€” Logic gates make decisions

Switches are wired into tiny decision-makers called logic gates. Give them ON/OFF inputs, they give one ON/OFF output. These are the only "thinking" a calculator does.

AND both ON โ†’ ON OR either ON โ†’ ON XOR different โ†’ ON

Think of AND as "I'll go only if both my friends come." OR is "I'll go if anyone comes." XOR is "I'll go only if exactly one comes."

Step 3 โ€” Watch it actually add: 5 + 3 = 8

Here's the magic. The calculator adds like you do โ€” column by column, right to left, carrying the 1 โ€” except each column is just two gates: an XOR gives the digit, an AND gives the carry. This little circuit is called a full adder.

carry 111ยท
5 = 0101
3 = 0011
8 = 1000 = 8 โœ“
bit A =1 bit B =1 carry =1 FULL ADDER (XOR + AND) SUM = 1 carry-out = 1 1+1+1 โ†’ write 1, carry 1

Figure 2 โ€” Chain 4 of these full-adders together and you can add any two 4-bit numbers. Chain 64 and you get a real computer's adder.

๐Ÿ’ก Key idea: the calculator never "figured out" that 5+3=8. The gates were wired so that ON/OFF signals flow through and the pattern 1000 lights up. The answer was built into the wiring.

๐Ÿ”ง Inside the machine

Watch a real calculator add 1 + 3

Press a key and a signal races through the calculator's blocks โ€” Encoder โ†’ Controller โ†’ RAM / ROM โ†’ ALU โ†’ Display Decoder โ†’ screen. Here's 1 + 3 = 4, step by step.

1 + 3 = Display Encoder Random Access Memory 0000 Controller Read-Only Memory Arithmetic Logic Unit Display Decoder

Press โ–ถ Play to watch 1 + 3 travel through the calculator.

Calculator in one breath ๐Ÿงฎ

Numbers โ†’ binary โ†’ logic gates wired to compute โ†’ binary โ†’ screen. It's fast, it's exact, it's the same every single time, and it holds no memory of the world. A brilliant idiot that never makes an arithmetic mistake.

๐Ÿค– Part 2 โ€” The LLM & the GPU

The world's most well-read guesser

An LLM (Large Language Model, like the one writing this) doesn't calculate answers โ€” it predicts the next word. A GPU is the muscle: the chip that does the billions of tiny multiplications fast enough to make that prediction feel instant.

๐Ÿ“š Analogy โ€” the super-autocomplete. You know how your phone suggests the next word when you text? An LLM is that, but it read most of the internet first. Ask it anything and it's really answering one question over and over: "Given everything so far, what word most likely comes next?" It then adds that word and asks again. One word at a time, incredibly fast.

The big picture: prompt โ†’ predicted words

Prompt "The cat sat on the ___" Tokenizer words โ†’ numbers "cat" โ†’ 4842 Embeddings each token โ†’ list of numbers Transformer layers ร—96 attention + matrix math (billions of ร— and +) Predict next word: "mat" ๐Ÿฑ ๐Ÿ” add the new word to the sentence and run the WHOLE thing again for the next word

Figure 3 โ€” Unlike the calculator's one-way line, an LLM loops: it generates one word, adds it back, and predicts again.

Step 1 โ€” Words become numbers (tokens)

Models can't read letters โ€” only numbers. So text is chopped into tokens (whole words or word-pieces), and each token is swapped for an ID number.

Thecatsatonthe
791 4842 7731 402 791

Then each ID becomes an embedding โ€” a long list of numbers (say 12,000 of them) that captures the word's "meaning." Words with similar meaning get similar lists, so "cat" sits near "kitten."

Step 2 โ€” Attention: reading the room

Before guessing the next word, the model uses attention to weigh which earlier words matter most. In "The cat sat on the ___", it pays high attention to cat and sat, so it expects a place a cat sits.

The cat sat on the ___? Thicker line = more attention. "cat" & "sat" get the most.

Attention is what lets the model handle long sentences and stay on-topic โ€” it's the big idea behind the "Transformer," the T in GPT.

Step 3 โ€” It doesn't pick a word, it rolls loaded dice ๐ŸŽฒ

After all that math, the model outputs a probability for every possible next word. Then it picks one โ€” usually a likely one, but with a dash of randomness so it isn't robotic. That randomness is why the same prompt can give different answers.

"The cat sat on the ___" โ†’ next word probabilities:
mat
most likely
61%
floor
18%
chair
9%
roof
5%
table
4%
โ€ฆbanana
0.1%

๐Ÿ’ก Key idea: the model never looked up a fact. It learned, from reading billions of sentences, that "mat" tends to follow "the cat sat on the." It's pattern-matching at an unimaginable scale, not knowing.

Step 4 โ€” Why a GPU? Because it's ALL multiplication

Every prediction is really one giant pile of multiply-then-add operations (matrix multiplication) across billions of learned numbers called weights or parameters. A regular CPU does these one after another. A GPU does thousands at the exact same time.

๐Ÿ‘ฉโ€๐Ÿซ Analogy โ€” teacher vs. stadium. A CPU is one genius teacher solving hard problems one at a time. A GPU is a stadium of 10,000 students who each only do simple arithmetic โ€” but all at once. For "add these million pairs of numbers," the stadium annihilates the lone genius. LLM math is exactly that kind of work: simple, but a mountain of it.
CPU โ€” a few big cores smart, flexible, does things in order GPU โ€” thousands of tiny cores simple, but massively parallel

Figure 4 โ€” Same silicon idea (transistors + gates), opposite philosophy: few powerful workers vs. an army of simple ones.

These GPUs are also exactly the chips that render video-game graphics โ€” because drawing millions of pixels is also "do simple math a zillion times at once." That's the happy accident that made the AI boom possible.

LLM & GPU in one breath ๐Ÿค–

Words โ†’ tokens โ†’ embeddings โ†’ attention + billions of multiply-adds (on a GPU) โ†’ probabilities โ†’ pick a word โ†’ repeat. It's a fluent, creative pattern-matcher that learned from oceans of text โ€” and unlike the calculator, it can be wrong, surprising, or different every time.

โš–๏ธ Part 3 โ€” Same DNA, Different Souls

Similarities & differences

๐Ÿงฎ Calculator ๐Ÿค– LLM + GPU Exact answer one right result thousands of gates no memory of world Shared ๐Ÿค just electricity & transistors inputโ†’process โ†’output it's all math Best guess probabilities billions of params learned from data

Figure 5 โ€” Both are "just math on switches." What changes is the scale and the goal.

โœ… What they share

  • Both run on nothing but electricity through transistors โ€” microscopic on/off switches.
  • Both follow the same shape: input โ†’ process โ†’ output.
  • Under the hood, everything is numbers and math. No magic, ever.
  • Both are built from the same basic logic gates โ€” just wired very differently.
  • Neither one "understands" like a human does. They manipulate symbols.

๐Ÿ”€ Where they split

  • Goal: exact arithmetic vs. likely language/patterns.
  • Answer: one correct result vs. a probability-weighted guess.
  • Consistency: always identical vs. can vary and surprise.
  • Knowledge: none (pure rules) vs. learned from massive data.
  • Scale: thousands of gates vs. billions of parameters.

Side-by-side cheat sheet

Question๐Ÿงฎ Calculator๐Ÿค– LLM + GPU
What's its job?Compute exact mathPredict likely text
How does it "decide"?Fixed wiring of logic gatesBillions of learned weights
Same input, same output?Always identicalCan differ (randomness)
Can it be "wrong"?Basically neverYes โ€” it can hallucinate
Where's the knowledge?Nowhere โ€” just rulesBaked in from training data
Core math operationBinary add / logic (XOR, AND)Matrix multiply (ร— then +)
HardwareTiny chip, thousands of gatesGPUs, thousands of cores
How much data flows?A handful of bitsTrillions of operations per word
Best real-world metaphorA vending machineA well-read storyteller
๐ŸŽฏ The Big Takeaway

From one switch to a stadium of switches

Zoom all the way in and a calculator and an AI are the same thing: patterns of tiny on/off switches. The jaw-dropping difference is only scale and purpose.

๐Ÿงฎ The calculator

A few thousand switches, hand-wired by an engineer to give one exact, certain answer. It's a perfect rule-follower with no idea what numbers even are.

๐Ÿค– The LLM

Billions of switches whose settings were learned, not wired, running on GPUs, producing a fluent best guess. Same building blocks โ€” but so many, arranged so cleverly, that language falls out.

๐Ÿง  One sentence to remember: A calculator is a machine that knows the rules perfectly; an LLM is a machine that has seen so many examples it can imitate the pattern โ€” and both are, at the bottom, just electricity flipping switches very, very fast.