cover

The Speed of Switches

How do computers do math so quickly?
You press a button and instantly your computer tells you that 8,472 times 9,361 equals 79,314,792. It doesn't pause. It

You press a button and instantly your computer tells you that 8,472 times 9,361 equals 79,314,792. It doesn't pause. It doesn't count on its fingers. How does it do math faster than you can blink?

Inside your computer are billions of tiny switches called ++transistors++, each **smaller than a speck of dust**. These

Inside your computer are billions of tiny switches called transistors, each smaller than a speck of dust. These switches can flip on or off millions of times per second. When a switch is on, that's a 1. When it's off, that's a 0. Every number, every word, every picture โ€” your computer stores it all as patterns of 1s and 0s.

We count using ten digits: 0 through 9. Computers count using just two: 0 and 1. It's called ++binary++. In binary, the

We count using ten digits: 0 through 9. Computers count using just two: 0 and 1. It's called binary. In binary, the number 5 is written 101. That looks weird to us, but to a computer, it's perfect โ€” each digit matches one switch. First switch on, middle switch off, last switch on: 101.

So how does a computer add? Let's add 5 plus 3 in binary. Five is 101. Three is 011. The computer doesn't "think" about

So how does a computer add? Let's add 5 plus 3 in binary. Five is 101. Three is 011. The computer doesn't "think" about it the way you do. Instead, it has special circuits called adders built right into the chip. An adder is like a tiny assembly line made of logic gates โ€” switches connected in a pattern that automatically produces the right answer when electricity flows through.

~~Here's the trick:~~ these logic gates follow simple rules. An AND gate **lights up only if both its inputs are on**. A

Here's the trick: these logic gates follow simple rules. An AND gate lights up only if both its inputs are on. An OR gate lights up if either input is on. An XOR gate lights up if exactly one input is on. Chain these gates together in the right pattern, and electricity flowing in as 101 and 011 flows out as 1000 โ€” which is 8 in binary. The answer appears at the speed of light because electricity is doing all the work.

~~But what about multiplication?~~ That's where computers get clever. Multiplication is just repeated addition, and comp

But what about multiplication? That's where computers get clever. Multiplication is just repeated addition, and computers are already lightning-fast at addition. To multiply 12 times 13, a computer breaks it into a series of additions and bit-shifts โ€” sliding the binary digits left or right โ€” then runs all those tiny steps through its circuits. Billions of transistors working together, each doing one simple job, and the whole calculation finishes in nanoseconds.

Modern computers also use ~~another trick:~~ they work on many calculations **at the same time**. While one part of the

Modern computers also use another trick: they work on many calculations at the same time. While one part of the chip is adding, another part is multiplying, and another is getting the next problem ready. It's like having a thousand calculators working together instead of one, each one solving a different piece of the problem, then combining their answers at the end.

~~So when you hit that button~~ and the answer appears instantly, you're watching **billions of microscopic switches** f

So when you hit that button and the answer appears instantly, you're watching billions of microscopic switches flip on and off in perfect patterns, electricity racing through logic gates, circuits doing exactly what they were designed to do. Your computer isn't thinking. It's just very, very good at following the rules โ€” billions of times per second.

How was this book?

A Wonderleaf Book

The Speed of Switches

โ€” How do computers do math so quickly? โ€”

Wonderleaf Editions
โ€” ex libris โ€”
A Wonderleaf Book

The Speed of Switches

How do computers do math so quickly?

Wonderleaf Editions ยท MMXXVI
Scene 1
You press a button and instantly your computer tells you that 8,472 times 9,361 equals 79,314,792. It doesn't pause. It
The Speed of Switches2
Scene 1

You press a button and instantly your computer tells you that 8,472 times 9,361 equals 79,314,792. It doesn't pause. It doesn't count on its fingers. How does it do math faster than you can blink?

3The Speed of Switches
Scene 2
Inside your computer are billions of tiny switches called ++transistors++, each **smaller than a speck of dust**. These
The Speed of Switches4
Scene 2

Inside your computer are billions of tiny switches called transistors, each smaller than a speck of dust. These switches can flip on or off millions of times per second. When a switch is on, that's a 1. When it's off, that's a 0. Every number, every word, every picture โ€” your computer stores it all as patterns of 1s and 0s.

5The Speed of Switches
Scene 3
We count using ten digits: 0 through 9. Computers count using just two: 0 and 1. It's called ++binary++. In binary, the
The Speed of Switches6
Scene 3

We count using ten digits: 0 through 9. Computers count using just two: 0 and 1. It's called binary. In binary, the number 5 is written 101. That looks weird to us, but to a computer, it's perfect โ€” each digit matches one switch. First switch on, middle switch off, last switch on: 101.

7The Speed of Switches
Scene 4
So how does a computer add? Let's add 5 plus 3 in binary. Five is 101. Three is 011. The computer doesn't "think" about
The Speed of Switches8
Scene 4

So how does a computer add? Let's add 5 plus 3 in binary. Five is 101. Three is 011. The computer doesn't "think" about it the way you do. Instead, it has special circuits called adders built right into the chip. An adder is like a tiny assembly line made of logic gates โ€” switches connected in a pattern that automatically produces the right answer when electricity flows through.

9The Speed of Switches
Scene 5
~~Here's the trick:~~ these logic gates follow simple rules. An AND gate **lights up only if both its inputs are on**. A
The Speed of Switches10
Scene 5

Here's the trick: these logic gates follow simple rules. An AND gate lights up only if both its inputs are on. An OR gate lights up if either input is on. An XOR gate lights up if exactly one input is on. Chain these gates together in the right pattern, and electricity flowing in as 101 and 011 flows out as 1000 โ€” which is 8 in binary. The answer appears at the speed of light because electricity is doing all the work.

11The Speed of Switches
Scene 6
~~But what about multiplication?~~ That's where computers get clever. Multiplication is just repeated addition, and comp
The Speed of Switches12
Scene 6

But what about multiplication? That's where computers get clever. Multiplication is just repeated addition, and computers are already lightning-fast at addition. To multiply 12 times 13, a computer breaks it into a series of additions and bit-shifts โ€” sliding the binary digits left or right โ€” then runs all those tiny steps through its circuits. Billions of transistors working together, each doing one simple job, and the whole calculation finishes in nanoseconds.

13The Speed of Switches
Scene 7
Modern computers also use ~~another trick:~~ they work on many calculations **at the same time**. While one part of the
The Speed of Switches14
Scene 7

Modern computers also use another trick: they work on many calculations at the same time. While one part of the chip is adding, another part is multiplying, and another is getting the next problem ready. It's like having a thousand calculators working together instead of one, each one solving a different piece of the problem, then combining their answers at the end.

15The Speed of Switches
Scene 8
~~So when you hit that button~~ and the answer appears instantly, you're watching **billions of microscopic switches** f
The Speed of Switches16
Scene 8

So when you hit that button and the answer appears instantly, you're watching billions of microscopic switches flip on and off in perfect patterns, electricity racing through logic gates, circuits doing exactly what they were designed to do. Your computer isn't thinking. It's just very, very good at following the rules โ€” billions of times per second.

17The Speed of Switches

~ finis ~

Tiny picture books for big little questions.

โ€” a small constellation of questions โ€”
โœฆWonderleaf
Editions