Computers Are Just Rocks Doing Math

Computers Are Just Rocks Doing Math

Machine-readable: Markdown · JSON API · Site index

Поделиться Telegram VK Бот
Транскрипт Скачать .md
Анализ с AI

Оглавление (3 сегментов)

Segment 1 (00:00 - 05:00)

This is a switch. If you have several of them, you can do simple math. If there's a billion, you've got yourself a modern computer. But a computer chip is just a piece of rock. How can a rock do math? Hey Crazies. Like most inventions, microchips are the result of a slow incremental process. In the early days, computers filled entire rooms. But making computers small enough to fit on a desk, let alone in your pocket? Well, that would require quantum physics and some advancements in manufacturing. But no matter how small we make a computer, it always functions because of one simple device: a switch. Wait, no, whoops. It has two states, closed or open, on or off. That doesn't seem very mathy to me. Fair. That's because it's not. At least not yet. A physical switch is part of reality, and reality is not math. Math is something we made up, so we kind of have to impose it on the switch. Let's say for the sake of argument that the "off" state means zero and the "on" state means one. We are deciding to interpret things that way. It could have just as easily been the other way around. But we had to choose, and this way feels more correct, at least electronically. But there are more numbers than just zero and one. Yes, that's true. If we want bigger numbers, we're going to need more switches. Two switches allows for numbers up to three. Three seven. Four switches up to fifteen. Is this binary? Yes, this is binary. You know how normal numbers have a ones place, and a tens place, and a hundreds place, and so on? Those are what we call decimal digits. Each of these switches represents a digit, but in binary instead of decimal. There's a ones place, and a twos place, and a fours place, and so on. That makes this number here equal to fourteen. Remember, a switch only has two states, which means there are only two single-digit numbers: zero and one. Unlike normal, where we have ten single-digit numbers. So we end up needing a lot more digits in binary. But that's not a problem if you have enough switches. Say you want to add two numbers together. I don't know, let's say fourteen and nine. You'll need four switches for the fourteen and nine. Each set of switches forms a kind of signal that we interpret as those numbers. If we send those signals through a mystery circuit, it ultimately activates a set of lights that we interpret just like the switches. The answer is twenty three. What's this mystery box nonsense? Eh. It's not really a mystery. I just haven't had the chance to explain it. That circuit is also made of switches, quite a few actually. It's just that these switches we've been working with so far, they're all manual. And we need these new ones to be automated. Remember those computers that filled entire rooms? They used vacuum tubes for their automated switches. These tubes had a pretty simple design. All you need is a filament or source of electrons, a metal plate for them to jump to, and a mesh or coil in-between to encourage them to jump; when you want them to. Finally, enclose it all in a glass tube and suck out the air. The electrical input controls the mesh, and therefore controls whether or not electrons flow. Bingo bango! Automated switch! How does this let us do math? Great question. Let's start with something more basic. Say we just want to add two single-digit binaries together. That means we need two manual switches. One for each single-digit input. But that doesn't tell us how many automated switches we need, or how to connect them to get the result we want. Don't ever forget, this is not natural. We're imposing the numbers on the switches. First, we need to get organized. Two inputs with two possible states each, means four possible combinations. The first three are pretty straightforward. Zero plus zero equals zero, zero plus one equals one, and one plus zero equals one. But one plus one? That's a little tricky. Remember, there are only two single-digits in binary: zero and one. The single digit two does not exist. Okay, I'll bite. How do we write the number two? We need an extra digit. Even in regular numbers, when we run out of single digits, we go back to zero and add an extra digit. We're going to do exactly the same thing in binary. The ones place goes back to zero, and a one carried into the next place over: the twos place. And now we have a list of all the possible outcomes. We call this a truth table. The name makes more sense when you replace all those ones and zeros with true and false. But the computer doesn't care. It only knows on and off.

Segment 2 (05:00 - 10:00)

