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

Loading...
  • Published on: 29 July 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: https://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 https://dashlane.com/tomscott

    MORE BASICS: https://www.youtube.com/playlist?list=PL96C35uN7xGLLeET0dOWaKHkAlPsrkcha

    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 by Sean M Elliott and Tom Scott
    Directed by Tomek
    Graphics by Mooviemakers https://www.mooviemakers.co.uk/
    Audio mix by Haerther Productions https://haerther.net/



    I'm at https://tomscott.com
    on Twitter at https://twitter.com/tomscott
    on Facebook at https://facebook.com/tomscott
    and on Instagram as tomscottgo
  • Runtime : 9:4
  • tom scott tomscott the basics computer science fetch-execute fetch-execute cycle fetch-decode-execute cycle fetch-decode-execute cpu ram

COMMENTS: 40

  • Tom Scott
    Tom Scott   7 months ago

    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 https://www.dashlane.com/tomscott

  • zamistro
    zamistro   2 days ago

    So, what is the blinky light thingy in the background?

  • aaa
    aaa   5 days ago

    6:03 where is the data type mr. scott?

  • Karandeep Patti
    Karandeep Patti   1 weeks ago

    Is this cycle only used for math problems or is used for all the instructions??

  • Ioni B.
    Ioni B.   2 weeks ago

    For the video - great! It was very useful. For the sponsoring - not so much. I get the idea of all that security stuff, but what happens if you have to log in somewhere from someone else's computer/phone/any digital device. Then what? And imagine you can't download Dashlane. How are you meant to log in, especially if you need to do it quickly? I think that it is just stupid. If you have any computer knowledge - talking about people in general - you'd be sensible enough not to get hacked, and if somehow you do, all you need to do is reset your password and have two-way authentication.

  • KT P
    KT P   1 months ago

    I had a exam yesterday on embedded systems, contained a couple of questions on the fetch decode execute cycle should have seen this earlier 😂

  • Hoàng Trần Minh
    Hoàng Trần Minh   1 months ago

    Shouldn't the jump instruction be set to jump 0 instead of jump 1? If you have another thread that is also modifying the value in mem address 6, this might cause a problem if you want both threads to run simultaneously.Or am i overthinking this and the best way to program is to avoid race conditions altogether?

  • Imu Ias
    Imu Ias   1 months ago

    I want more on microprocessor. 🙂🙂🙂

  • Eamonn
    Eamonn   1 months ago

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

  • Thiefree
    Thiefree   1 months ago

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

  • Muneeb Anjum
    Muneeb Anjum   1 months ago

    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!

  • notthere83
    notthere83   1 months ago

    Whoa, I did not know that about Prince of Persia. That's insane.

  • Electroblade
    Electroblade   2 months ago

    I already know this because i do computer science xD

  • catprog
    catprog   2 months ago

    Magic cpu and ram.How do you get the data from ram in one clock cycle. (normally one to set address and one to get data)

  • Standa Novák
    Standa Novák   2 months ago

    Prince of persia made in assembly is impressive? Heck, RollerCoaster Tycoon was made in assembly!

  • Grapz224
    Grapz224   2 months ago

    By the way, if you are interested in learning what programming in Assembly is like... Check out EXAPUNKS, Shenzhen I/O, or TIS 100 on Steam. They're all Zachtronics Games about coding in rudimentary Assembly to create Viruses, Microcontrollers, or solve math problems respectively.

  • Mr_FJ
    Mr_FJ   3 months ago

    RollerCoaster Tycoon 1 and 2 were coded in Assembly

  • MS Thalamus
    MS Thalamus   3 months ago

    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!

  • NitSUj
    NitSUj   3 months ago

    I've had to pause the video because you are driving me crazy with you know what..

  • spazda_mx5
    spazda_mx5   3 months ago

    What a bloody wonderful channel this is

  • Zach Bell
    Zach Bell   3 months ago

    This video is finger clickin good

  • kericlapboards
    kericlapboards   3 months ago

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

  • Summ
    Summ   3 months ago

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

  • Reuben M.D.
    Reuben M.D.   3 months ago

    Me: What is 1+1 equal to?Computer: ADD 7!

  • Nolan Beck
    Nolan Beck   3 months ago

    ah getting some flashbacks to my Assembly class, I hate it.. thanks Tom!

  • tech kid
    tech kid   3 months ago

    Tom Scott: lets not have it binary and keep it humanly readableMe: binary is humanly readable!!

  • iMc Nx
    iMc Nx   4 months ago

    That’s amazing 👌🏻 can you explain why fetch need 3 cycles of clock and execute I think it’s 1 cycle

  • Artemius9
    Artemius9   4 months ago

    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!

  • Anders Struck
    Anders Struck   5 months ago

    Good thing you didn't include pipelining, multi-layer caches or different architectures (register to register vs register to mem, etc)

  • Overbite Games
    Overbite Games   5 months ago

    watching this with a wrist injury has my hands feeling a certain way.Ouch.

  • Gull Lars
    Gull Lars   5 months ago

    I did code a 16-bit RISC assembly program once for a project, which was an interpreter for ASCII encoded commands and piping of data in an FPGA soft core to control the hardware blocks' functionality. There are some really clever things you can do at the machine code level to make your code small and fast, but to do so correctly is very hard and basically requires you to be able to step through the code flow in your head (or with flowcharts for assistance). If you think refactoring c++, java or C# is hard, try refactoring hundreds or thousands of lines of assembly. Some experience with code golfing can come in really handy then. (our case was on the order of 450-500 lines of an initial assembly implementation getting refactored and reduced to 150 lines because of a need to keep more data state in the limited registers, and a severe penalty for too much memory access to shuffle data between RAM and registers.