How Do CPUs Work?
Ғылым және технология
How do the CPUs at the heart of our computers actually work? This video reveals all, including explanations of CPU architecture, buses, registers, machine code, assembly language, and the fetch-decode-execute instruction cycle.
If you enjoy this video, you may also like my previous episodes:
Explaining SSDs: • Explaining SSDs: Form ...
Explaining RAM: • Explaining RAM
Explaining PCIe slots: • Explaining PCIe Slots
Python Coding Introduction: • Python Coding Introduc...
HTML Introduction: • HTML Introduction: How...
More videos on computing and related topics can be found at:
/ explainingcomputers
You may also like my ExplainingTheFuture channel at: / explainingthefuture
Chapters:
00:00 Introduction
00:35 CPU Architecture
03:46 Running Programs
07:54 Modern CPUs
09:45 Wrap
Пікірлер: 665
When you render an image in blender and it takes hours imagine how many billions or trillions of operations your cpu has to do, I can't even imagine a number that big.
@adgarza
3 жыл бұрын
This comment is key, as we almost lost our excitement capabilities on this area. Let me tell you that one day like this, July 12, but back in 1950, Dr. Konrad Zuse finished and sold the believed to be the first commercial digital computer of the world: the Z4. This machine was able to perform ~1000 calculations per hour (a multiplication each ~3 seconds). And that was fast back on those days! Today, a processor easily can perform more than 250 billions (short scale) of calculations per second (FLOPS). And that's in just a 70 years timeframe! Sure, processors can go over this number (can go over 1TFLOP or 1 trillion of operations per second) today, and graphics cards can go over 8TFLOPS today. And we still complain about speed in computers.
@stefanopilone957
3 жыл бұрын
Thank you for this info, I also would like to know if Dr. Zuse's computer used discrete transistors or thermionic valves. Regards
@stefanopilone957
3 жыл бұрын
amazing ! thank you
@Maxawa0851
Жыл бұрын
@A. David Garza Marín we complain about speeds because of the evolving needs of humanity. Nobody will complain about the speed of a calculator, but if you want to do 3d rendering suddenly a few billion calculations per second is garbage
@bahshas
4 ай бұрын
@@adgarza amazing how computers can run trillions of calculations per second yet web developers create websites that cant be easily ran on them
I learned assembly language on a TRS-80 Model 1 back in high school. We created a program to fill the screen with pixels both in Assembly and in BASIC and I was amazed how fast the program written in Assembly ran compared to the interpreted language of BASIC. Fun times!
@ElmerFuddGun
3 жыл бұрын
My first assembly language was for the Z80 in the TRS-80 model 3. It kicked the model 1's butt! Upper AND lower case and all! ;-P I made lots of little assembly programs back in the day.
@peterjansen4826
3 жыл бұрын
See here why I avoid Python as much as I can. ;) I started 'programming' with BASIC, back then I simply had no access to other languages, I did not know anything about C or assemblybecause there was no internet. My first computer had an XT (pre-286) CPU, it had so little RAM that I could only play Prince of Persia by switching 1.4 MB floppies.
@appalachianwanderer4634
3 жыл бұрын
Good ol' trash 80. Seems like just yesterday.
@bobwong8268
3 жыл бұрын
I almost gave up learning programming due to BASIC & Flow-charting, despite attending face2face classes. Could hardly understand the GOTO stmt. I saw some light when by chance I saw my teacher coding in some other language that had no GOTOs and zero line numbers. And I asked and that was my First encounter with C. I purposed in my heart to learn C and declared to my teacher I want to learn that instead of BASIC. Alas, I was not willing for my parent to spend anymore in classes. Like what most other teens did; I turned to books. Spent hours to land myself on the right book. Finally learnt C and Psuedo Code b4 able to understand flow-charting. From thence, picking up another language was do-able. Yes, finally I code in VBAs and some other languages too. Assembly is a little challenging though, perhaps just need some purpose for me to go that route.
@ohasis8331
3 жыл бұрын
@@bobwong8268 YEAh, the biggest problem I found was to get the right info or most appropriate book at the time. There was plenty out there but none of it made much sense unless you happened upon the right stuff at the right time. That's where well structured and timely courses become useful.
Understanding computer architecture is a big challenge, but simplifying it is even a bigger challenge. Thumb's up 👍🏽
Something other than the football to watch!!
@stephensu4371
3 жыл бұрын
haha
@harshithlucky4704
3 жыл бұрын
kzread.info/dash/bejne/dGx4xciqo62voMY.html
@adventureoflinkmk2
3 жыл бұрын
Football: is this played with bulky people in pads chasing a brown oval shaped ball, or is it more slimmer people in silk shorts/shirts and joint pads chasing a black and white ball with pentagon shapes on it
@TAP7a
3 жыл бұрын
@@adventureoflinkmk2 it's the game where lots of people play with a ball mostly using their feet
@klaxoncow
3 жыл бұрын
@@adventureoflinkmk2 It is in reference to the "association" rule set that employs the truncated icosahedron, I believe. As the team nominally representing the country of England is partaking in the final of a European-based championship, which means that, within the UK, it is currently impossible to avoid references to "years of hurt" and the 1966 World Cup on the news. Thus, for those who give little to no shits for this event - such as the rest of the UK, which is not, in fact, English - then anything worth alternatively watching is greatly welcomed.
My father was fluent in machine code, he programmed bits in binary code, then programmed bytes and beyond. He was fluent in the hexadecimal language and then Cobol and other languages. This was the 60s and 70s and into the 80s. He writes programs, mostly in C and others. This video brings back wonderful memories of him trying to explain all of this to a 10-year-old kid in the 60s. The 10-year-old, which of course is me, dropped his jaw in amazement and then felt his eyes glaze over. All I was ever fluent at was BASIC. I still consider modern processors and what they could well become, like magic. I'm too old to understand most of this now but WOW! this video did NOT make my eyes glaze over and Dad would be proud that I still take an interest in all things computer (I have 10) and that there is someone out there still explaining down to the root workings of a microprocessor. Next? The GPU? Thanks, Chris. Brings back a ton of great memories (reams and reams of track fed print outs).
@ExplainingComputers
3 жыл бұрын
Great post, thanks for sharing.
Excellent video, Chris - It would be great to see something similar for GPUs.
@adventureoflinkmk2
3 жыл бұрын
Go one step further and add in APUs and I'd agree
@SteveC935
3 жыл бұрын
Maybe add in how GPUs differ from CPUs.
@mikeb3172
3 жыл бұрын
Modern professional GPU's can run OpenCL, so if look at that you can see the difference. OpenCL is made for massive parallel processing (the RTX3090 has 10.5k cores), they can't share memory between threads unless marked as volatile which means it can be corrupted/changed by any other thread at any time. Like releasing 10k bulls from a gate.
@dansplain2393
9 ай бұрын
Chris, please explain my wife
One of the best videos about the subject: simple, short and easy to understand. Kudos to Cris.
@TheErsatzMode
3 жыл бұрын
Did you already know how CPUs work?
@brucejoseph8367
3 жыл бұрын
Only easy to really understand if you are a software expert!
Having lived a life, learning, working and playing with computers for over 40 years I’m always amazed when I pick up new information. Thanks Chris.
Yes, please, do continue with the series. I warmly encourage you to take this path, since I find it interesting, coupled with the fact that you always have a gift into explaining computer related stuff very nicely and professional!
Your video brings back fond memories of my years teaching a computer literacy course at a local university. As always, you did a superb job of explaining the topic. Keep up the excellent work.
The more things change, the more they stay the same. The only difference is that the CPUs and memories I maintained in the ‘70s needed their own cabinets. Good episode. Thanks
@ExplainingComputers
3 жыл бұрын
So true -- stuff just keeps getting smaller . . .
@cdl0
3 жыл бұрын
Good comment, *Microbyte.* For your viewing pleasure, some classic cabinets and Mr Pomeroy, the master, giving a lesson on how cpus work without any fancy graphics in 1971 are here: kzread.info/dash/bejne/mGV41rttYturf6w.html *Explaining Computers* missed out this part, by the way, which is an essential part of the story, imho.
@tpobrienjr
3 жыл бұрын
From "cabinets" comes the archaic expression "casters-up"!
@ColinBroderickMaths
3 жыл бұрын
The way I see it we're still using computers exactly as Turing and his contemporaries envisioned them. Any storage medium is a one-dimensional array and is therefore just a tape and the CPU is a head reading that type and jumping around accordingly.
@MicrobyteAlan
3 жыл бұрын
@@cdl0 , yah machines like that. 😊
That was an amazing synopsis of basic CPU operations! I was skeptical that you could do it justice in 10 minutes but that was extremely concise and well explained! Bravo!
Great video explaining the inner workings and architecture of the CPU. Wish you well, Chris. Keep making these type of interesting ones.
So now with your explanation it is easier to visualize vector machines due to their wider execution registers: fetch-fetch-fetch-fetch; decode; execute; repeat. Thanks for another great video!
another EXCELLENT summary, Christopher: you are so gifted with an uncanny ability to get right to the heart of these technical subjects. KEEP UP THE GOOD WORK!!
Thank you, Chris. This was a clever simplification to understand such a complex theme. If I may ask for other components, I'd like to know more about how middlewares work in a network (for instance, in a bank, e-commerce or other high transactions environment) . I know there are plenty of courses on line about but, certainly, your point of view is a great summary.
Great video as always Chris!
Since several people have mentioned Ben Eater, I'll mention my youtube series on simulating my CPU design and eventually running it on an FPGA. By using the free Logisim program, you can simulate CPU designs and other digital logic circuits. And if using the various free Logisim Evolution forks, you can even send your circuit design to an FPGA. My CPU design playlist is: kzread.info/head/PLLQoKy-hD9LDG8PeMiZYN15O2eP1DfYTB or better yet, if you don't want to get stuck in a playlist, my channel is: kzread.infovideos
Seemed weird that you went from: (2:40) _thirty two_ _sixty four_ _eighty_ then: _one two eight_ _two five six_ _five one two_ You kinda sounded like a text to speech algorithm that hadn't yet been programmed for 3 digit numbers! ;-P
@klaxoncow
3 жыл бұрын
Isn't that how everyone counts the powers of two? Like, when the Commodore 128 came out, no-one ever called it "the Commodore one hundred and twenty eight". It's the "one two eight", right?
@ElmerFuddGun
3 жыл бұрын
@@klaxoncow - Hmmm... I never had a Commodore but I think most, in Canada at least, would have said "Commodore one twenty eight". Maybe it varies by country.
Congratulations on another exemplary video. I think this one really struck a sympathetic chord with your audience, judging by the boatload of comments that have been sent in response. I found these comments to be both interesting and informative. This video and the comments it generated inspire me to continue educating myself in regards to computers. Many thanks to you and all those who participate at this site. :-)
I have fond memories of my dad and me watching "about modern computers" back in '75. That's why I studied CS and still enjoy working in the industry. Thanks for yet another exiting episode of ExplainingComputers.
Your animations and explanations have been brilliant for 14 years! Thank you thank you!
@ExplainingComputers
3 жыл бұрын
Wow, thanks!
Super! I'm just starting to learn computers and this was very helpful. Loved the side-by-side comparison to assembly language. Thanks!
ExplainingComputers quite literally explaining computers. Keep it up!
It's not easy to explain how a CPU works in such a short video, but Chris did it really, really good!
That was a brilliant overview with just the right level of detail for your audience.
@ExplainingComputers
3 жыл бұрын
Thanks :)
Brings back memories of learning assembler for the 8080 back in tech school. It was 1986 and I also had applied calculus that semester. It really made my brain hurt or maybe that was all the partying on the weekends. Probably a little of both. Great video. Love your content.
You have refreshed my Tech programming class. I learned assembly language for the 8086 and wrote a basic program to run a traffic light. Thanks!!!
@Jimwill01
3 жыл бұрын
Self taught on an 1802, I wrote a 4 function calculator in assembly.
Wow, great video with a lot of insight to the evolution of past, present and future CPU architecture
High quality contents as usual. Very clear explanations. Will you make a video explaining how a compiler works? :)
As always, clearer than other explanations. Thank you.
Wow you explain softwares, operating systems, hardware you clear everything hats off😀 Thanks
Such unique content! I would love to see more of that.
Thank you for a terrific explanation of this topic Christopher! Great level of detail. I'll be using this as a resource for my high school computer science courses. Thank you again for your great work. Best wishes, Gord
@ExplainingComputers
3 жыл бұрын
Thanks. :)
Please do more. I'm in the process of learning and re-learning this information. I'm in the process of not just learning this, but I have some ideas for my own tech.
I learn something new every Sunday. Thanks Chris.
Great video, would love to see similar videos for other hardware parts.
This was wonderfully educational. Each component mentioned in this docket could have an instructional video itself.
ty for every video pal! your videos are awesome and very well put together 🎅👍
@ExplainingComputers
2 жыл бұрын
Thanks!
Excellent and thorough explanation - thank you !
My first real introduction to basic programming (please excuse that pun) was with my Commodore Vic-20, then my Commodore 64. A much simpler time. Thanks for another trip down memory lane.
That was a great explanation. As usual thanks so much for the great content.
Super job, Chris. Thanks very much.
Excellent Video!!!! These are the things we all take for granted. "It's allot of work." Thank you!
Been taking IT classes your videos have been helping a lot
Enjoyed very much. Yes, please do make more videos explaining the workings of other PC components.
My dad once asked me what a CPU does. I told him to think of it as a tiny Amazon warehouse. Boxes get taken of shelves, opened, repacked into other boxes and shacked on other shelves. Boxes come in, boxes go out. He was happy with that. 😆
@ElmerFuddGun
3 жыл бұрын
What is the CPU equivalent of Amazon boxes getting stolen after delivery? Bad RAM maybe? ;-)
@JB52520
3 жыл бұрын
@@ElmerFuddGun Lost network packets?
@binarybox.binarybox
3 жыл бұрын
A good analogy.
@cholesterol6703
3 жыл бұрын
@@ElmerFuddGun Cosmic rays randomly nuking a value in RAM. Not that the RAM is bad, just that the information was made useless. But this would really be more like a random act of finding your package on your porch, shaking the package so hard that it breaks something inside, and then leaving without a trace and the box still intact on your porch. Only hidden damage.
@smada36
3 жыл бұрын
@@ElmerFuddGun Spectre and Meltdown? Although, I guess that is employee theft. 😆
Thanks for yet another educational video. I'd like the next one to explain PC monitors, and what to look out for when buying a new one.
@ExplainingComputers
3 жыл бұрын
Thanks for the monitor idea, noted.
New subscriber and thanks for making these informative videos. I'm not an engineer and these videos help since I want to learn about technology more. I would love to see more basics of circuitry or on electronic engineering too.
These videos, are so informative.Thanks a lot for this.
Thank you for the video. I'm sharing this with my high school students in a computer hardware course.
@ExplainingComputers
Жыл бұрын
Thanks for sharing!
Good afternoon here in the United States. Just wanted to let you know that I love your channel and your videos. I'm a PC enthusiast always looking to learn deeper as to how computers work and your channel is perfect for it. Thank you for the education!
@ExplainingComputers
3 жыл бұрын
Thanks for watching. :)
Great video Christopher! I know this is months after you originally did this video, yet at first I was confused with the ALU and the FPU, (Math Coprocessor), and had to look that up. The Math Coprocessor used to be an extra chip one could get with the the 8086-486 CPU's, since the Pentium the FPU is within the CPU.
Excellent explanation - thank you! Now for pipelines, RISC, prefetching, stacks ....
This is very straightforwards, thank you
ur unique for ur outro alone. i love it sir. thank you!
What a great video , thanks Chris
I love such basic explanation videos.
I enjoyed this a lot, thank you.
Was waitting for this 😊
This was awesome, keep it up
Very insightful teaching. Thank you.
This was an incredible video. Quality programming.
Keep doing the excellent work!!!!!!!
Nice topic!!! For more videos like this.
Great video as always. What an amazing channel.
@ExplainingComputers
3 жыл бұрын
Thanks.
Yes, very good! I still remember my class in Computer Architecture! Very good video. Yes, make others about other hardware parts like keyboard, mouse etc...
1:11 thanks for sharing the name of the arch. P.S. i really like the youtube's queue feature introduced last year. makes watching videos so much more productive/less hessly than before.
Thank you for the video. You make me smarter. Best wishes.
As ALWAYS quality stuff love your stuff
Sunday morning master class! Thanks!
Great video, Chris! Ben Eater has nice set of videos on building a computer on breadboard. And low level programming of 6502.
Thanks Chris for a good solid explanation. I built an IMSAI computer about 1976 - 1978 from a kit (Altair was the most popular) prior to the Apple II. It was big and had 4k memory boards with lots of chips all hand soldered. You programmed it with front panel switches, so pleased to add an optical tape reader. Sold it to a fellow ham. Met Gates and Allen at a Walla Walla hamfest hawking BASIC shortly thereafter....
Very concise informations!
Oh Christopher, your video is great as always. The only "error" I found in your video is that you said you explained it as simply as possible. But I argue that J. Clark Scott explained it even simpler in his book "But how do it know". He did make his own fully working architecture and processor for the purpose of explaining it in the book, because he explains every part of the whole processor down to the transistor level, and didn't want to infringe on a companys IP. He does so with the intention that anyone who is literate can understand the whole book. And I argue that he does so successfully. It is not a terribly long book, and it is written almost as a page turner. Every one should read it once a year, and it is cheap.
Good explanation. Of course even the CPU has microcode that tells it what to do when the instruction says the binary equivalent of "mov %r12, (%r10)". Your code told it WHAT to do, and the microcode makes it DO exactly that. The microcode is fixed in the CPU hardware...all those little transistors and can't be changed. What writer was it who said "even the parasites have parasites" or something like that. I, too, started by writing assembler code for a Z80 and later the 8008 and later the 8086/8088. Prior to that, I wrote machine code for a Gerber plotter...no compiler at first. It took forever to load in all the 1's and 0's. Eventually we bought an APT (look it up) compiler and we really felt like we were "eating high on the hog"! It was very Fortran-like, and was the beginning of Computer Aided Manufacturing, CAM. As usual, I enjoyed your taking us down memory lane.
Awesome video! It reminds me of the very first computer that I used back in the mid-80s, the Tandy Radio Shack TRS-80 Model 3 which was also powered by the Z-80 chip with the clock speed of just 2 Megahertz. That computer had tiny 48 Kilobytes of main memory and used TRSDOS as it's operating system. It had two 5 1/4 inch floppy disk drives but no hard disk. Since it didn't use any operating system with GUI or graphical user interface, it also had no need for a mouse pointer.
@ExplainingComputers
2 жыл бұрын
Thanks Gerry. I never used a TRS-80, but looked at them in window of the store on many, many occasions. :)
Thanks you, I enjoyed this episode very much. I would like to request that you do some segments on microcontrollers such as the Adafruit CLUE and the BBC Microbit.
Very interesting and informative topic... specially that running program part was informative..need to watch that part again...😀
Great video, thanks!
Thank you Chris!!! You're an amazing person :)
Ironically, just last night I watched the 8-bit Guy's video on machine language, which made this video a bit easier to understand. Great timing!
Very nicely explained, thanks! The Z80 was also the first CPU for which I learned coding assembler. I can't decide if I like it more than the 6502, though. They have very different and interesting philosophies.
Excellent job!
Thank you for your excellent presentation
that was a very complete explanation Sir. Barnatt.
Very well done.
Very good explanation.
Excellent video.
My first bash at assembly language was on a 6502 on a BBC micro. Not many registers on that to play with! Also 6502 used on the Atari 2600 and derivatives. Great video Chris, a real nostalgia blast - thanks! - It would be interesting for us if you could do a video on GPUs and explain how they work and cover things like accelerators and such like.
Awesome Chris!
Yup the good old Z80 and Z80A. I started there too. Thanks for this simplified explanation of this complex topic.
Very informative, very well presented :-)
Very nice introduction to Assembly in the section "Running Programs"
@ExplainingComputers
3 жыл бұрын
Thanks.
Excellent!! Many thanks. My first computer was a ZX81. I progressed to the BBC Micro and 6502 assembler. It was my hoby but enabled me to earn a good living after leaving the RAF.
Thanks a lot, Chris. Easy to understand as always. Sorry, sometimes I feel like a lazy student. I would like to know more about GPU's and why they are used in high level calculations.
I just ❤ that you went to the Z80 for simplification, Chris 👍
Super video ! Thank you !
In my day, back in the 1960s the process of converting assembly language mnemonics to binary was NOT compile but the ASSEMBLE process. Compile was reserved for high level language translation first to assembly language then that assembly intermediate code assembled to machine language.
@simonknights7526
3 жыл бұрын
I was coding IBM 370/Assembly language until the early 2000s - and it was the Assembler that converted that to machine code. Compilers are for high level languages (in my case Fortran). I'm not aware that the nomenclature has changed. And then, of course, Interpreters for interpreted languages.
@ExplainingComputers
3 жыл бұрын
A compiler is a program that converts code in one language into another, and the definition has not changed. Yes, machine code compilers could and have been called assemblers. But they are still also compilers.
@tonydyer2919
3 жыл бұрын
@@ExplainingComputers Wikipedia agree with my understanding of the terminology,
@tpobrienjr
3 жыл бұрын
@@tonydyer2919 Wikipedia can be fixed (although I agree with both of you).
@MRCAGR1
3 жыл бұрын
The older compilers took two or three passes to complete the task. High level language into intermediate code or assembly language and finally linked into a file that can be loaded. The UCSD system stopped at the intermediate code (p code) which was down loaded and executed by a virtual p-machine which was independent of the processor type.
I've dabbled a bit in comparing the primary differences between various Chip types (SOCs, CPUs, NPUs, APUs etc.) however having a video describing the major contrasts and similarities from you on this topic would be very helpful.