And away we go with another season of three computer-science videos! A whole team made this happen: pull down the description for all the details! And thanks to Dashlane for sponsoring: you can find more about them at www.dashlane.com/tomscott
Tom Scott The original rollercoaster tycoon (and I think maybe the second one too) was coded in assembly by only one guy. More impressive than the prince of Persia if I might say.
@Steve Mclean That my fellow human is no "just snapping fingers".. that is something different entirely. It is hyper cybersnap or even Thanos level snapping indeed. I will still hear it when I wake up tomorrow.
For many years, the ZSNES emulator for Super Nintendo (Super Famicom) was also programmed in assembly. This is why you could play SNES games on a Pentium 166. It wasn't until many years later, when the devs decided to open source it, it was converted to Cpp.
so anyway I played with a program called Logisim that simulate the fundamental components of the computer like the logic gates and such. I still can't wrap my head around this process
it's the same when you get assignments in school: - you're having math and open your textbook - your teacher tells you what chapter you have to work on - you open your textbook to the chapter you have to work on, and load all the assignments inside this chapter into your memory - every asssignment you do, you fetch the question, decode it (think about the answer and the steps you're taking towards it), and execute it. - you write down your answer into your memory, and next to the assigment. - when you finish your assignments, and have them checked by the teacher, and the teacher tells you it's okay, you (try) release it from memory load -> [fetch -> decode -> execute (loop till finished)] -> release
@@MaryamKamaly08 What parts of it did you guys find confusing? CPU/OS and networking are two of my most favourite CS topics alongside AI, so maybe I can point you to some more in-depth instructional material if you want.
I've recently found a game online called "Turing Complete" that models this sorta CPU in the late game, and you build it from the ground up using logic gates, I figure someone might find it cool too.
there is a similar thing called nandgame, its very nice, it doesnt give any hints you completely figure out how computers work yourself, though it does do conversion of binary to decimal for you for some components like adders or stuff
Evidently, Rollercoaster Tycoon was also done in Assembly and that's why they were able to milk the hardware for every last ounce of performance they could get.
Wait until you hear about how Pong was made. They literally hooked up the transistors by hand, no coding or keyboard involved, just straight up messing with the hardware itself.
Fun fact, the original rollercoaster tycoon was also written completely in assembly. Which is why the game runs at interactive rates even on an old Pentium II even with 1000s of guests in your park and lots of animations. It was optimized like crazy. It's by far the largest game I can think of that was still written in assembly.
i have written a simplified version of chess in Assembly. Hearing Rollercoaster Tycoon was written like that makes me want to cry. And hug the person / all the people involved, forever. They need it.
Computer Engineering here but I had a course exactly on this (but in waaay more detail) two semesters ago. I could see this video being shown at the start
On of my CS assignements in college actually was to code something (very small) in binary. Gives one a great appreciation of what's happening under the hood!
unrelated to the video subject but just wanted to say that I REALLY appreciate the production quality of this. The lighting, colors, and lens choice all look fantastic.
Modern CPUs have also register renaming, speculative execution and branch predection. Those are interesting but really complex things that allow CPUs to run as fast as they actually do.
The snapping sound comes from when your middle finger hits the meaty part of your hand where your thumb is connected. The trick is to stop your middle finger from moving with your thumb, and then let it go.
I have watched about 13 well made videos from different instructors and youtubers on explaining this cycle. I didn't understand any of them. And then here comes Tom with this no brainer approach to explaining the cycle, and I was able to follow along and fully understand what this all meant. Now I can get back to my homework with a clearer sense of the process. Thank you for this explanation!
Awesome explanation. I've recently started learning the ins and outs of hardware, as well as trying to get a basic understanding of Javascript. As I've been learning, I've found myself wondering on more than one occasion how modern day programming languages are able to translate something that is comprehensive to the average English speaker into a series of ones and zeroes that a computer can interpret. This video gets me one step closer in that understanding. Thanks Tom, your channel is as educational as it is entertaining.
roller coaster tycoon is an amazing complex game that was coded like 99% in assembly, with just a bit of C to help make it open and run. It is insane how a game that complex could be written like that but by being coded that way the game ran amazingly with thousands of animations and park guests on screen at the same time, even on old computers.
That's the advantage of giving the hardware something it can natively read without converting it into assembly. I wonder how newer games would run if they were coded in assembly.
@@renakunisaki You can reprogram it by what we call "installing Linux", although MS is getting deals with computer sellers to lock the BIOS if they want to run Windows, they still didn't get very far with that.
This video, in seven minutes, explained more to me about how a computer works than my two failed years as a computer scrivener major. Everything at school was assumed. They assumed you knew this stuff. I didn’t, but now I do. Thank you, Tom.
I appreciate the correction of "programme" to "program". When I was a kid, I remember reading somewhere (probably in one of Usborne's many '80s-'90s computer books) that "computer program" is the only context in which we in the UK use the American spelling of the word. But over the years, I've come across more and more people using the UK spelling "programme" to refer to computer applications, to the point where I've wondered if I was misinformed by those books as a kid and it was never a rule at all!
Last year, I took a computational systems class at my university and we learned this in much more detail. It really blows your mind, knowing about all those details.
This video was so well made!! This is such a clean and clear explanation and this is exactly how the simulated computer I built works.. The only thing you missed is that you were showing an assembly language on screen during your demonstration the entire time.
Fetch, decode, execute. Fetch, decode, execute....... -> an iPod, a phone, an Internet communicator...... That just came to my mind. But really understandable explanation of a simple computer. Thanks Tom.
This was awesome! I searched high and low for a visual representation of this for my CompSci class as I'm a teacher. I've used this 2 years straight now.
this is one of the fundamental questions that i had when i started learning about computers - how... EXACTLY... does manipulating bits with logic actually draw something to the screen. i think you can continue with on with this series by continuing to break that down. so right now, you say that the reason a computer can do things like play games and videos is speed... but that answer is kind of an abstraction too. you can break it down further: - how does jump or add translate into ands and ors - trace sequence of events from fetch/decode/execute to one pixel getting drawn to screen, or one sound being played, etc... great video!
Having done IT for years now (12 years and counting (after school time that is)) both professionally and not, this is still a great video! It might seem simple but the ammount of things that clicked for me made me realise why some issues kept creeping up. Great work!
This immediately took me back to Assembly class. That's not a place I ever wanted to go back to. Really awesome video though Tom! It's cool to see this stuff being explained really simply (and visually) so people outside of our field, or just joining it, can learn easily.
I have been following you for years, watching your videos about everything from cool stories about geography, games... Last year I started studying computer science, and tomorrow I have a test on computer structure. I had no clue on the fetch decode execute cycle, and was desperately looking for something on youtube (as one does). I saw your face and was inmediately relieved, as your narrating skills would make me get it instantly. You have saved a fellow computer scientist my friend.
Having just finished watching Ben Eater's breadboard computer build, this is a nice abstraction to add to the detailed electronics. Thank you for putting it together!
@@bananya6020 ok here is a mindblower atleast it was for me : the sound doesn't come from the snap itself but from your middle finger after the snap hitting on your hand.
Excellent video! I talked about this cycle with my computer students today and one of them showed me your explanation. Great! That's why I always have the same answer when someone tells me: "Oh, my PC is frozen" - "Impossible: computers never freeze." ;)
The CPU/snapping fingers nailed it! I think the next question someone would ask is how does it know that each step in the cycle was performed? It would be neat to show a ready status letting it know it's done therefore it can continue forward with the right "side" of the next clock cycle and avoid glitches.
I think short answer is that it doesn't typically "know", at least not at this level. Electricity is very fast but of course that with very fast clocks, the logic can get all tangled up. So engineers run simulations on their models to make sure that the logic behaves properly up until a certain clock frequency. Some instructions might also need more than one clock cycle to be completed. Also some logic blocks on the chip might need slower clocks (or simply not need a very fast clock -> a fast clock consumes more energy, so it is avoided if possible). In that case the clock is divided and distributed throughout the chip. When you can't easily predict the path of information or logic, you can also have some sort of "handshake" mechanism between devices, so they know when they are ready, just as you mentioned. It's very complex but very interesting!
My masters degree used a different type of paradigm in terms of an instruction set. There was only one instruction: move. Rather than an ALU - arithmetic logic unit - there was custom functional units - FUs - much like using ASICs. All you did was move the data to the inputs on these FUs and retrieve the result when required - after a certain number of clock cycles depending on complexity. I investigated biological mechanisms in this paradigm. What would happen if an FU is defective - could you replicate its functionality using less complex FUs at a sacrifice of more computing time. (Such as using an addition FU multiple times instead of a multiplication unit). Great video as usual Tom! PS. It’s Program Counter
Don't even need special FUs, Have you seen "mov is Turing complete" aka the movfuscator? It's a single instruction c compiler that compiles to a huge long list of MOV instructions.
Daniel Wallace the use of FUs was mainly for the biological mechanisms aspect. I didn’t realise there was a C compiler, so that’s very interesting. The processor itself was implemented using VHDL and the Xilinx suite. (This includes any FUs that I used for demonstration purposes)
Louai Al-Obaidi @Master Mati Thank you for the interest. I haven’t really spoken about my thesis in ages. The processor itself was written in VHDL. The MOVE paradigm is very good in application specific circumstances. Therefore my assumption throughout the thesis was that there would be arrays of application specific microprocessors. (Rather than those that are general purpose) - and fault tolerances that could be provided.
4:30 "every sixth clock cycle" - Actually it is every ninth, because in your demonstration there are three instructions in the loop each using 3 clock cycles.
I got lecture for 1 and 1/2 hr for this topic (Computer Organization and Architecture) Simple As Possible -1 , I only understand a little from it. This video helps alot. This video should be shown to people who is curently learning COA for easier understanding. Great video!
I'd would instead say that it's totally not RISC-y. That's because RISC CPUs always operate on registers and only contain commands to compute values between two registers. Non-RISC CPUs have commands to directly operate using memory addresses.
I knew this already on a deeper level but I have to say this was the simplest explanation of a CPU cycle I've ever heard. Great job on that one. If people want a bit more details then search for The Computer Science crash course by PBS on youtube, still superficial but very informative and it changes the view of computers in general.
Very concise and comprehensive. Even though I am familiar with this topic, I wanted to watch it from a "teaching-it" point of view. One of the best explanations of this topic that I have encountered. Also, that ad description for dashlane you are giving at the end...is really good! Even though I am a Keepass fan, you got me interested! You are really good in presentations!
The animation cycles in Prince of Persia versus the outline of the back of someone's head and a text box announcing what was and was not super-effective... I'm going with Prince of Persia on the 'impressive' front.
you think assembly is impressive? in space race by atari there wasn't any memory chip, so half of the picture of the ship was stored in a bunch of diodes connected to wires and it was then mirrored. there aren't any instructions, the main board is a bunch of logic gates, timers and flip-flops that do stuff based on the inputs and the state of the counters. the score is displayed by counting the lines and the columns, and using a bcd to 7 segment decoder a few and gates decide whether the current position is a segment or not, and an additional and gate checks if it should be showing the pixel on or off. tl;dr: there is still a game, but there aren't any instructions, nor processor*, the clock is still there though. * one could argue that a bunch of logic gates that processes input is a form of processor and a few flip-flops and counters is memory (ram), and the diodes in a grid is rom.
WOAHHHHH!!!! I understand the fetch decode execute cycle much much better now!!! All my concepts relating to this topic are crystal clear...THANKS!!! You deserve a sub!
Yet another demonstration of how terrible my highschool CS course is. It took them three lessons to teach people the basics of Python, while I instead taught it to myself in an afternoon using the Internet. It took them a week to teach us numeric conversions, which I already knew from RUclips. And it took them a week to (very poorly) teach the content of this video, while this video is only nine minutes long. School: 0 | Internet: 3
I have dashlane and it's not the cheapest option but it is very good. Before dashlane, I used KeePass (today I would probably use KeePassXC though.) I like the extra features dashlane offers so it's worth the cost for me personally but you may have other priorities.
I barely understand anything but I understand enough to appreciate how complex computers are. They’re a whole different creature! Almost alien, with their own language and parts helping it decode and get things done. Scary and intriguing!
6:55 If you have been techy enough to stay that long until the dashlane ad you should know that there are alternatives. There is KeePass as an opensource alternative which you can carry on an usb or sync via your trusted cloud service. Or you can just run it locally. There is also googles passwordmanager for "free" when using chrome and android Leave your alternatives in the comments as well :)
I imagine the point is that the code can be ported and compiled on different architectures. Sure modern macs use Intel processors now, but the point might be missed if the comparison was between Intel based and say for instance ARM based.
I call this the FE-D-EX Cycle, made up the acronym when I was studying for a computer hardware exam, never failed me , I also made the acronym Why-ow-est-lan-sysfun-doc which is for finding out a problem of a computer, figuring out how to fix it, test solution, plan the fix, test system functionality, and finally document the solution.
In case someone wants to learn sort-of assembly language (very close to it anyway) for fun, i'd recommend "shenzhen IO". It's quite niche as a game, but quite interesting if you are into that sort of thing. Comes with manuals of course. Skills learned in that game might actually be useful if you end up in electronics industry.
Silicon Zeroes is a great puzzle game for understanding how things like CPU, registers, and RAM work, as it has you building your own simple computers by dragging together individual pieces like clocks and adders. Also, TIS-100 is a slightly more simple take on assembly-style coding, still from the Shenzen devs.
Very nice explanation! My informatics teacher at school actually wrote a virtual machine (for DOS) with it's own simple assembler language and some simulated IO to display text that allowed us students to step through the code and see what actually happens on the CPU. Damn, my informatics teacher was awesome! I owe him a great debt to this day!
Programme Counter? Or Program Counter? Discuss... Imho, always thought a "programme" was a piece of content sent over a medium, eg a BBC Television Programme.
And away we go with another season of three computer-science videos! A whole team made this happen: pull down the description for all the details! And thanks to Dashlane for sponsoring: you can find more about them at www.dashlane.com/tomscott
Why is your comment is a week old? I mean I know how but why?
@@smug_slime same
???????
Tom Scott The original rollercoaster tycoon (and I think maybe the second one too) was coded in assembly by only one guy. More impressive than the prince of Persia if I might say.
Bruh
You literally just made this so you could flex on us with your Thanos tier snapping, I see you.
I thought the comments will be referring Bono, alas, times have changed.
@@vaclav_fejt wasn't bono clapping instead of snapping?
@@gallavanting2041 Oh yes, you're right. My bad.
He’s just snapping his fingers
@Steve Mclean That my fellow human is no "just snapping fingers".. that is something different entirely. It is hyper cybersnap or even Thanos level snapping indeed. I will still hear it when I wake up tomorrow.
Rollercoaster Tycoon was also programmed in assembly, which is why it runs so amazingly and was so outstanding technologically at the time
damn I used to love drowning people there
I learned this in my Assembly course last semester, and having used Assembly, I'd never in a million years do anything like that, no thank you.
wow
NBA Jam too, apparently.
For many years, the ZSNES emulator for Super Nintendo (Super Famicom) was also programmed in assembly. This is why you could play SNES games on a Pentium 166. It wasn't until many years later, when the devs decided to open source it, it was converted to Cpp.
Geez, that's a strong snap!
Indeed
Indeed
Indeed
Indeed
Indeed
I will never hate the fact that even in a video as simplified, streamlined and clear as this one... I still cannot wrap my head around this process...
so anyway I played with a program called Logisim that simulate the fundamental components of the computer like the logic gates and such.
I still can't wrap my head around this process
If you fail at a CS exam about this subject and have to study for the finals it's much easier to learn this process
This and networks are something ill never understand in computer science
it's the same when you get assignments in school:
- you're having math and open your textbook
- your teacher tells you what chapter you have to work on
- you open your textbook to the chapter you have to work on, and load all the assignments inside this chapter into your memory
- every asssignment you do, you fetch the question, decode it (think about the answer and the steps you're taking towards it), and execute it.
- you write down your answer into your memory, and next to the assigment.
- when you finish your assignments, and have them checked by the teacher, and the teacher tells you it's okay, you (try) release it from memory
load -> [fetch -> decode -> execute (loop till finished)] -> release
@@MaryamKamaly08 What parts of it did you guys find confusing? CPU/OS and networking are two of my most favourite CS topics alongside AI, so maybe I can point you to some more in-depth instructional material if you want.
I've recently found a game online called "Turing Complete" that models this sorta CPU in the late game, and you build it from the ground up using logic gates, I figure someone might find it cool too.
there is a similar thing called nandgame, its very nice, it doesnt give any hints you completely figure out how computers work yourself, though it does do conversion of binary to decimal for you for some components like adders or stuff
Thanks
Hey thanks for sharing :)
I just started playing Turing Complete today! what a coincidence. such a cool game :)
We did that with logisim as a final lab assignment in one of the courses in my CS programme some time ago. Fascinating stuff!
So every computer has a billion tiny Tom's, snapping their fingers in synchronicity.... Neat!
Technically, it actually has only one Tom and a massive speaker network that transfers the snap
@@mynewaccount2361 how about multi-core processors?
@@Calebe311 Tom has more limbs for more hands to snap more
*Toms
r/meirl
4:21 I love how your snapping is totally in sync with the Lights in the Backround
Maybe they hooked the computer up in a way that a clock cycle happens every time a loud sound occurs
@@laurinneff4304 could be
Didn't notice that!
@@laurinneff4304 if that were the case the lights would always be in sync with his snaps
I can't imagine writing an entire game in assembly, hats off to the people who did that.
Evidently, Rollercoaster Tycoon was also done in Assembly and that's why they were able to milk the hardware for every last ounce of performance they could get.
It really depends on what you're doing and why you're doing it
Yes the fact that super mario bross 1 and 3 and all ness games had been written in assembly language blows my mind!!!
Wait until you hear about how Pong was made. They literally hooked up the transistors by hand, no coding or keyboard involved, just straight up messing with the hardware itself.
writing in assembly is not that hard, it is just that you have to do the same things a lot of times
It will never not surprise me to relearn that CPU isn't actually just short for "ComPUter".
Ofc not they would just use comp for that 🤣
Are you dumb?
How doesnt "Central Prosessing Unit" make more sense?
@@JohnDoe-pz4nk it's a joke you troglodyte
@@JohnDoe-pz4nk Who hurt you?
who thinks CPU is short for ComPUter😂
Fun fact, the original rollercoaster tycoon was also written completely in assembly. Which is why the game runs at interactive rates even on an old Pentium II even with 1000s of guests in your park and lots of animations. It was optimized like crazy. It's by far the largest game I can think of that was still written in assembly.
iirc it was made by 1 person too.
i have written a simplified version of chess in Assembly.
Hearing Rollercoaster Tycoon was written like that makes me want to cry.
And hug the person / all the people involved, forever.
They need it.
2 minutes in and I can already tell that this video will be shown in every GCSE Computer Science classroom for the remainder of human existence.
Computer Engineering here but I had a course exactly on this (but in waaay more detail) two semesters ago. I could see this video being shown at the start
This video condensed about 50 pages of my old textbook into less than 7 minutes. And was more understandable.
@@kumquatery textbooks exist not to teach but to keep the riffraff out
Such a shame had just finished mine when this came out
Already watched it
A Tom Scott video that last for longer than 5 minutes??? Impossible.
Addah r This is blasphemy!
Citation Needed and other game shows are quietly crying in a corner.
Well, ~3 minutes of it are an ad
My brain started hurting after only 2.30 mins.
*10 hours of garlic bread footage cries alone*
I have a completely different mental image of a Snapdragon now.
😂😂😂 underrated comment
Wahey !
👏👏👏
Up you go, remember me when you're top comment
rated comment
On of my CS assignements in college actually was to code something (very small) in binary. Gives one a great appreciation of what's happening under the hood!
unrelated to the video subject but just wanted to say that I REALLY appreciate the production quality of this. The lighting, colors, and lens choice all look fantastic.
4:41 Tom's CPU overclocks to about 3.6 Hz.
PS - Thanks for this helpful introductory video! I did not know the fetch-decode-execute sequence.
Now just imagine a billion Tom Scotts snapping their fingers like that and it's a modern day CPU!
3.6Hz. Not great, not terrible
@@MrCrininer and you need at least 4 of those to equal a modern CPU.
Modern CPUs have also register renaming, speculative execution and branch predection. Those are interesting but really complex things that allow CPUs to run as fast as they actually do.
@@Byefriendo Its not 3.6 Hz. Its 15 MHz.
Very educational, I'm searching finger snapping tips now.
I can't even snap my fingers
@Clorox Bleach try to tense up the bit your middlefinger hits with your ringfinger
The snapping sound comes from when your middle finger hits the meaty part of your hand where your thumb is connected.
The trick is to stop your middle finger from moving with your thumb, and then let it go.
@@themennissvids now i get to understand it thanks buddy i can snap my fingers in exam and teachers can sing along with me fetch decode execute
Here's a tip: smear your fingers in wood sap. makes clicking so much easier.
i feel like tom is flexing on me with those snaps
I feel like those snaps were prerecorded and then added in post in order to get a crisp consistent sound
@@bestpseudonym1693 don't be daft.
@@bestpseudonym1693 It wasn't actually all that consistent.
I have watched about 13 well made videos from different instructors and youtubers on explaining this cycle. I didn't understand any of them. And then here comes Tom with this no brainer approach to explaining the cycle, and I was able to follow along and fully understand what this all meant. Now I can get back to my homework with a clearer sense of the process. Thank you for this explanation!
Awesome explanation. I've recently started learning the ins and outs of hardware, as well as trying to get a basic understanding of Javascript. As I've been learning, I've found myself wondering on more than one occasion how modern day programming languages are able to translate something that is comprehensive to the average English speaker into a series of ones and zeroes that a computer can interpret. This video gets me one step closer in that understanding. Thanks Tom, your channel is as educational as it is entertaining.
Was that a real snapping sound at 0:55? If so, that was the most satisfying snap I've ever heard.
It’s like the Nintendo switch snap
Thanos will be proud
Wearing a red t-shirt, you could call him a red snapper ( ͡° ͜ʖ ͡° )
Top 10 snaps thanos was afraid to diss
Sounds real enough to me
roller coaster tycoon is an amazing complex game that was coded like 99% in assembly, with just a bit of C to help make it open and run. It is insane how a game that complex could be written like that but by being coded that way the game ran amazingly with thousands of animations and park guests on screen at the same time, even on old computers.
One of the best games, played it so much in my childhood.
Nearly every NES, SNES, Genesis, Game Gear, Game Boy, C64, Atari, Amiga... game is made in assembly!
That's the advantage of giving the hardware something it can natively read without converting it into assembly. I wonder how newer games would run if they were coded in assembly.
@@9000888sora Probably slower, computers are much better than humans at optimising code most of the time.
I think steve wozniak wrote the apple II's monitor in machine language.
“What’s your computer actually doing?” Is something I’m more used to my professor asking me tbh
Terrorshark Answer: “A lot of redundant work. It’s running JavaScript on the web
Playing MiniClip online games , on tinder , online betting and watching Japanese foreign language cartoons ? Haha
@@timhuggins1993 Isn't "Japanese foreign language" tautological?
@@markmayonnaise1163 I don't think it is? It's redundant either way, so it's not like it matters.
Fantastic explanation. I wish this was around when I was trying to learn the same thing from a book for GCSE computing.
I'm not sure what sort of cooler to use when overclocking my Tom Scott, there's no mounting brackets and I don't think he's rated for LN2
A 7 minute video with 0 cuts during the main content. Very cool.
Harry Smith Tom is very good at hiding cuts so there might be some hidden ones
@@battmarn he's also RUclips's one-take wonder, so it could be either way.
The guy rarely cuts. He's the one take champ
If you're running Windows 10, from my experience it's doing whatever the hell it wants to.
Or whatever microsoft wants it to do. Some days I wonder who actually owns the computer
*YOUR PC NEEDS TO RESTART TO FINISH UPDATING*
@@sheepsfeather3159 if you can't open it, copy it, or reprogram it, you don't own it. MS is pushing to prevent all three.
@@renakunisaki Well, it has always been true for Windows, that's why we call that a proprietary os.
@@renakunisaki You can reprogram it by what we call "installing Linux", although MS is getting deals with computer sellers to lock the BIOS if they want to run Windows, they still didn't get very far with that.
This video, in seven minutes, explained more to me about how a computer works than my two failed years as a computer scrivener major. Everything at school was assumed. They assumed you knew this stuff. I didn’t, but now I do. Thank you, Tom.
1:18 "It doesn't matter when, or in what order, the memory is written"
If only.
For synchronization, sure, but it’s opposed to sequential-access memory.
I appreciate the correction of "programme" to "program". When I was a kid, I remember reading somewhere (probably in one of Usborne's many '80s-'90s computer books) that "computer program" is the only context in which we in the UK use the American spelling of the word.
But over the years, I've come across more and more people using the UK spelling "programme" to refer to computer applications, to the point where I've wondered if I was misinformed by those books as a kid and it was never a rule at all!
This is incredibly well done, how things worked at the lowest levels always baffled me. Thanks.
Last year, I took a computational systems class at my university and we learned this in much more detail. It really blows your mind, knowing about all those details.
Who else just kept rewinding to 0:54 over and over because they were distracted by those snaps? Those were quality snaps.
Boom, snapstracted.
This video was so well made!! This is such a clean and clear explanation and this is exactly how the simulated computer I built works.. The only thing you missed is that you were showing an assembly language on screen during your demonstration the entire time.
Fetch, decode, execute. Fetch, decode, execute....... -> an iPod, a phone, an Internet communicator......
That just came to my mind. But really understandable explanation of a simple computer. Thanks Tom.
My computer is transmitting heat into my room.
So is mine, and there's already an unhealthy surplus outside... 🥵
Still running a Pentium 4?
@@mrflamewars I don't think a Pentium 4 has quite the TDP necessary to act as a space heater...
@@lfox02 The Prescott core p4s earned the name "Preshott"
Who needs a heater in Winter when your computer does the same?
As an IT pro I knew all of this going in, but the way you explain things is so wonderful to watch it had me hooked till the end.
This was awesome! I searched high and low for a visual representation of this for my CompSci class as I'm a teacher. I've used this 2 years straight now.
1:00 - the smile when u know what something is going to look like in effects, but you're doing it to nothing
You impress me every time in with in how little shots/takes you do your entire video!
>Tom writes 2 instead of 10
*Confused Engineer Noises*
Hex ;)
Close enough
@Xyre154 Mathmaticians: "Did you mean 2^8-1?"
@Xyre154 Me: what
Enfinwers dont make confused noises they are smart peole they are going to save the world
Love the explanation! I remember the times when we HAD to understand all this to be able to do magic with our computers.
this is one of the fundamental questions that i had when i started learning about computers - how... EXACTLY... does manipulating bits with logic actually draw something to the screen.
i think you can continue with on with this series by continuing to break that down. so right now, you say that the reason a computer can do things like play games and videos is speed... but that answer is kind of an abstraction too.
you can break it down further:
- how does jump or add translate into ands and ors
- trace sequence of events from fetch/decode/execute to one pixel getting drawn to screen, or one sound being played, etc...
great video!
I like how you simplified the loop, thank you for your time and effort to produce a great video!
Having done IT for years now (12 years and counting (after school time that is)) both professionally and not, this is still a great video! It might seem simple but the ammount of things that clicked for me made me realise why some issues kept creeping up. Great work!
This immediately took me back to Assembly class. That's not a place I ever wanted to go back to. Really awesome video though Tom! It's cool to see this stuff being explained really simply (and visually) so people outside of our field, or just joining it, can learn easily.
This summed up two of my computer science lessons. Except I actually understood everything this time, best explanation ever! :)
I have been following you for years, watching your videos about everything from cool stories about geography, games... Last year I started studying computer science, and tomorrow I have a test on computer structure. I had no clue on the fetch decode execute cycle, and was desperately looking for something on youtube (as one does). I saw your face and was inmediately relieved, as your narrating skills would make me get it instantly. You have saved a fellow computer scientist my friend.
Having just finished watching Ben Eater's breadboard computer build, this is a nice abstraction to add to the detailed electronics. Thank you for putting it together!
Today I Learned: Most people in RUclips comments think snapping your fingers is some kind of superpower
I couldn't figure out how to do it until I was like 15
well i still cant do it
@@bananya6020 ok here is a mindblower atleast it was for me : the sound doesn't come from the snap itself but from your middle finger after the snap hitting on your hand.
or: most people in RUclips comments don’t know how to snap
(Including me)
Maybe, but Tom's snaps are also louder and clearer than most people's.
my computer is probably generating cryptocurrency for computer hackers
If its been hijacked and used as a botnet, then yes
Congratulations
@@snollag2278 That has got to be criminal, right? Using others' computers for your own profit...
Is there any way to check if a computer is used as a crypto generator?
@Sassy The Sasquatch thanks for the tech support sassy hopefully i can get rid of these cyber creeps for good
Just casually snapping half of all life in and out of existence.
The Mad Titan, Tom Scott.
CS student, lately, I've been starting new topics wiith Tom Scott videos. Greatly appreciated content.
I’ve been waiting forever for someone to finally explain the Fetch-Decode-Execute cycle in a simple way. Thank you Tom!
What's there to understand? It's staggeringly obvious, right?
This helped me out more than my 2 years of computer science studies.
Good job, Tom.
I love prince of Persia, to know that it was written in assembly, my respect to the developers increased dramatically
One of the best and simplest explanations i've ever seen for how a cpu works. Keep it up Tom
I can't tell you just how *SATISFYING* the snapping was. Amazing.
Excellent video! I talked about this cycle with my computer students today and one of them showed me your explanation. Great! That's why I always have the same answer when someone tells me: "Oh, my PC is frozen" - "Impossible: computers never freeze." ;)
Tom:
var x = 1;
while(true) {
x=x+1;
}
compiler: I'm gonna optimize away this code's whole career
Suppose it depends what language you're using.
x++;
@John Galt Line "x=x+1;", "x += 1;", "x++;"
They are all valid, there is no single correct way to write that.
@@Guztav1337 the compiler optimises it to 1 instruction anyways
@@mariocamspam72 Yes. There is no single correct way to write that. It doesn't matter.
@@Guztav1337 if the compiler is smart enough, but ALL of them do it nowadays soooo
The CPU/snapping fingers nailed it! I think the next question someone would ask is how does it know that each step in the cycle was performed? It would be neat to show a ready status letting it know it's done therefore it can continue forward with the right "side" of the next clock cycle and avoid glitches.
I think short answer is that it doesn't typically "know", at least not at this level. Electricity is very fast but of course that with very fast clocks, the logic can get all tangled up. So engineers run simulations on their models to make sure that the logic behaves properly up until a certain clock frequency. Some instructions might also need more than one clock cycle to be completed. Also some logic blocks on the chip might need slower clocks (or simply not need a very fast clock -> a fast clock consumes more energy, so it is avoided if possible). In that case the clock is divided and distributed throughout the chip. When you can't easily predict the path of information or logic, you can also have some sort of "handshake" mechanism between devices, so they know when they are ready, just as you mentioned. It's very complex but very interesting!
My masters degree used a different type of paradigm in terms of an instruction set. There was only one instruction: move.
Rather than an ALU - arithmetic logic unit - there was custom functional units - FUs - much like using ASICs. All you did was move the data to the inputs on these FUs and retrieve the result when required - after a certain number of clock cycles depending on complexity.
I investigated biological mechanisms in this paradigm. What would happen if an FU is defective - could you replicate its functionality using less complex FUs at a sacrifice of more computing time. (Such as using an addition FU multiple times instead of a multiplication unit).
Great video as usual Tom!
PS. It’s Program Counter
That sounds really interesting. Would love to see a detailed breakdown of how such a system works.
@@louaial-obaidi3998 me too
Don't even need special FUs, Have you seen "mov is Turing complete" aka the movfuscator? It's a single instruction c compiler that compiles to a huge long list of MOV instructions.
Daniel Wallace the use of FUs was mainly for the biological mechanisms aspect.
I didn’t realise there was a C compiler, so that’s very interesting. The processor itself was implemented using VHDL and the Xilinx suite. (This includes any FUs that I used for demonstration purposes)
Louai Al-Obaidi @Master Mati Thank you for the interest. I haven’t really spoken about my thesis in ages.
The processor itself was written in VHDL. The MOVE paradigm is very good in application specific circumstances. Therefore my assumption throughout the thesis was that there would be arrays of application specific microprocessors. (Rather than those that are general purpose) - and fault tolerances that could be provided.
I watched this video a long time ago. Now I am still impressed how easy to understand by your presentation.
5:15 they still had tools for creating the animations. its just the code that actually places it on the screen that was made in assembly.
4:30 "every sixth clock cycle" - Actually it is every ninth, because in your demonstration there are three instructions in the loop each using 3 clock cycles.
Watching Tom Scott snapping his fingers for 9 minutes
You best believe I'm watching it
Dear Tom , Thank you for your excellent presentation.
I got lecture for 1 and 1/2 hr for this topic (Computer Organization and Architecture) Simple As Possible -1 , I only understand a little from it. This video helps alot. This video should be shown to people who is curently learning COA for easier understanding. Great video!
5:35 my 2 year experience of coding in ASM compressed into one sentence
I respect the grind tho
This video seems a bit RISC-y to make.
eh, what's the 'ARM?
@@renakunisaki How about catching MIPS the rabbit and clipping through doors in 0.5 A presses
I'd would instead say that it's totally not RISC-y. That's because RISC CPUs always operate on registers and only contain commands to compute values between two registers. Non-RISC CPUs have commands to directly operate using memory addresses.
I see
Eyyy!!!
I knew this already on a deeper level but I have to say this was the simplest explanation of a CPU cycle I've ever heard. Great job on that one. If people want a bit more details then search for The Computer Science crash course by PBS on youtube, still superficial but very informative and it changes the view of computers in general.
I still love the fact that this video was the sole reason I didn’t fail my assembler exam back in the day.
Very concise and comprehensive. Even though I am familiar with this topic, I wanted to watch it from a "teaching-it" point of view. One of the best explanations of this topic that I have encountered. Also, that ad description for dashlane you are giving at the end...is really good! Even though I am a Keepass fan, you got me interested! You are really good in presentations!
Wasn't the original Rollercoaster Tycoon also in assembly? !
Yes
You think Prince of Persia was impressive? All GameBoy games are coded in assembly.
Including Pokémon.
The animation cycles in Prince of Persia versus the outline of the back of someone's head and a text box announcing what was and was not super-effective... I'm going with Prince of Persia on the 'impressive' front.
you think assembly is impressive?
in space race by atari there wasn't any memory chip, so half of the picture of the ship was stored in a bunch of diodes connected to wires and it was then mirrored.
there aren't any instructions, the main board is a bunch of logic gates, timers and flip-flops that do stuff based on the inputs and the state of the counters. the score is displayed by counting the lines and the columns, and using a bcd to 7 segment decoder a few and gates decide whether the current position is a segment or not, and an additional and gate checks if it should be showing the pixel on or off.
tl;dr: there is still a game, but there aren't any instructions, nor processor*, the clock is still there though.
* one could argue that a bunch of logic gates that processes input is a form of processor and a few flip-flops and counters is memory (ram), and the diodes in a grid is rom.
@@satibel So it was hard-coded? Dang.
Also, the animations in Prince of Persia were rotoscoped.
@@jlco more like hard wired.
I have learnt Toms clicks are loud and satisfying from this video
I think you are the best divulgator I met in the last 20 years of experience in tech... compliments !!
WOAHHHHH!!!! I understand the fetch decode execute cycle much much better now!!!
All my concepts relating to this topic are crystal clear...THANKS!!!
You deserve a sub!
it's crying because i have 60 chrome tabs open
you're a monster
Get one of the new AMDs and it doesn't even care anymore. Mine doesn't. Enough cores to leave everything running for several local users.
I have :D tabs open
you should turn your computer off and never touch one again
Save them as bookmarks they don't slow your PC down at all
Yet another demonstration of how terrible my highschool CS course is.
It took them three lessons to teach people the basics of Python, while I instead taught it to myself in an afternoon using the Internet.
It took them a week to teach us numeric conversions, which I already knew from RUclips.
And it took them a week to (very poorly) teach the content of this video, while this video is only nine minutes long.
School: 0 | Internet: 3
Well, unfortunately high schools have to ensure everyone understands the material, so they’re slow in any subject related to STEM.
Ah, Tom, but which password manager do you actually use? Dashlane or something different?
keepassxc is not a botnet
shitty online ones are
I have dashlane and it's not the cheapest option but it is very good. Before dashlane, I used KeePass (today I would probably use KeePassXC though.) I like the extra features dashlane offers so it's worth the cost for me personally but you may have other priorities.
I used dashlane until it asked for my master password instead of a pin, and I forgot my password
Physical piece of paper is the best.
i use the cave walls.
I barely understand anything but I understand enough to appreciate how complex computers are. They’re a whole different creature! Almost alien, with their own language and parts helping it decode and get things done. Scary and intriguing!
I've got my paper 1 computer science GCSE tomorrow and this video has explained like 90% of the stuff on the paper.
6:55 If you have been techy enough to stay that long until the dashlane ad you should know that there are alternatives.
There is KeePass as an opensource alternative which you can carry on an usb or sync via your trusted cloud service.
Or you can just run it locally.
There is also googles passwordmanager for "free" when using chrome and android
Leave your alternatives in the comments as well :)
Paper
Cave Walls.
Sticky notes in books
Computer Architecture course of 6 months summarized in 9 minute video. Fantastic
Person - CPU's working is so easy
Pipelining - hold my data paths
@Memerooney Oh boy; I remember those stupid hazards from my CDA class. @_@
By far the best Explanation of the Program Counter, Instruction Register and Accumulator❤️❤️❤️
You are precious Tom Scott and quiet possibly the best thing on RUclips's servers.
6:19 But Tom ... You know that Mac do not use PowerPC architecture anymore ...
I imagine the point is that the code can be ported and compiled on different architectures. Sure modern macs use Intel processors now, but the point might be missed if the comparison was between Intel based and say for instance ARM based.
Actually, my computer heat my house, when winter has come
Missing an important fiddly bit known as conditional execution, which is what makes a computer so much more powerful than an oversized calculator.
Thank you sir..i am GATE aspirant used for entrance into the reputed IITs ...this helped me a lot love from India
I call this the FE-D-EX Cycle, made up the acronym when I was studying for a computer hardware exam, never failed me , I also made the acronym Why-ow-est-lan-sysfun-doc which is for finding out a problem of a computer, figuring out how to fix it, test solution, plan the fix, test system functionality, and finally document the solution.
In case someone wants to learn sort-of assembly language (very close to it anyway) for fun, i'd recommend "shenzhen IO". It's quite niche as a game, but quite interesting if you are into that sort of thing. Comes with manuals of course. Skills learned in that game might actually be useful if you end up in electronics industry.
Silicon Zeroes is a great puzzle game for understanding how things like CPU, registers, and RAM work, as it has you building your own simple computers by dragging together individual pieces like clocks and adders.
Also, TIS-100 is a slightly more simple take on assembly-style coding, still from the Shenzen devs.
Human Resource Machine is a great way to recontextualize bare metal programming.
That looks like the front bit at the Centre for Computing History.
Source: been there.
It is
Source: it's awesome
As a Zoology student, i understood
many things from the video loved it❤️
Very nice explanation! My informatics teacher at school actually wrote a virtual machine (for DOS) with it's own simple assembler language and some simulated IO to display text that allowed us students to step through the code and see what actually happens on the CPU. Damn, my informatics teacher was awesome! I owe him a great debt to this day!
Programme Counter? Or Program Counter? Discuss... Imho, always thought a "programme" was a piece of content sent over a medium, eg a BBC Television Programme.
I think they're just two different spellings of the same word