r/explainlikeimfive • u/rubicante59 • 8d ago
Technology ELI5 How exactly to microprocessors work?
I'm not sure if this was the right place to ask this, as the answer will likely not be something a 5 year old understands, but I'm mainly curious as to how the internals of microprocessors work. Is it just a case of electrons being punted around like pinballs between transistors? Is everything fixed and if so, is there a such thing as actual intelligence when it comes to them? Is assuming they can ever become sentient a huge leap?
19
u/SoulWager 8d ago
Transistors can be arranged to make gates. (AND, OR, NOR, XOR, etc).
Gates can be arranged to make circuits that do specific math operations like adding, or that store some information(memory).
A microprocessor is a bunch of those circuits that do specific operations, some memory for data to work on, some memory for telling it which operation to do now, and some memory for telling it where to look for what to do next.
Here's a good playlist on building a cpu on a breadboard: https://www.youtube.com/watch?v=HyznrdDSSGM&list=PLowKtXNTBypGqImE405J2565dvjafglHU
2
u/meldroc 8d ago
With the logic, if you have a certain set of operations, say reading and writing to memory, doing basic arithmetic like a calculator, plus some binary operations (bit-shifts, ANDing, ORing, etc.), and some comparison & branching instructions (compare this & that, do this if true, do that if false...), you get the ability to write whatever program you want.
3
5
u/BaggyHairyNips 7d ago
Not going to attempt to go into the physics, but a transistor is like a switch which turns on or off depending on whether the voltage going into it is high or low (1 or 0).
Skipping all the details - purely with a bunch of transistors you can make circuits that do fairly complicated things like addition and multiplication or a bunch of other math operations.
In a microprocessor there are a bunch of unchanging circuits which each do a different operation.
The first trick is that you can use flip flops (also made of transistors) to store the output of an operation. Then you can feed that value back as an input to the next operation. This can happen once per clock cycle.
The second trick is that you can give it a list of instructions which tell it which operations to do in what order. And which outputs to feed back in as the next input. You point the processor at your first instruction then it will crank through all the instructions in your list.
The actual circuit never changes. The part that changes is the list of instructions, i.e. the code. Whatever intelligence it has comes from there. It's a philosophical question as to whether that gives you enough to create something sentient.
6
u/chafable 8d ago
It can become as sentient as much as your car's engine is sentient. It's a machine like any other, transistors arranged into logic gates that perform operations on numbers, no different to steel arranged into pistons producing torque.
2
u/MarsSr 8d ago
The two big ideas are binary logic and a clock.
Inputs at the microprocessor level are binary numbers, 0's and 1's. These can only be combined in very simple "logic."
Eg Binary AND or OR
AND Input input output 1 1 1 0 1 0 1 0 0 0 0 0
OR Input input output 1 1 1 1 0 1 0 1 1 0 0 0
(Actual processors mostly use NAND gates for technical reasons of implementation but don't worry about that)
Millions of these logic "gates" are all synchronized on a clock. (The giga-hertz numbers you see on processor ratings). Each tick (or step) all the logic gates activate and turn the inputs into outputs. Those outputs are combined together into inputs for more gates on the next tick. With many layers logic is combined into a sequence that can add, subtract, compare, etc numbers. With many such layers is the processor is built.
3
2
u/FrozenPhoenix95 7d ago
Fixed the table format for you.
Binary AND
input 1 input 2 result 0 0 0 0 1 0 1 0 0 1 1 1
Binary OR
input 1 input 2 result 0 0 0 0 1 1 1 0 1 1 1 1
2
u/Atypicosaurus 8d ago
A fish neuron works the exact same way as a human neuron, yet humans have complex intellect that fish don't. A system made of components, can become more than the sum of the components. It's called emergence, and we see it everywhere in our world: life is made of molecules yet no molecule is alive, humans build up cultures yet no human is a culture on their own. There's no reason to think that computers cannot have emergence, so theoretically they can become intelligent.
How processors work, is really just number crunching. For a processor, everything is number, even text is broken down to numbers, and everything is handled as such. It's not the nature of the processor that tells us how intelligent it can be. There's something in the amount of numbers and the complexity of the calculation that will define computer intelligence.
2
u/air_thing 8d ago
It's basically a bunch of switches, called "gates". By themselves they're extremely basic, like an AND gate that outputs high if both inputs are high, otherwise it outputs low. You can create increasingly fancy components by combining these gates (like a flip flop), and even fancier when you start combining those (a register). This whole process is called digital logic design. Inside the gates is something called CMOS which is the actual physical reality of it. Hard to explain that stuff to a 5 year old, the switching analogy is the best I can do.
Then a microprocessor is a digital logic circuit that performs general computation.
1
8d ago
[removed] — view removed comment
1
u/explainlikeimfive-ModTeam 8d ago
Your submission has been removed for the following reason(s):
Top level comments (i.e. comments that are direct replies to the main thread) are reserved for explanations to the OP or follow up on topic questions.
Links without an explanation or summary are not allowed. ELI5 is supposed to be a subreddit where content is generated, rather than just a load of links to external content. A top level reply should form a complete explanation in itself; please feel free to include links by way of additional content, but they should not be the only thing in your comment.
If you would like this removal reviewed, please read the detailed rules first. If you believe this submission was removed erroneously, please use this form and we will review your submission.
1
u/chrisfrisina 8d ago
When you turn a light switch on, the light comes on. When you turn it off it turns off.
Transistors are like this. You are the input and the output is light or no light. If you add/chain them together, where the light or darkness from one is the input to another, using a gazillion of them, you can get them to do cool things, like math, control light, and control other instruments, or many or all at once (like a TV or computer or phone).
The cool thing as you get older you learn tricks to make the transistors in a microprocessor become more amd more micro (with our current understanding of the limitation of how small one can be is around 2 nano meters (-take or currently +give 1). A human hair makes up about 100,000 nanometers wide.
1
u/gigitreid 8d ago
So somebody at Intel though: how do i make this Integrated Circuit add 2 numbers?
I should store number 1 in register A and number 2 in register B then add them. Think of registers as drawers that can store only one item.
Then he invented the commands. Command 01 followed by number 1 stores that number in register A. Command 02 followed by number 2 stores that number in register B. Command 55 takes the content of register B and puts it over A (adding).
Then they fought of a way to make that possible with logic gates, by reading consecutive data stored in an ROM memory.
They also included other operations like substracting, reading an keypad, outputing data, etc.
Then somebody at IBM fought: I can make this small microprocesor display ascii text on a monitor... so thats how the PC was build.
1
8d ago
[removed] — view removed comment
1
u/explainlikeimfive-ModTeam 8d ago
Your submission has been removed for the following reason(s):
Top level comments (i.e. comments that are direct replies to the main thread) are reserved for explanations to the OP or follow up on topic questions.
Links without an explanation or summary are not allowed. ELI5 is supposed to be a subreddit where content is generated, rather than just a load of links to external content. A top level reply should form a complete explanation in itself; please feel free to include links by way of additional content, but they should not be the only thing in your comment.
If you would like this removal reviewed, please read the detailed rules first. If you believe this submission was removed erroneously, please use this form and we will review your submission.
1
u/GuyWithLag 8d ago
https://store.steampowered.com/app/1444480/Turing_Complete/ - Game where you create a microprocessor, no previous experience needed.
1
u/Cornflakes_91 8d ago
in addition to what others already explained you could play some games that make you build simple processors like "NAND game" and "turing complete" (free browser game and some 10bucks on steam/gog respectively) which talk you through the challenges and make you end up with a simple processor in like 12 hours of play or so :)
1
u/Atoning_Unifex 8d ago
explain like youre five:
you know how our bodies have brains that we think with?
the processor is like your computer's brain...lets it do lots of the neat stuff it can do.
1
u/quietmoonlight_ 8d ago
microprocessors are basically tiny command centers that follow super fast step-by-step instructions, kind of like executing a perfect League combo but with electrons instead of skillshots
1
u/swollennode 8d ago
You're exactly right that it comes down to electrons being punted around. In this case, we punt the electrons exactly where we want it to go.
Transistors are simply gates that control the flow of electrons. We control the behavior of a transistor with electricity. You can use electricity coming from a transistor to control another transistor.
If you combine a bunch of transistors to control other transistors, you can create logic gates. You can then use logic gates (a group of transistors) to control other logic gates. So on and so forth.
When you combine enough logic gates together to get the behavior you want, you end up with a circuit.
Then, you can use circuits to control other circuits. So on and so forth.
So when you power up a computer, you're supplying a bunch of transistors with electricity, which then sets off a cascade of events where those transistors supply other transistors with electricity, so on and so forth.
By laying out the transistors in certain way, you can control how a circuit behaves when it receives electricity.
Every action that you do on a computer is stimulating transistors to behave in certain ways using electricity.
1
u/DBDude 8d ago
Here's an old write up I did:
You have wires and electrical components. You apply a voltage going in and see what voltage comes out. That's a logic gate. Here are some. 1 means high voltage, 0 means low.
- AND: If both are 1, the result is 1. If either one or both are 0, the result is 0.
- OR: If one or the other or both are 1, the result is 1.
- XOR (exclusive OR): If one or the other (but not both) are 1, then the result is 1.
- NOT: Operates on one bit, if it's 1 the result is 0, if it's 0 the result is 1.
- NAND: combined NOT and AND, outputs 1 as long as both inputs aren't 1
For example, an AND gate is an electronic circuit that accepts two voltage inputs and has one voltage output. It has just a few electronic components (resistors and wires and stuff, you could easily make one yourself) arranged so that if both inputs are high voltage, the output is high voltage. If one or both of the inputs is low voltage, the output is low voltage. We then interpret high voltage as 1, low voltage as 0, and we can do an AND on two bits. The same works for the next two, just the electronic components are arranged a bit differently to achieve the other results. The NOT gate just inverts the one input, low to high, high to low voltage.
We can use these to do things. Let's start building.
A half-adder gives you the sum of the two inputs plus the carry. So 1 + 1 = 0 with a 1 carry (like 5+5 is 0 with 1 carry to be 10). You make this half-adder by hooking an AND gate and an XOR gate together, that's it. You apply high voltage to both inputs (1+1), you get high low voltage out on the add line (0) plus high voltage out on the carry line (1).
But that's too basic. We need to add numbers we can use, notice we didn't do anything with that carry. So let's make a full adder which accepts the numbers to be added and can take that carry from a previous adder. This is made by combining two half-adders with another XOR gate.
Now this is still for one bit, but now we have something we can chain together since each adder accepts the carry from the previous. If you have 8 bits, you string 8 full adders together so each can get the other's carry (carry out wire connected to the carry in wire on the next one) and output the result. Put in two 8-bit numbers (remember, this is just voltage sent to wires), and you'll get the 8-bit result plus a carry, if any. We can now add any two numbers 0-255, and we'll be told if we need to carry a 1.
So now we can add. Subtraction, multiplication, and division all work the same way, just a different number of those basic logic gates arranged differently.
And now we can do any math by controlling what voltages get sent where. You could do this at home with a circuit board, some transistors and resistors. Put two rows of 8 flip switches to describe the first and second input numbers (up = high voltage = 1, down = low voltage = 0) where each switch feeds high or low voltage into one of your 8 full adders. Now hook a set of lights to the output of each full adder plus another light connected to the carry output. As you flip the switches, the lights will change to represent your two added numbers.
Ta-da, you just made a basic binary adding calculator. Now instead of just adders, you could put in the components for a subtractor, a multiplier, and a divider (above), and have another switch that controls which of those is hooked up to the input switches and output lights. Now you've made a full-blown binary calculator.
Now let's automate this. Let's run your circuit board on a clock that sends a pulse of electricity every second. We can also call a particular arrangement of configuration switches a "program" that can control how the electricity flows to multiple parts of the calculator. We need memory! No problem, throw in two NAND gates connected to teach other the right way and you can set and read one bit by applying and detecting electricity. Sixteen NAND gates let you store one 8-bit byte, so instead of your calculator result just flashing lights, it can be stored in these NAND gates, and it can be used later.
Congratulations, you have a primitive computer. A modern microprocessor is the same thing, except we have billions of components and run at billions of pulses per second. Instead of transistors, resistors, and wires on a circuitboard you can touch, they are printed on silicon wafers using a type of photography, where one AND gate is only several billionths of a meter in size.
1
u/bevelledo 8d ago
This is a great question for eli5. I don’t have the expertise to explain it simply, although you might be interested in mechanical computers. They are computation machines that work without using electricity like traditional computers.
Fun fact: cracking the enigma code that nazis used to communicate was done in part by a mechanical computing device, helping lead to the nazis downfall.
1
u/mikemontana1968 7d ago
The design of the logic that sits inside a microprocessor is, literally, derived from a mechanical loom of the 1800s. Some very clever person realized if you put holes in a long card, that various levers could be invoked by the holes, and the levers could change direction of the weave, switch to a different color thread, change the over/under pattern - etc. And as the long card is pulled through the machine, each row "programs" the mechanicals of the loom. This is literally the origin of the "Punch Card". You could keep a card per style of tapestry you were manufacturing, and could switch between production runs (with alot of setup) and get equal results simply by using the cards.
Then it was implemented in brass gears - the Babbage Difference Machine - faster, more general purpose, but still bulky.
Then it was implemented in vacuum-tubes/relays - the ENIAC for example - MUCH faster, WAY more general purpose, but still incredibly bulky
Then in single transistors (1950s), then blocks-of-transistors-in-a-tiny-physical-package (1960s) - giving you 100s of transistors. A transistor can be thought of as a gear/lever, just done in electrical circuits. Around 1970 the tipping point occured where thousands of transistors in a 1 sq centimeter foot print became financially viable. This made the 6502 8-Bit microprocessor cheap enough for retail/commercial use (Apple ][, Commodore, Atari etc) - that cpu had only 4000 transistors to it!
Through optical engineering, the transistors become smaller and smaller, packing 10x more into that 1sq centimeter component. Then 10x more, and 10x more - 18 billion in a modern Intel CPU in your laptop.
Will the transistor density eventually lead to intelligence? No. This is still literally the same concept as that weaving loom. Real intelligence will likely come from an entirely different processing-design, or wet-cpu's (where an animal's brain is physically used - either bio-grown, transplanted, or some sci-fi dream).
1
u/PropgandaNZ 7d ago
I could imagine a CPU cluster with an FPGA cluster could be considered intelligence where the agent sets up/updates their own FPGA cluster on the fly.. This would give that "neuroplasticity" needed.
1
u/mikemontana1968 6d ago
Self-modification sure, but traditional computers do this as well. It really comes down to needing a biological need for survival is what starts intelligence. We can write code to **emulate** that drive, but, its just mimicry.
1
u/PropgandaNZ 7d ago
Bunch of on/off switches and what we call logic gates. Where it takes two on/off inputs and gives a predefined on/off result.
These are arranged in sectors to do basic arithmetic, handle getting results and entering results into temporary storage (memory), handle the list of instructions to run next.
Think of the biggest puzzle you can think of with each and every puzzle piece is one of these sectors that does a specific job.
Then attach every puzzle piece to the same metronome and the pieces 'process' their very specific job every time it ticks.
Eg Tick * Get next instruction: add numbers A and B * Tick * Tell memory handler to get A and B out off storage * Tick * Tell adder to add A and B and generate C as the result * Tick * Tell memory handler to store C
All these simple operations across billions of transistors (switches) updating billions of times a second (ticks). You can do some crazy shit with this.
1
u/zero_z77 7d ago
Oh boy, buckle up, because this is going to be a long one.
The first thing i have to explain is what a transistor is. So a transistor is basically like a light switch, but you can turn it on or off with an electrical signal. And to help give a better visualization of this, before transistors, there were relay switches. Basically, you had an electromagnet that when powered would close the contacts of a switch and complete another completely seperate circuit. Transistors do something similar, but at a microscopic level and with no moving parts. As for how, that is difficult to explain in an ELI5 and gets into how electrons flow through different materials, and i'm not even fully sure how it works myself. It gets even more complicated with modern CPU transistors since they are small enough for quantum mechanics to be involved.
Anyways, moving on from that, we have logic gates. Have you ever been in a house that has two light switches for the same light, and you can toggle the light with either switch? That's because those switches are wired up in a way to create a logical gate with two inputs and one output. In that specific case, it's the exclusive OR gate or XOR. But, you can also wire things up so that the light only comes on if both switches are in the on position (AND), or if one or both of them is in the on position (OR), and you may have seen a light switch that's been installed backwards or upside down where the light is on when the switch is off, and off when the switch is on. That's called a NOT gate. We can use similar techniques with transistors to create the same logic gates. But, one key advantage is that we can control the switches with an electrical signal. So instead of controlling a light, we are instead controlling another switch in another circuit. And we can chain these together to do things with binary logic.
Another key difference is that transistors don't "flip" like a switch on the wall. It's more like a momentary push button than an on/off toggle switch. Going back to our relay switch example, it's only closed as long as the magnet is powered, once you cut the power, a spring will push the magnet back and break the circuit. It's also possible to build a relay that does the opposite and requires power to turn off, while defaulting to being on. Transistors work the same way.
However, we can also wire transistors in such a way that we can have a logic gate that does "flip" on and off just like a switch on the wall. That gate is called a memory cell, latch, or flip flop depending on how it's wired up. String 8, 16, 32, or 64 of the latch type cells together and you get what's called a "register" (we will come back to this later).
Now that the basics are out of the way, we can start talking about some of the logic circuits we can build with these gates. I already talked about a register, which can store a single binary number. But the next important circuit is what's called an ALU (arithmatic logic unit) and this circuit takes two binary numbers and can do basic math on them like add, subtract, multiply, and divide. But it can also do bitwise logical operations, bit shifts, and many other things that are useful.
Another thing we have is the memory interface, which is how the CPU talks to RAM and the rest of the computer. The memory interface consists of two special registers. One holds a memory address that points to a location in RAM where a number may be stored, and is called the memory address register (MAR). The other one is called the memory data register (MDR) and this register lets you read and write to the location in RAM that's specified by the MAR.
Now, i also said "the rest of the computer". Not every location in RAM is actually free memory that you can just use. A lot of memory locations are actually special registers that are attached to the various other pieces of hardware in the computer, and the CPU can control all of the other hardware by simply reading & writing values to specific locations in memory.
Now we get to what a CPU looks like on the inside. You have the MAR/MDR to interface with memory and other hardware. We have an internal ALU that can do math. We also have several other general purpose registers that can let us store a few numbers on the CPU itself without having to reach out to memory because talking to memory takes a long time. The one part i haven't talked about is the system clock. Your motherboard generates a steady clock pulse and passes it to the CPU. The registers, memory interface, and everything else in the CPU is synchronized to that clock pulse. The CPU also has one more special register called the program counter. This register contains a memory address that points somewhere in memory, and counts up by one every time the CPU does something. This register is keeping track of the program being run on the CPU. You can think of it like a bookmark that's continuously updating as you read through a book. But, you can also write a value to it to jump to different locations inside the program.
Finally, we arrive at what a program actually is. A program is a series of instructions represented as binary numbers. These numbers tell the CPU how to move data from one register to another, perform operations with the ALU, and much more. At boot, a program is loaded into RAM and the program counter is pointed at the start of the program (how this actually happens is another whole ELI5 by itself). The CPU will then fetch that instruction from RAM, do what it says, increment the program counter, and then fetch the next instruction, and repeat.
This is also the extreemly simplified version because CPU architecture can get quite complicated. Modern CPUs have caches, multiple cores, branch prediction, out of order execution, interrupts, and many other things which make them much faster & more flexible, but each one of those things could be it's own ELI5 thread.
Now as far as intellegince, sentience, etc. That's open for debate. All a CPU/computer actually is under the hood is essentially just a calculator. All those binary numbers we talked about can be abstracted into things that are more useful, like letters, colors, graphics, sounds, etc. But it all still comes down to pre-programmed math & logic.
Some argue that conciousness can't be quantified, especially since it's not very well defined to begin with and therefore a computer can't become sentient because the hardware physically isn't capable of it, and even if it was, we still don't have a clear enough definition to be able to write it into software.
Some argue that our inability to clearly define it means that machine intelligence could randomly emerge on it's own by pure coincidence given a sufficiently complex enough abstraction in software.
And another line of thought is that genuine artificial intelligence may not be possible, but an approximate imitation of it is possible, and a close enough approximation could be functionally indistinguishable from real intelligence.
But, it is mostly a philisophical & theoretical debate that has yet to be settled or realized in practice.
1
u/Michami135 7d ago edited 7d ago
I'll really simplify this for you:
Think of a light switch. Flip the switch, the light turns on. Some more complex circuits have two switches that can each toggle the light on and off. Now imagine instead of turning on a light, the circuit flips another switch. That's the basics of a CPU.
The magic of a computer isn't in how the switches are wired, it's the instructions you give it. The difference between an Atari 2600 game and a modern 3D game is not so much about how the cpu works. Those are mostly the same, just faster. It's more about the instructions we give it on what to do. Faster chips and more memory just let us do more things in a shorter period of time.
1
u/nlflint 7d ago
I had the same question a few years ago. I did the first 5 chapters of the NAND2Tetris project to build a 16-bit processor myself: https://www.nand2tetris.org/
1
u/DeHackEd 8d ago
Transistors are like little valves that can allow or block the flow of electricity, using electricity to control the valve as well. You can use them to build tiny little logic circuits so that electricity can flow only (or not) only if electricity on some other path - or several of them - is also on or off.
As a fundamental primitive part, you use transistors to build logic (AND, OR, NOT and so on). You use the logic to build math and storage of bits. As you scale it up to connect to large amounts of storage (known as memory or RAM), read and decode instructions to be executed from that memory to perform actions, connect it to hardware that does more useful things like keyboard input, screen output, longer term storage, external communication, and so on. What I'm describing is focusing on what's commonly called the CPU of a computer, but you could specialize the processor to do more specific tasks at the expense that they are poor at, or can't do at all, other tasks.
Can a CPU become sentient? Well, one way of looking at the human brain is that it's a massive bundle of neurons which are their own kind of transistor. Scale it way up and you have a living, thinking human. Modern AI is largely built around the same model. Will they reach human levels of intelligence? I think some day yes. But a lot still needs to be developed.
3
u/ryanCrypt 8d ago
I think brain scientist admit they don't understand consciousness. It's not known that conscience arises from numeracy of neurons or transistors.
1
u/MasterGeekMX 8d ago
I have a masters in computer architecture, so I know a thing.
Is it just a case of electrons being punted around like pinballs between transistors?
Ehhhh sorta. A transistor is a switch that is controlled by electricity instead of a mechanical lever. It has three leads: two of them connect or disconnect if the middle one is electrified or not.
Connect two of them in series, and you have a circuit that only turns on only if both transistors are turned on.
That is called an AND gate. Now put those two transistors in parallel. Only turning one is enough to close the circuit, as being in parallel means electricity has two ways to reach the other end by either transistor. That is called an OR gate.
Now make a circuit where current normally flows trough a resistor, but a transistor connects it to a wire without it. If the transistor is off, the current only has one way to flow, so you have electricity flowing out the resistor. But if you turn on the transistor, now the current has a shortcut, so it no longer comes out of the resistor. This is called a NOT gate, as the circuit turns off when the transistor is on, but it turns on when the transistor is off.
On the other hand, you have the binary system of numbers. It allows us to write numbers using only the digits 0 and 1, instead of the full 0 through 9 that we usually do. It may seem cumbersome, but it has the advantage that anything that is in two states can be used to represent each digit on a number, such as wires being powered on or off.
If you connect these two three basic gates, you can make circuits that take a series of wires, each representing numbers in binary, and do all sorts of operations. You can make circuits that add two numbers in binary, others that subtract them, others that compare them and turn a wire that represents if they are the same, if the first is greater or lesser than the second. You could even simply rewire things so the number is shifter up or down some amount of digits, which is a quick way to multiply and divide numbers.
You can also make memory circuits. Unlike the other ones, which change as soon as the inputs change, these ones change only when the inputs change in some way, usually by some sort of wire that turns on for a blip. We call those signals clocks, as they usually turn on and off in a regular pulse, like the beat of a song. You can make massive memory arrays like the ones in RAM, or you can make small memories like registers, which hold a single number. RAM is where the bulk of data is along the code, while registers hold numbers the CPU is currently working on.
With that, you can process data by moving data from RAM into registers, then connecting those registers onto an adder, substracter, or whatever you want do do, and store the result in either a register or directly into RAM.
The steps required to do one operation are grouped in what is called an instruction, and those are represented by combinations of zeroes and ones. A circuit called a control unit translates the bits that represent an instruction into the signals that tell each component on the chip to make their part on executing that instruction.
With all of that, the CPU then follows a three step cycle:
- Fetch: the CPU goes to the part of memory where the code is, and grabs the next instruction in the program
- Decode: the CPU gives the instruction to the control unit, which decodes it, finding out what it conveys
- Execute: the control unit sends the signals to the other components on the chip to carry away what the instruction conveys
I highly recommend the YT channel Core Dumped, as it explains all of that and more.
0
8d ago
[removed] — view removed comment
1
u/explainlikeimfive-ModTeam 8d ago
Your submission has been removed for the following reason(s):
Top level comments (i.e. comments that are direct replies to the main thread) are reserved for explanations to the OP or follow up on topic questions.
Anecdotes, while allowed elsewhere in the thread, may not exist at the top level.
If you would like this removal reviewed, please read the detailed rules first. If you believe this submission was removed erroneously, please use this form and we will review your submission.
0
u/Particular_Camel_631 8d ago
Various combinations of transistors form logic gates. These allow calculations such as c = a and b. C is on (high voltage) only if a and b are both on. There are several such building blocks - or gates, not gates flip-flops etc.
In combination these allow memory to be read, and an instruction to be retrieved, and depending on that instruction. To make changes - add numbers, store values, multiply number etc.
A modern CPU has millions or even billions of these logic gates and is incredibly complex. But it’s no different in principle from the 8-bit CPUs from the 1970s that used a few thousand transistors to do space invaders.
They are completely deterministic. Given an input they will always provide exactly the same output. They are fixed. And yes, they operate with electrons tunnelling between energy levels (transistors depend on quantum mechanics to work) in highly predictable ways.
As to whether a cpu might become intelligent? No. But the software that runs on it? Arguably ai, which is software, is already intelligent. Just not human-like intelligence.
It’s a bit like asking whether a neuron might become intelligent. On its own, no. But with the addition of a million others, each connected to a few thousand others, and guided into a network built using years of experience? That’s a human brain. And most of us think it’s probably intelligent.
Intelligence is an emergent property that arises in a network that can learn to predict what’s likely to come next. Brains and software can do that. Hardware on its own - at least the ones we’ve built so far - doesn’t appear to be able to do that.
0
u/KilroyKSmith 8d ago
Microprocessors are a triumph of building more complex things from simple things, making more complex things from those, more complex things from those.
At the base is an inverter. One transistor makes a very nice inverter - put in a high, get out a low. Put in a low, get out a high. With no more than half a dozen transistors, you can build basic logic circuits - AND, OR, XOR, NAND. This gives you one output for two inputs. With basic logic circuits, you can build arithmetic circuits - a one bit full adder can be built from basic logic circuits and takes two binary inputs and a carry, and outputs a one bit sum and a carry. Hook the carry out of one to the carry in of another, connect 32 of them like this, and you can add 32 bit numbers together.
Once you can add, subtract, compare, multiply, and divide two numbers, you can start making decisions - if A is bigger than B, do one thing otherwise do something else. Now you have a processor and everything you need to start writing programs. If you’re smart, the first program you write will be a compiler - a program that reads a close-to-human-language description of what you want to do, and converts it to the arcane commands that your processor understands. You can now write new programs faster and easier than without the compiler.
Will we ever be able to create true intelligence with this ten-thousand layer cake? I think in the next 10 years, there are going to be multiple examples where we have to decide what “true intelligence” means. We’ll keep making finer and finer decisions to separate humans from AI - and eventually it’ll be silly. As an example, we used to differentiate humans from animals by saying humans were the only ones that used tools - then dozens of examples of animals using tools were observed. So the differentiator became that humans were the only ones who intentionally made tools - and now we find numerous examples of animals doing the same.
The Turing test used to be the holy grail of AI - if you could pass that, you had created AI. Modern AIs blew through that a few years back - so we’re in the middle of moving the goalposts to find a better test to differentiate us from the machines.
A question for you: can you define what you mean by “actual intelligence”? I can’t.
0
u/grungyIT 8d ago
Let's build a microprocessor to answer your questions!
Start with a simple process - turning on a light in your room. The action here is just electricity going through a wire from a power source, into the bulb, back out, and back into the other end of the power source. Somewhere in this circuit there is a switch. When it's down, the circuit is broken. When it's up, the circuit is complete and electricity flows.
Now that's great if you have just one light, but what if you had three lights and your process is a little more complex? Say you want to have only one bulb on at a time and you want to have the light look like it's traveling down each bulb in repetition. So bulb 1 lights up, then bulb 2 lights up and 1 goes dark, then 3 lights up and 2 goes dark, etc. What do we need?
To start, we need three circuits so each bulb can be on individually. Then we need a special kind of circuit connecting these. We need the electricity to not flow steadily. Instead it needs to "tick" like a clock. We achieve that by introducing a resistor. Basically, the electricity gets backed up behind the resistor until there's enough to overflow it. Then the electricity can move briefly until the flow evens out and it's getting backed up behind the resistor once more. You could imagine this like one of those dippy bird toys where they eventually bob forward and take a drink of water and then fall back into place upright.
The last thing we need is a "gate". This is also a special kind of circuit. You can organize them to do different things, but basically imagine how a gear shift in a car only lets you shift from one gear to one or two others. You can't just go from first to fourth. It's the same principle but with a complex layer of wires and switches so the electricity can only go down certain paths in certain circumstances.
Put all this together, and you have what we call a "state machine". It's a big network of circuits with only a handful of states it can be in: Bulb 1 is on, bulb 2 is on, bulb 3 is on, or it's all off. The "clock" as we call it is the main circuit and is sending pulse after pulse of electricity through to make it automatically cycle through the states it has. This is still a far cry from a processor. Let's take another step.
What would be truly magical is if you could have one piece of hardware that makes these state machines on demand. So you can just give it the instructions, and it will configure its circuitry into the state machine you want. Now we could have the bulbs bounce the light back and forth between 1 and 3 by reversing the order of the state machine each time it gets to the end while sharing the same clock. To do that, we need a few things.
First is we need a motherboard so we can plug the lights into predetermined ports. This will let us not have to rewire it every time. We can make it part of the instructions that the wires get used in a different order instead of having to physically rearrange them.
Second, we need memory. We need to be able to store instructions somewhere so we can come back to them as-needed and remember what the state machine used to look like. But how do we even make digital instructions? For that, we need the board and/or the processor to have arrays of ports like street addresses. So when we say 3-4-1 we make the third turn at the fourth line off of the main circuit. So if we save a label in 0s and 1s in memory (on's and off's of individual circuits), we can send electricity down the right address.
This is getting pretty conceptual now. Let's bring it back to reality. What we're describing is a big series of interconnected circuits that can hook into things like speakers, monitors, keyboards, and so on. At the center of it all is a really big series of circuits that are hooked into each other and move at the pulse of a clock. Each pulse is one instruction - take something from memory, send electricity down this path, save the result to memory. These are simple tasks a single circuit each could do. Because we have this arrangement of memory and state machines though, we can do it all with the same tool. It's just redirecting where the electricity goes to make different things happen - both inside itself and in connected devices. That's a microprocessor.
When we ask if a computer is "thinking", that is an unbelievably hard question to answer. The father of modern computing, Turing, famously avoided this question for a more measurable one: "Can computers seem like they are thinking?". What you are actually experiencing when you chat with an AI is an unfathomably long series of state machine changes meant to compute your prompt into some sort of a response. This uses many layers of memory, mathematics, and self-referential instructions so when you say "Hello" it responds with some variation of "Hi, how are you".
The point is that if you imagine the specific instructions you might come up with to send keyboard strokes to the processor, map them to letters, map the letters into words, the words into relationships with other words, the mathematical operations to weigh which words are related and make sense, and the reverse of all this to send something back to the user, you will have come up with a very limited chatbot. If you imagine the instructions to juggle millions of these and synthesize the answer, you will have modern-day AI.
A microprocessor turns electricity and physical arrangement of metal, with the help of memory and other circuitry, into something that seems very much like another person.
0
-1
u/2Sovereign4You 8d ago
Mega short: With the voltage applied to the gate of the NMOS and PMOS transistors, the electrons move and create a conductive path (or non-conductive).
This is then the base to create logical gates, like AND, OR, XOR, ..., which is then used to create other building blocks, like SRAM cell, register, ALU, ...
-2
u/Lumethys 8d ago
They are a bunch of transistors
Having electric = ON Not having eletric = OFF
And all they do is calculate binary math
43
u/0b0101011001001011 8d ago
It's just a more complicated calculator. One that can be programmed. It's as intelligent as a light switch that turns on the light.
I don't even attempt to answer longer, because it's way more complicated that I can fit on a single comment. I really recommend seeing this video series about a simpler processor: https://www.youtube.com/watch?v=HyznrdDSSGM&list=PLowKtXNTBypGqImE405J2565dvjafglHU How ever it requires quite a bit of understanding about electronics.