The Fetch-Execute Cycle: What's Your Computer Actually Doing?

Поділитися
Вставка
  • Опубліковано 28 лип 2019
  • The fetch-execute cycle is the basis of everything your computer or phone does. This is literally The Basics. • Sponsored by Dashlane -try 30 days for free at: www.dashlane.com/tomscott
    Thanks to Dashlane for sponsoring the video! If you're techie enough to watch this video, you should be using a password manager. Get a 30-day free trial at dashlane.com/tomscott
    MORE BASICS: • The Basics
    MINOR CORRECTIONS:
    In the graphics, "programme" should be "program".
    I say "Mac instead of PC"; that should be "a phone instead of a PC".
    And most importantly, I say "every sixth cycle": that should be "every ninth".
    Fortunately, none of these materially affect the content of the video!
    Written with Sean Elliott / seanmelliott
    Directed by Tomek
    Graphics by Mooviemakers www.mooviemakers.co.uk/
    Audio mix by Haerther Productions haerther.net/
    🟥 MORE FROM TOM: www.tomscott.com/
    (you can find contact details and social links there too)
    📰 WEEKLY NEWSLETTER with good stuff from the rest of the internet: www.tomscott.com/newsletter/
    ❓ LATERAL, free weekly podcast: lateralcast.com/ / lateralcast
    ➕ TOM SCOTT PLUS: / tomscottplus
    👥 THE TECHNICAL DIFFICULTIES: / techdif