How we interpret that is our business. Anyway, we have our truth table. Next, we need to combine vacuum tubes in just the right way to get exactly the result we want. We have a mystery box to solve. Right away, I know we have two outputs: a sum and a carryover. We'll be handling these separately. In other words, our mystery box is really two boxes. For the carryover, you only get one as an output for one of the cases, when both inputs are also one. The easiest way to get that result is with two automated switches, two vacuum tubes, connected in series. If both inputs are on, then both tubes are on, and a signal flows out of the pair. If either or both inputs are off, the one or both of the tubes will block the signal. The sum column is a little trickier. We need a combination of automated switches that gives us a one for these two cases, but a zero which will take a total of seven vacuum tubes. Can't you just put two in parallel instead of in series? Eh. That doesn't quite get us there. That'll give us a one if either tube is on, which also includes when both tubes are on. The truth table isn't quite correct. It's off in a single case, and fixing that one case requires five additional tubes. So just to add two single-digit numbers together, we need two manual switches for the inputs, nine automatic switches for the calculation, and two lights to read the output. I don't even want to imagine what the mystery box looks like for fourteen and nine. And frankly, neither do computer scientists, which is why they abstractify these sets of automated switches into logic gates, so that we don't have to worry about the switches anymore. Remember our carryover check? That's called an AND gate. The sum check is called an XOR gate. We can even go up an extra level of abstraction and call this whole thing a half adder. Those aren't the only gates either. Remember this other small one that didn't quite work for the sum check? That's an OR gate. This one is a NOT gate, also called an inverter. We can even combine gates to form more complex operations. That XOR gate is actually made of four simpler gates. So now all we have to do is work with truth tables and these logic gates to build out all of the mathematical operations. What about subtraction? Yep, we can do that too. Again, three of the four cases are straightforward. You can't immediately subtract one from zero though, so we use a trick. Remember borrowing from longhand subtraction? If not, here's a refresher. Similar to addition, we subtract one digit at a time. Seven minus three is four, so no issue there. But two minus five poses a problem, and we have to borrow from the next digit over in order to fix it. That next digit goes down by one, and the current digit goes up by ten because normal numbers are base ten. A similar thing happens with binary, but it's base two, so it goes up by two instead of ten. If we borrow from a digit that wasn't part of the input, then we end up with two minus one, or just one. But that means we need to perform two different checks, just like we did for addition. The combo looks something like this. It's not too bad, until you remember the XOR gate is already a combo. The point is it works. Multiplication? Oh, that one's easy. This is what the truth table looks like, which is just a single AND gate. Of course, these combos get more complex as we add digits, but we can always find a way. Because these logic gates represent a self-consistent system, just like math is a self-consistent system. From those simple operations, you can rebuild mathematics from the ground up using electronics. But my phone isn't made of vacuum tubes. Yeah, that's true. We needed a new kind of automated switch for that. Enter the transistor. These things don't need a vacuum to control the flow of electrons. They're just solid rock. Specifically, it's some types of silicon smashed together. Ultimately though, the idea is the same. The automated switches might be smaller, but they're still structured into the same logic gates, which are then combined to form mathematical operations. And everything a computer does is math. Letters and emojis are just numbers. The graphics on your screen? It's all just numbers. And when something changes, that's a calculation. It's a bunch of arithmetic represented by tiny switches turning on and off. Every piece of software you've ever used is just another level of abstraction, specifically designed to hide that math from you so you don't have to worry about it. It takes all of that just so you can have a smartphone. And until next time, remember, it's okay to be a little crazy. NovaXXX7 said, "Of course the cat isn't both awake and asleep.

Segment 3 (10:00 - 10:00)

It's a cat. It's asleep. " Yeah, I can't argue with that. Anyway, thanks for watching.
Ctrl+V

Экстракт Знаний в Telegram

Экстракты и дистилляты из лучших YouTube-каналов — сразу после публикации.

Подписаться

Дайджест Экстрактов

Лучшие методички за неделю — каждый понедельник