How does a COMPUTER CPU actually WORK?

preview_player
Показать описание

Background videos:

Chapters:
0:00 - What is a transistor?
1:40 - Review of computer components
2:58 - Intel 4004 processor
5:08 - How CPU and ALU processes information
6:56 - How logic gates work and are constructed
9:22 - How are two numbers added?
13:02 - How do quantum computers work?
16:56 - How to learn quantum computing in depth

Summary:
Any device that you might be watching this video on is made possible by something similar to a simple light switch. It's either on or off. Yes, or no, true or false - a transistor. The brain of your computer, called the CPU or central processing unit, is made up of billions of transistors.

How does a computer work? The main component of a computer, that actually computes, is called the central processing unit, or CPU. The computational part of the CPU is called the ALU or arithmetic logic unit. ALU is composed of logic gates. Logic gates consist of groups of transistors. These logic gates do the actual computation in CPUs.

In this video, we look more closely inside a CPU. We look at the first commercially available processor called the Intel 4004. It was a 4-bit processor. This means it could work with inputs formed by 4 bits. Thus, the processor could accept an input like 1011. This is also called a word. A word is an object made from 1’s and 0’s with which the CPU works. The Intel 4004 used 4-bit words, and consisted of 2250 transistors (Modern processors are 64-bit and consist of billions of transistors).

Instruction tell the ALU how to process the inputs. How does an ALU work? If we want to add two numbers, 2 and 3, first these numbers will be represented by 4 binary bits. In binary code, 2 is 0010 and 3 is 0011. These are the input bits, also called operands. To add them together, the instruction code must tell the ALU to add them. This will be specified by some flag that tells it what to do with the operands it receives. Flags are also bits.

What is a logic gate? It takes in two bits, or two binary numbers, then depending on the type of logic gate it is, the gate will output the appropriate result bit. Physically these gates are made from a bunch of transistors connected in the appropriate way for whatever gate you want to make.

A simple example would be the AND gate. In the AND gate, if the two incoming bits are 1, then the output is 1, otherwise the output is false. Another gate is the OR gate. Here if either, or both of the incoming two bits are 1, then the output is 1. Otherwise, the output is zero. If we only want to output a 1 or true, if and only if one input is 1 and the other is 0, then we use an XOR gate.

There are several more gates but with the AND, OR and XOR gate we can make a circuit which can add numbers. I explain how AND, OR and XOR gates are built using transistors.

How do logic gates to add numbers? 2 XOR gates, 2 AND gates and one OR gate can add a number. This is called a full adder circuit. I explain how a full adder works.

Similarly, logic gates can be constructed to do other things. A computer can do all kinds of cool things, but at its core, it is just doing first grade math.

How do quantum computers differ from classical computers? Quantum computers in principle do the same computations as a classical computer, but instead of bits, it uses qubits. Qubits are bits that are in a superposition of both 0 and 1, so they can potentially take on an infinite number of values between 0 and 1. Qubits could be made with one of many quantum objects like electrons or photons, that have some binary property like spin.

Because qubits can be in a state of both 0 and 1 at the same time, qubits can store 2 to the power of the equivalent number of bits. So, 3 qubits can hold the same amount of data as 23 or 8 classical bits. And just 10 qubits would be able to store the same data as 2^10 or 1024 classical bits.

A qubit is stationary. So the bits do not flow in quantum computers like they do in classical. So the logic gate has to be applied onto the stationary qubits. This can be done using photons - microwave pulses.

Instead of classical logic gates, quantum computers use quantum logic gates. In the quantum case we can also make a full adder to add two numbers, but instead of AND gates, we use Toffoli gates. And instead of OR or XOR gates, we use CNOT gates.
#quantumcomputer
#howcomputerswork
The “magic” of the quantum computer comes from the fact that the quantum logic gates can work with qubits. So instead of adding just 2 numbers together, we could do 4 additions at the same time. If we had 3 qubits, we could do 8 additions at once, and so on.
Рекомендации по теме
Комментарии
Автор

Also, this video is very information packed. I highly recommend TWO viewings. I guarantee you will get a lot more from the second viewing. Thanks for your support!

ArvinAsh
Автор

You just explained the first 5 weeks of my digital logic class in less than 20 min AND I’d makes more sense. Thanks Arvin!

mj
Автор

This is one of the very rare channels that go deep enough into the substance to really satisfy my curiosity! Bravo!

nerdexproject
Автор

Man, Arvin Ash does such a good job explaining topics that are fraught with complexity in a manner that makes them accessible to anyone with 12 to 20 minutes to spare and a modicum of patience. I cannot praise this man and his videos enough. Cheers!

johnlong
Автор

"The past might be classical, but the future is almost certainly going to be quantum."

I've watched many of your videos and thus realize this line is a smart reference to some of them where you mentioned that the past is 'certain' and the future is 'uncertain', which relates to why the entropy keeps increasing and why time always flows forward. Oh how good a teacher you are!

wulerhaufung
Автор

Finally someone who explains how computers work propperly! thank you so so so much.

ICANanimations
Автор

I wrote software for the 4004 back in 1972. It's really fun to watch this superb presentation on something I thought I knew in some detail. I now wonder how many of today's computer scientists could assemble a half adder gate array from scratch. Back then, we just took it for granted. This is the first time that it has ever dawned on me to consider the gate array that is necessary to do the job. Great video Arvin, and thanks for making me think again after all these years!

bobf.
Автор

I appreciate your commitment to sharing your research with others. Thanks, buddy.

CamiloSantana
Автор

"Arvin, your cap is either on your head or it is not, there is no between."

- Yoda

thingsiplay
Автор

I just wanted to say thank you for diving into the fine details of the ALU with the logic gates and not glossing over it. I have always wondered how logic gates ACTUALLY work at the transistor level

rabbits
Автор

I have been watching videos on this channel for a long time now. I have also seen many many explanation videos of the same topics. But the intuition about that particular topic that this channel can build is on whole another level. KEEP IT UP.

dhruvbonde
Автор

Wow, I did not expect to learn not only how to Add in Binary, but also how to count to 15 in Binary! Thanks as always for your amazing science videos!

ElDJReturn
Автор

I love to see you dig deeper Mathologer's style. I personally enjoy diving into subjects and get at least a good essence of it. You did a wonderful job explaining the way classical computers work at their core. I really feel that your videos are getting better every time... and I watched them all ! Thank you so much !

TranSylvainie
Автор

Finally, after 30 years, someone has explained properly the logic gates! Big well done, Ash!

KamilsView
Автор

Finally i understand it. So many people stop explaining at that there are logic gates but what exactly they do and how nobody says

kyoto
Автор

That bit about the 4004! I did a presentation about it for a CS class and I love whenever people mention it.

sethbettwieser
Автор

Very clear and concise visuals and explanation. I've only seen a handful of your videos since finding this channel the other week, but it's already one of my favourites. Love the work you do on this channel!

mal
Автор

Its awesome to see how you condensed so much in this small video. Really love your channel.

sparshsinghal
Автор

That was by far the best explanation of both classical and quantum computing I've seen. It took the explanation to the next level of detail than most similar videos do, but still explained all the concepts. Great work

ngodwi
Автор

Well done. The description of classical logic circuits is really good.

grayaj