КОМЕНТАРІ • 2,2 тис.

  • @TomScottGo
    @TomScottGo  4 роки тому +1981

    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

    • @smug_slime
      @smug_slime 4 роки тому +36

      Why is your comment is a week old? I mean I know how but why?

    • @vivekpanchagnula815
      @vivekpanchagnula815 4 роки тому +4

      @@smug_slime same

    • @vivekpanchagnula815
      @vivekpanchagnula815 4 роки тому +1

      ???????

    • @MrFreakydeakydutch
      @MrFreakydeakydutch 4 роки тому +22

      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.

    • @buzzlightyear6960
      @buzzlightyear6960 4 роки тому +2

      Bruh

  • @gallavanting2041
    @gallavanting2041 4 роки тому +6626

    You literally just made this so you could flex on us with your Thanos tier snapping, I see you.

    • @vaclav_fejt
      @vaclav_fejt 4 роки тому +39

      I thought the comments will be referring Bono, alas, times have changed.

    • @gallavanting2041
      @gallavanting2041 4 роки тому +48

      @@vaclav_fejt wasn't bono clapping instead of snapping?

    • @vaclav_fejt
      @vaclav_fejt 4 роки тому +20

      @@gallavanting2041 Oh yes, you're right. My bad.

    • @connora9
      @connora9 4 роки тому +12

      He’s just snapping his fingers

    • @gumunduringigumundsson9344
      @gumunduringigumundsson9344 4 роки тому +32

      @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.

  • @Elren
    @Elren 4 роки тому +6898

    So every computer has a billion tiny Tom's, snapping their fingers in synchronicity.... Neat!

    • @mynewaccount2361
      @mynewaccount2361 4 роки тому +449

      Technically, it actually has only one Tom and a massive speaker network that transfers the snap

    • @Calebe311
      @Calebe311 4 роки тому +92

      @@mynewaccount2361 how about multi-core processors?

    • @jakethewolfie119
      @jakethewolfie119 4 роки тому +217

      @@Calebe311 Tom has more limbs for more hands to snap more

    • @mattjw16
      @mattjw16 4 роки тому +20

      *Toms

    • @kornsuwin
      @kornsuwin 4 роки тому +2

      r/meirl

  • @AuthenTech
    @AuthenTech 4 роки тому +2239

    Geez, that's a strong snap!

  • @12tone
    @12tone 4 роки тому +1684

    It will never not surprise me to relearn that CPU isn't actually just short for "ComPUter".

    • @KF-zb6gi
      @KF-zb6gi 3 роки тому +39

      Ofc not they would just use comp for that 🤣

    • @JohnDoe-pz4nk
      @JohnDoe-pz4nk 3 роки тому +35

      Are you dumb?
      How doesnt "Central Prosessing Unit" make more sense?

    • @craniumtea5137
      @craniumtea5137 3 роки тому +186

      @@JohnDoe-pz4nk it's a joke you troglodyte

    • @itacotaco1480
      @itacotaco1480 3 роки тому +114

      @@JohnDoe-pz4nk Who hurt you?

    • @sayanghosh6996
      @sayanghosh6996 3 роки тому +49

      who thinks CPU is short for ComPUter😂

  • @kalebbruwer
    @kalebbruwer 4 роки тому +1645

    I can't imagine writing an entire game in assembly, hats off to the people who did that.

    • @dIancaster
      @dIancaster 2 роки тому +203

      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.

    • @JackSalzman
      @JackSalzman 2 роки тому +81

      Thanks to them, we finally have games to play on our graphing calculators in class

    • @shalomhabibi9594
      @shalomhabibi9594 2 роки тому +4

      It really depends on what you're doing and why you're doing it

    • @articlefound2052
      @articlefound2052 2 роки тому +29

      Yes the fact that super mario bross 1 and 3 and all ness games had been written in assembly language blows my mind!!!

    • @newuser689
      @newuser689 Рік тому +62

      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.

  • @exm3266
    @exm3266 4 роки тому +2545

    I have a completely different mental image of a Snapdragon now.

  • @Mrjcraft00
    @Mrjcraft00 2 роки тому +360

    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.

    • @ibemper1850
      @ibemper1850 2 роки тому +35

      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

    • @SpeaksYourWord
      @SpeaksYourWord Рік тому +4

      Thanks

    • @mockingjayu2210
      @mockingjayu2210 Рік тому

      Hey thanks for sharing :)

    • @pmknmash
      @pmknmash Рік тому +4

      I just started playing Turing Complete today! what a coincidence. such a cool game :)

    • @a_39442b
      @a_39442b 11 місяців тому +2

      We did that with logisim as a final lab assignment in one of the courses in my CS programme some time ago. Fascinating stuff!

  • @MikeMozzaro
    @MikeMozzaro Рік тому +214

    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...

    • @kakyoindonut3213
      @kakyoindonut3213 Рік тому +16

      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

    • @upsidedownChad
      @upsidedownChad 10 місяців тому +14

      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

    • @MaryamKamaly08
      @MaryamKamaly08 5 місяців тому

      This and networks are something ill never understand in computer science

    • @nielskoomans
      @nielskoomans 5 місяців тому +7

      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

    • @DanielRodrigues-bx6lr
      @DanielRodrigues-bx6lr Місяць тому

      ​@@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.

  • @ericpeterson6520
    @ericpeterson6520 4 роки тому +1538

    Rollercoaster Tycoon was also programmed in assembly, which is why it runs so amazingly and was so outstanding technologically at the time

    • @naufalap
      @naufalap 4 роки тому +143

      damn I used to love drowning people there

    • @spooky6703
      @spooky6703 4 роки тому +322

      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.

    • @poiiihy
      @poiiihy 4 роки тому +5

      wow

    • @SolidRoot
      @SolidRoot 4 роки тому +8

      NBA Jam too, apparently.

    • @TheXev
      @TheXev 4 роки тому +75

      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.

  • @TotalElipse
    @TotalElipse 4 роки тому +2340

    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.

    • @WarioNumberOne
      @WarioNumberOne 4 роки тому +127

      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

    • @kumquatery
      @kumquatery 4 роки тому +195

      This video condensed about 50 pages of my old textbook into less than 7 minutes. And was more understandable.

    • @migkillerphantom
      @migkillerphantom 4 роки тому +55

      @@kumquatery textbooks exist not to teach but to keep the riffraff out

    • @codygarland6365
      @codygarland6365 4 роки тому +6

      Such a shame had just finished mine when this came out

    • @jackivison276
      @jackivison276 4 роки тому +1

      Already watched it

  • @vincentpol
    @vincentpol 3 роки тому +85

    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.

    • @emperor8716
      @emperor8716 2 місяці тому +2

      iirc it was made by 1 person too.

    • @peka2478
      @peka2478 2 місяці тому +2

      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.

  • @ir-dan8524
    @ir-dan8524 4 роки тому +94

    This is incredibly well done, how things worked at the lowest levels always baffled me. Thanks.

  • @enig2783
    @enig2783 4 роки тому +2193

    A Tom Scott video that last for longer than 5 minutes??? Impossible.

    • @Tik_taalik
      @Tik_taalik 4 роки тому +8

      Addah r This is blasphemy!

    • @MisterAppleEsq
      @MisterAppleEsq 4 роки тому +35

      Citation Needed and other game shows are quietly crying in a corner.

    • @lilpeach101
      @lilpeach101 4 роки тому +55

      Well, ~3 minutes of it are an ad

    • @chrisneedham5803
      @chrisneedham5803 4 роки тому +6

      My brain started hurting after only 2.30 mins.

    • @brendankapp5237
      @brendankapp5237 4 роки тому +4

      *10 hours of garlic bread footage cries alone*

  • @aibh7903
    @aibh7903 4 роки тому +771

    “What’s your computer actually doing?” Is something I’m more used to my professor asking me tbh

    • @casperes0912
      @casperes0912 4 роки тому +35

      Terrorshark Answer: “A lot of redundant work. It’s running JavaScript on the web

    • @timhuggins1993
      @timhuggins1993 4 роки тому +4

      Playing MiniClip online games , on tinder , online betting and watching Japanese foreign language cartoons ? Haha

    • @markmayonnaise1163
      @markmayonnaise1163 4 роки тому +2

      @@timhuggins1993 Isn't "Japanese foreign language" tautological?

    • @zigmazero2879
      @zigmazero2879 4 роки тому

      @@markmayonnaise1163 I don't think it is? It's redundant either way, so it's not like it matters.

  • @kericlapboards7737
    @kericlapboards7737 4 роки тому +29

    1:18 "It doesn't matter when, or in what order, the memory is written"
    If only.

    • @pokemagetech
      @pokemagetech 2 роки тому +5

      For synchronization, sure, but it’s opposed to sequential-access memory.

  • @Arbiter099
    @Arbiter099 4 роки тому +101

    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

  • @marlonb1852
    @marlonb1852 4 роки тому +687

    4:21 I love how your snapping is totally in sync with the Lights in the Backround

    • @laurinneff4304
      @laurinneff4304 3 роки тому +25

      Maybe they hooked the computer up in a way that a clock cycle happens every time a loud sound occurs

    • @marlonb1852
      @marlonb1852 3 роки тому +7

      @@laurinneff4304 could be

    • @ehsandawran
      @ehsandawran 3 роки тому +10

      Didn't notice that!

    • @rabidL3M0NS
      @rabidL3M0NS 2 роки тому +12

      @@laurinneff4304 if that were the case the lights would always be in sync with his snaps

  • @GermaphobeMusic
    @GermaphobeMusic 4 роки тому +802

    i feel like tom is flexing on me with those snaps

    • @bestpseudonym1693
      @bestpseudonym1693 4 роки тому +40

      I feel like those snaps were prerecorded and then added in post in order to get a crisp consistent sound

    • @RUNDNB85
      @RUNDNB85 4 роки тому +1

      @@bestpseudonym1693 don't be daft.

    • @wreynolds1995
      @wreynolds1995 4 роки тому +3

      @@bestpseudonym1693 It wasn't actually all that consistent.

  • @msthalamus2172
    @msthalamus2172 4 роки тому +26

    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!

  • @McFly0097
    @McFly0097 4 роки тому +10

    1:00 - the smile when u know what something is going to look like in effects, but you're doing it to nothing

  • @BioBush
    @BioBush 4 роки тому +427

    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.

    • @MrCrininer
      @MrCrininer 4 роки тому +40

      Now just imagine a billion Tom Scotts snapping their fingers like that and it's a modern day CPU!

    • @Byefriendo
      @Byefriendo 4 роки тому +44

      3.6Hz. Not great, not terrible

    • @satibel
      @satibel 4 роки тому +17

      @@MrCrininer and you need at least 4 of those to equal a modern CPU.

    • @MikkoRantalainen
      @MikkoRantalainen 3 роки тому +6

      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.

    • @death_parade
      @death_parade 2 роки тому +2

      @@Byefriendo Its not 3.6 Hz. Its 15 MHz.

  • @Michaelonyoutub
    @Michaelonyoutub 4 роки тому +103

    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.

    • @postvideo97
      @postvideo97 4 роки тому +2

      One of the best games, played it so much in my childhood.

    • @renakunisaki
      @renakunisaki 4 роки тому +19

      Nearly every NES, SNES, Genesis, Game Gear, Game Boy, C64, Atari, Amiga... game is made in assembly!

    • @9000888sora
      @9000888sora 4 роки тому +5

      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.

    • @jt....
      @jt.... 4 роки тому +30

      @@9000888sora Probably slower, computers are much better than humans at optimising code most of the time.

    • @user-le8ul4nr5t
      @user-le8ul4nr5t 4 роки тому

      I think steve wozniak wrote the apple II's monitor in machine language.

  • @ZXRulezzz
    @ZXRulezzz 4 роки тому +108

    Tom:
    var x = 1;
    while(true) {
    x=x+1;
    }
    compiler: I'm gonna optimize away this code's whole career

    • @johngaltline9933
      @johngaltline9933 4 роки тому +12

      Suppose it depends what language you're using.
      x++;

    • @Guztav1337
      @Guztav1337 4 роки тому +6

      @John Galt Line "x=x+1;", "x += 1;", "x++;"
      They are all valid, there is no single correct way to write that.

    • @mariocamspam72
      @mariocamspam72 3 роки тому +2

      @@Guztav1337 the compiler optimises it to 1 instruction anyways

    • @Guztav1337
      @Guztav1337 3 роки тому

      @@mariocamspam72 Yes. There is no single correct way to write that. It doesn't matter.

    • @mariocamspam72
      @mariocamspam72 3 роки тому +4

      @@Guztav1337 if the compiler is smart enough, but ALL of them do it nowadays soooo

  • @RobSwizz1e
    @RobSwizz1e 2 роки тому +9

    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!

  • @hxhuang9306
    @hxhuang9306 4 роки тому +778

    Very educational, I'm searching finger snapping tips now.

    • @CubeDaWoop
      @CubeDaWoop 4 роки тому +19

      I can't even snap my fingers

    • @Oldccount
      @Oldccount 4 роки тому +1

      @Clorox Bleach try to tense up the bit your middlefinger hits with your ringfinger

    • @themennissvids
      @themennissvids 4 роки тому +13

      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.

    • @kolibri5861
      @kolibri5861 3 роки тому +6

      @@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

    • @TechSupportDave
      @TechSupportDave 3 роки тому

      Here's a tip: smear your fingers in wood sap. makes clicking so much easier.

  • @renzpaulo14
    @renzpaulo14 4 роки тому +528

    Was that a real snapping sound at 0:55? If so, that was the most satisfying snap I've ever heard.

    • @erikwithak6555
      @erikwithak6555 4 роки тому +107

      It’s like the Nintendo switch snap

    • @guyliver1056
      @guyliver1056 4 роки тому +48

      Thanos will be proud

    • @Emil-yd1ge
      @Emil-yd1ge 4 роки тому +31

      Wearing a red t-shirt, you could call him a red snapper ( ͡° ͜ʖ ͡° )

    • @S1M91NG
      @S1M91NG 4 роки тому +22

      Top 10 snaps thanos was afraid to diss

    • @mx.r.taylorlindsey838
      @mx.r.taylorlindsey838 4 роки тому

      Sounds real enough to me

  • @elieobeid77
    @elieobeid77 4 роки тому +27

    I love prince of Persia, to know that it was written in assembly, my respect to the developers increased dramatically

  • @brianhayes1105
    @brianhayes1105 3 роки тому +33

    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.

  • @DrathVader
    @DrathVader 4 роки тому +2647

    If you're running Windows 10, from my experience it's doing whatever the hell it wants to.

    • @sheepsfeather3159
      @sheepsfeather3159 4 роки тому +284

      Or whatever microsoft wants it to do. Some days I wonder who actually owns the computer

    • @blumac9801
      @blumac9801 4 роки тому +191

      *YOUR PC NEEDS TO RESTART TO FINISH UPDATING*

    • @renakunisaki
      @renakunisaki 4 роки тому +90

      @@sheepsfeather3159 if you can't open it, copy it, or reprogram it, you don't own it. MS is pushing to prevent all three.

    • @hugop968
      @hugop968 4 роки тому +80

      ​@@renakunisaki Well, it has always been true for Windows, that's why we call that a proprietary os.

    • @fghsgh
      @fghsgh 4 роки тому +56

      @@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.

  • @harrysmith6153
    @harrysmith6153 4 роки тому +156

    A 7 minute video with 0 cuts during the main content. Very cool.

    • @battmarn
      @battmarn 4 роки тому +17

      Harry Smith Tom is very good at hiding cuts so there might be some hidden ones

    • @OrigamiMarie
      @OrigamiMarie 4 роки тому +37

      @@battmarn he's also UA-cam's one-take wonder, so it could be either way.

    • @tiberiu_nicolae
      @tiberiu_nicolae 4 роки тому

      The guy rarely cuts. He's the one take champ

  • @slowjampopi3782
    @slowjampopi3782 3 роки тому +8

    I like how you simplified the loop, thank you for your time and effort to produce a great video!

  • @theRealMibs
    @theRealMibs 2 роки тому +2

    I'm learning this in uni right now (in general CPU architecture) and I just now realize I have seen this video a year ago, long before I started studying...

  • @rinhd1977
    @rinhd1977 4 роки тому +404

    My computer is transmitting heat into my room.

    • @Operational117
      @Operational117 4 роки тому +8

      So is mine, and there's already an unhealthy surplus outside... 🥵

    • @mrflamewars
      @mrflamewars 4 роки тому +11

      Still running a Pentium 4?

    • @lfox02
      @lfox02 4 роки тому +5

      @@mrflamewars I don't think a Pentium 4 has quite the TDP necessary to act as a space heater...

    • @mrflamewars
      @mrflamewars 4 роки тому +1

      @@lfox02 The Prescott core p4s earned the name "Preshott"

    • @theepurpletoaster
      @theepurpletoaster 4 роки тому +7

      Who needs a heater in Winter when your computer does the same?

  • @meltossmedia
    @meltossmedia 4 роки тому +498

    >Tom writes 2 instead of 10
    *Confused Engineer Noises*

    • @SaraWolffs
      @SaraWolffs 4 роки тому +18

      Hex ;)

    • @trangium
      @trangium 4 роки тому +2

      Close enough

    • @samuelthecamel
      @samuelthecamel 4 роки тому +5

      @Xyre154 Mathmaticians: "Did you mean 2^8-1?"

    • @jyro1072
      @jyro1072 4 роки тому +2

      @Xyre154 Me: what

    • @bldjln3158
      @bldjln3158 2 роки тому

      Enfinwers dont make confused noises they are smart peole they are going to save the world

  • @eamonnca1
    @eamonnca1 4 роки тому +62

    Fantastic explanation. I wish this was around when I was trying to learn the same thing from a book for GCSE computing.

  • @guillermovillarsanchez7998
    @guillermovillarsanchez7998 Рік тому

    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.

  • @JesusJuenger
    @JesusJuenger 4 роки тому +362

    Today I Learned: Most people in UA-cam comments think snapping your fingers is some kind of superpower

    • @rzeka
      @rzeka 4 роки тому +7

      I couldn't figure out how to do it until I was like 15

    • @bananya6020
      @bananya6020 4 роки тому +26

      well i still cant do it

    • @melvinpariyadan4884
      @melvinpariyadan4884 4 роки тому +22

      @@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.

    • @CaseyShontz
      @CaseyShontz 4 роки тому +4

      or: most people in UA-cam comments don’t know how to snap
      (Including me)

    • @General12th
      @General12th 3 роки тому +18

      Maybe, but Tom's snaps are also louder and clearer than most people's.

  • @DMS3TV
    @DMS3TV 4 роки тому +2

    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.

  • @RussiasSufferingInUkraine
    @RussiasSufferingInUkraine 4 роки тому +2

    I love your The Basics series, Tom. Do keep them coming. I bet it's a lot of work to come up with topics and make them, but they are awesome. I wish I'd watched these ten years ago. Subscribed.

  • @bigbird447
    @bigbird447 4 роки тому +17

    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.

  • @JD-qq8fz
    @JD-qq8fz 4 роки тому +16

    Who else just kept rewinding to 0:54 over and over because they were distracted by those snaps? Those were quality snaps.
    Boom, snapstracted.

  • @DavidVitez
    @DavidVitez 4 роки тому +3

    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.

  • @harryhawtin8197
    @harryhawtin8197 3 роки тому

    You're my hero tom scott! I've watched this video many times in my computing and IT A-levels, and I have since come to love your channel! Much love from the westside!

  • @JarrydNielsenLMAO
    @JarrydNielsenLMAO 4 роки тому +1195

    my computer is probably generating cryptocurrency for computer hackers

    • @snollag2278
      @snollag2278 4 роки тому +83

      If its been hijacked and used as a botnet, then yes

    • @yasyasmarangoz3577
      @yasyasmarangoz3577 4 роки тому +17

      Congratulations

    • @Operational117
      @Operational117 4 роки тому +5

      @@snollag2278 That has got to be criminal, right? Using others' computers for your own profit...

    • @stuwustudio
      @stuwustudio 4 роки тому +5

      Is there any way to check if a computer is used as a crypto generator?

    • @JarrydNielsenLMAO
      @JarrydNielsenLMAO 4 роки тому +1

      @Sassy The Sasquatch thanks for the tech support sassy hopefully i can get rid of these cyber creeps for good

  • @itsalongday
    @itsalongday 4 роки тому +7

    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.

  • @FilipposKolovos
    @FilipposKolovos 3 роки тому +2

    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!

  • @233kosta
    @233kosta 4 роки тому +2

    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!

  • @FutureNow
    @FutureNow 4 роки тому +27

    Just casually snapping half of all life in and out of existence.

  • @stevenmcauley876
    @stevenmcauley876 4 роки тому +4

    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.

  • @Hasitier
    @Hasitier 4 роки тому +1

    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.

  • @TienNguyen-lm1wf
    @TienNguyen-lm1wf Місяць тому

    I watched this video a long time ago. Now I am still impressed how easy to understand by your presentation.

  • @Toraxa
    @Toraxa 4 роки тому +6

    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.

  • @Shardic
    @Shardic 4 роки тому +18

    Watching Tom Scott snapping his fingers for 9 minutes
    You best believe I'm watching it

  • @jinchoung
    @jinchoung 4 роки тому

    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!

  • @Artemius9
    @Artemius9 4 роки тому

    So good! Thank you so much, Tom! Ouf of the numerous videos I watched on CPU, yours is the best one. Done professionally, straight to the point and extremely easy to understand. Thank you!

  • @zipp4everyone263
    @zipp4everyone263 4 роки тому +4

    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!

  • @PME
    @PME 4 роки тому +27

    You impress me every time in with in how little shots/takes you do your entire video!

  • @RobertFeranec
    @RobertFeranec 4 роки тому +11

    Love the explanation! I remember the times when we HAD to understand all this to be able to do magic with our computers.

  • @8abu_frik303
    @8abu_frik303 2 роки тому

    Thank you so much for this; I have just started my CS alevel and this was confusing the way it was explained to me in class, thank you for explaining in such a clear an understandable way and clearing this up for me!!

  • @jaapsch2
    @jaapsch2 4 роки тому +12

    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.

  • @variousthings6470
    @variousthings6470 4 роки тому +3

    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!

  • @QuinsonHonQBB123XX
    @QuinsonHonQBB123XX 4 роки тому +2

    I’ve been waiting forever for someone to finally explain the Fetch-Decode-Execute cycle in a simple way. Thank you Tom!

    • @cygil1
      @cygil1 7 місяців тому

      What's there to understand? It's staggeringly obvious, right?

  • @MrKbtor2
    @MrKbtor2 2 роки тому +1

    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.

  • @SummMeister
    @SummMeister 4 роки тому +3

    This helped me out more than my 2 years of computer science studies.
    Good job, Tom.

  • @sabeenshahid2024
    @sabeenshahid2024 2 роки тому +4

    This summed up two of my computer science lessons. Except I actually understood everything this time, best explanation ever! :)

  • @davidbrown9021
    @davidbrown9021 4 роки тому

    #1 Awesome way to explain something I didn't understand, and #2 Thank you for finally including some kind of way for us to help support your channel. I would like you to continue making things for me to watch, and hopefully enough people will use your link that your time is fairly compensated. I know that might be a weird thing for me to worry about, but since nothing in life is free, I'm glad to be able to help. And finally, can we have more things from the Citation Needed crew? I need to see more of my favorite Gary Brannon, Gary Brannon.

  • @stephan464
    @stephan464 4 роки тому

    Such a high quality video! I love how understandable you explain all that stuff

  • @randomdude_12335
    @randomdude_12335 3 роки тому +11

    5:35 my 2 year experience of coding in ASM compressed into one sentence

  • @fep_ptcp883
    @fep_ptcp883 4 роки тому +8

    One of the best and simplest explanations i've ever seen for how a cpu works. Keep it up Tom

  • @saadusmani7846
    @saadusmani7846 2 роки тому

    Thanks. Have been watching you for a few years. I had already watched this video months ago, but now, in highschool, this video helped me understand the Fetch Execute Decide Cycle better. (My C.S teacher had already thought this and even showed us a UA-cam video on this, but it just helped me revise my concepts better.)
    Thanks

  • @MrLuigiBean1
    @MrLuigiBean1 2 роки тому

    I can't tell you just how *SATISFYING* the snapping was. Amazing.

  • @Kapin05
    @Kapin05 4 роки тому +10

    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 UA-cam.
    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

    • @GRBtutorials
      @GRBtutorials 4 роки тому +5

      Well, unfortunately high schools have to ensure everyone understands the material, so they’re slow in any subject related to STEM.

  • @leonchughes
    @leonchughes 4 роки тому +12

    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

    • @louaial-obaidi3998
      @louaial-obaidi3998 4 роки тому +2

      That sounds really interesting. Would love to see a detailed breakdown of how such a system works.

    • @mastermati773
      @mastermati773 4 роки тому

      @@louaial-obaidi3998 me too

    • @mydwchannel
      @mydwchannel 4 роки тому +3

      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.

    • @leonchughes
      @leonchughes 4 роки тому

      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)

    • @leonchughes
      @leonchughes 4 роки тому +1

      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.

  • @meshak9750
    @meshak9750 2 місяці тому

    One of the simplest great explanation, I have ever heard about this topic.

  • @Krishnasloveuke
    @Krishnasloveuke 26 днів тому

    Thank you for making the concept so simple and exciting

  • @tanmay8017
    @tanmay8017 4 роки тому +9

    Person - CPU's working is so easy
    Pipelining - hold my data paths

    • @KnakuanaRka
      @KnakuanaRka 3 роки тому

      @Memerooney Oh boy; I remember those stupid hazards from my CDA class. @_@

  • @midlowreborn
    @midlowreborn 4 роки тому +221

    it's crying because i have 60 chrome tabs open

    • @fireblade597
      @fireblade597 4 роки тому +25

      you're a monster

    • @MikaelLevoniemi
      @MikaelLevoniemi 4 роки тому +8

      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.

    • @ninjafruitchilled
      @ninjafruitchilled 4 роки тому +28

      I have :D tabs open

    • @43615
      @43615 4 роки тому +2

      you should turn your computer off and never touch one again

    • @elduderino4936
      @elduderino4936 4 роки тому +2

      Save them as bookmarks they don't slow your PC down at all

  • @gilvanvilarim1939
    @gilvanvilarim1939 Рік тому

    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." ;)

  • @brassj67
    @brassj67 3 роки тому +1

    I did already know this as I was taught this in 1979 when I was using the Commodore PET. Good video and its amazing to see a CPU made from discrete components abd LEDs

  • @vulduv
    @vulduv 3 роки тому +5

    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.

  • @bossaddict08
    @bossaddict08 4 роки тому +4

    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.

    • @captain_bretzel
      @captain_bretzel 4 місяці тому

      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!

  • @owenbooth
    @owenbooth 3 роки тому

    This is without doubt the best video on this subject I have ever used!

  • @AnantaAkash.Podder
    @AnantaAkash.Podder 6 місяців тому

    By far the best Explanation of the Program Counter, Instruction Register and Accumulator❤️❤️❤️

  • @diamondflaw
    @diamondflaw 4 роки тому +257

    This video seems a bit RISC-y to make.

    • @renakunisaki
      @renakunisaki 4 роки тому +56

      eh, what's the 'ARM?

    • @AnnoyedArt1256
      @AnnoyedArt1256 3 роки тому +7

      @@renakunisaki How about catching MIPS the rabbit and clipping through doors in 0.5 A presses

    • @MikkoRantalainen
      @MikkoRantalainen 3 роки тому +3

      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.

    • @n.s.ac.i.ajointeffort1983
      @n.s.ac.i.ajointeffort1983 3 роки тому

      I see

    • @pokemagetech
      @pokemagetech 2 роки тому

      Eyyy!!!

  • @phozonn
    @phozonn 4 роки тому +24

    Wasn't the original Rollercoaster Tycoon also in assembly? !

  • @yeadatwunyt8004
    @yeadatwunyt8004 2 роки тому

    The Mad Titan, Tom Scott.
    CS student, lately, I've been starting new topics wiith Tom Scott videos. Greatly appreciated content.

  • @muneebanjum6268
    @muneebanjum6268 4 роки тому +1

    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!

  • @BLNChrisCross
    @BLNChrisCross 4 роки тому +14

    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 :)

  • @PokeRedstone
    @PokeRedstone 4 роки тому +40

    You think Prince of Persia was impressive? All GameBoy games are coded in assembly.
    Including Pokémon.

    • @roninpawn
      @roninpawn 4 роки тому +7

      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.

    • @satibel
      @satibel 4 роки тому +5

      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.

    • @jlco
      @jlco 4 роки тому

      @@satibel So it was hard-coded? Dang.
      Also, the animations in Prince of Persia were rotoscoped.

    • @satibel
      @satibel 4 роки тому +2

      @@jlco more like hard wired.

  • @mr.fragile8530
    @mr.fragile8530 4 роки тому

    this is so well explained and is so helpful for an intermediate undergrad programming student. I hope there would be more vids like this that explain computer basics!

  • @ChrisWalshZX
    @ChrisWalshZX 4 роки тому

    Glad to see you back at the museum of computing history again Tom. I love the scaled up working computer in the background :-)

  • @dasemmiyogurt6288
    @dasemmiyogurt6288 4 роки тому +4

    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.

  • @Olli399
    @Olli399 4 роки тому +10

    That looks like the front bit at the Centre for Computing History.
    Source: been there.

    • @nxmee
      @nxmee 4 роки тому +4

      It is
      Source: it's awesome

  • @testoftetris
    @testoftetris 4 роки тому

    I was wondering about how password managers store your information without it just being like a plaintext bit of data on their server. Really looking forward to your next video about the subject!

  • @TheBlinkUp
    @TheBlinkUp 4 роки тому

    I subbed for content like that years ago
    keep up the quality on your videos
    great work Tom

  • @groomymusic1
    @groomymusic1 4 роки тому +33

    Actually, my computer heat my house, when winter has come

  • @DavidPruitt
    @DavidPruitt 4 роки тому +17

    Missing an important fiddly bit known as conditional execution, which is what makes a computer so much more powerful than an oversized calculator.

  • @Thiefree
    @Thiefree 4 роки тому

    I didn't expect to understand any of this, but you got me there. you're good at what you do!

  • @Melthornal
    @Melthornal 4 роки тому +4

    My computer is actually a box full of ants. I feet them leaves and give them charcoal pencils.

    • @anonymouslykind8981
      @anonymouslykind8981 4 роки тому

      You give them your Feet?

    • @KaosFireMaker
      @KaosFireMaker 4 роки тому

      Ah! The H.E.X. computing architecture!

    • @Melthornal
      @Melthornal 4 роки тому

      @@KaosFireMaker All these guys are jealous because my box of ants is smarter than their box of sand.