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

  • нийтэлсэн 5 сарын өмнө

    Tom ScottTom Scott

    Үргэлжлэх хугацаа: 9:04

    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: mnclip.info/playlist/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 www.mooviemakers.co.uk/
    Audio mix by Haerther Productions haerther.net/

    I'm at tomscott.com
    on Twitter at tomscott
    on Facebook at tomscott
    and on Instagram as tomscottgo

Tom Scott
Tom Scott

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

6 сарын өмнө
Oscar Green
Oscar Green

Tom Scott I’ve been where you filmed on a school trial

4 сарын өмнө
only funny
only funny

You should write a book

5 сарын өмнө
Jake the Wolfie
Jake the Wolfie

So my phone has a core of just you clicking your fingers billion of times a second?

5 сарын өмнө
Sebastian Knight
Sebastian Knight

You have a lot of answer, but there is one I would love to know, why do you look old and young in same time ? I had to google your name to find out your age because II was unsure if you when in your 20 or 40 D:

5 сарын өмнө
Anish Sarkar
Anish Sarkar

You just summed up the elctronics microprocessor semester in a few minutes grt video, and damn the snappy clock was good ,hope you cover video on computer clocks and frequency

5 сарын өмнө
KT P
KT P

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

7 өдрийн өмнө
MetalheadAndNerd
MetalheadAndNerd

Binary bits are just a social construct.

14 өдрийн өмнө
Hoàng Trần Minh
Hoàng Trần Minh

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?

19 өдрийн өмнө
Imu Ias
Imu Ias

I want more on microprocessor. 🙂🙂🙂

21 өдрийн өмнө
Eamonn
Eamonn

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

23 өдрийн өмнө
Thiefree
Thiefree

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

25 өдрийн өмнө
Muneeb Anjum
Muneeb Anjum

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!

26 өдрийн өмнө
David Talbot
David Talbot

ah yes, infinite loops

27 өдрийн өмнө
notthere83
notthere83

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

Сарын өмнө
Electroblade
Electroblade

I already know this because i do computer science xD

Сарын өмнө
obito morgan
obito morgan

i didnt know that u have a channel

Сарын өмнө
catprog
catprog

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

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

Сарын өмнө
I really like penguins
I really like penguins

explained it better than my compsci teacher

Сарын өмнө
Grapz224
Grapz224

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

RollerCoaster Tycoon 1 and 2 were coded in Assembly

2 сарын өмнө
Gene DeClark
Gene DeClark

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!

2 сарын өмнө
NitSUj
NitSUj

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

2 сарын өмнө
spazda_mx5
spazda_mx5

What a bloody wonderful channel this is

2 сарын өмнө
Zach Bell
Zach Bell

This video is finger clickin good

2 сарын өмнө
kericlapboards
kericlapboards

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

2 сарын өмнө
Summ
Summ

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

2 сарын өмнө
Reuben M.D.
Reuben M.D.

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

2 сарын өмнө
Nolan Beck
Nolan Beck

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

2 сарын өмнө
tech kid
tech kid

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

2 сарын өмнө
Laith Naseef
Laith Naseef

no way

3 сарын өмнө
Mo Izak
Mo Izak

thums up mentore

3 сарын өмнө
iMc Nx
iMc Nx

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

3 сарын өмнө
Artemius9
Artemius9

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!

4 сарын өмнө
Anders Struck
Anders Struck

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

4 сарын өмнө
Overbite Games
Overbite Games

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

4 сарын өмнө
Gull Lars
Gull Lars

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.

4 сарын өмнө
Rei
Rei

lil glitchy there

4 сарын өмнө
EramsorGR
EramsorGR

I should make a song of Tom saying "fetch, decode, execute"

4 сарын өмнө
losthor1zon
losthor1zon

Nice demonstration. I'm only disappointed that you didn't give an example of assembly language so that people can see what it looks like. (I vaguely remember 8080 / Z80 assembler, but any would do.)

4 сарын өмнө
Neonic Plays
Neonic Plays

Register? I thought that was a cache

4 сарын өмнө
Claxvii 177th
Claxvii 177th

Tom, you are a bloody wizard

4 сарын өмнө
Daniel Wilson
Daniel Wilson

Ah, good ol' ECE 4613 -- Computer Architecture. That example's a little on the slow side, though -- typically you'll see some pipelining, with instruction 2 loading while instruction 1 decodes, or rather instruction 2 loading and decoding while instruction 1 goes about the rather slower process of executing (provide the execute phase hasn't been split up and not counting speeding things along some more by making memory accesses another phase in the pipe). That way once the pipe fills up, you're burning through a phase of as many instructions as you have pipeline phases all at once (which gives the components no respite, often making them switch every clock cycle, dramatically increasing heat build-up), making for big ol' gains in throughput when not frustrated by conditional jumps making a missed branch prediction mean dumping large portions of the pipe, leaving a so-called "bubble". I sure can see why you left it out, though!

4 сарын өмнө
Dojel Notmyrealname
Dojel Notmyrealname

Wouldn't the fetch/decode/execute be happening simultaneously? Most CPU's are pipelined like that in my understanding.

4 сарын өмнө
KidUKnott
KidUKnott

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.

5 сарын өмнө
Deeptadeep Roy
Deeptadeep Roy

very well explained... definitely better than my microprocessor book... got myexam tomorrow... this definitely helped

5 сарын өмнө
Ren Kelb-Lancaster
Ren Kelb-Lancaster

This is crazy I can't believe my laptops so hardworking

5 сарын өмнө
Cyrus Hale
Cyrus Hale

I'm tech enough to use something betting than dashlane.

5 сарын өмнө
Dr Logiq
Dr Logiq

What's my computer actually doing? Well, Tom... most of the time it's just doing whatever it feels like, which is almost never what I need it to be doing! Blummin' Windows 10 _mumble mumble_ "Don't turn off your computer" _mumble_ ... This is a great explanation, nice and concise :)

5 сарын өмнө
Kiki Tay
Kiki Tay

Where can I find more about what's going on in his video's background?

5 сарын өмнө
joshmbrown42
joshmbrown42

As someone who's studied CS in the US, "programme counter" really threw me off for a few seconds.

5 сарын өмнө
mbenoni7
mbenoni7

It's short for "program millennium edition counter."

19 өдрийн өмнө
coolguy 284
coolguy 284

Why did that throw you off?

2 сарын өмнө
SteveVi0lence
SteveVi0lence

God Bless Scott's Tot's

5 сарын өмнө
SteveVi0lence
SteveVi0lence

Mine is downloading porn

5 сарын өмнө
talzO9
talzO9

is that a green screen

5 сарын өмнө
Hydrochloric Acid
Hydrochloric Acid

Are you trying to hypnotize me tom?

5 сарын өмнө
Dull Bananas
Dull Bananas

you love red

5 сарын өмнө
VidarW
VidarW

Great video. Great snapping.

5 сарын өмнө
felix34ever1
felix34ever1

This helps so much with computer science, now I understand what's actually happening at the bits of the cpu

5 сарын өмнө
Arfnudaniack Blue
Arfnudaniack Blue

And a system is only as good as the person in charge of designing it.

5 сарын өмнө
Isaac Clodfelter
Isaac Clodfelter

Higher level programming languages are just the endless cycle of computer programmers programming programs to program their programs just a little better. I love it.

5 сарын өмнө
Raymond Mataka
Raymond Mataka

Most indirect flex

5 сарын өмнө
Maghil vannan
Maghil vannan

@Tom Scott can you do a video about how pipelining is done in a basic level

5 сарын өмнө
Forgan Mreeman
Forgan Mreeman

if i’ve said it once i’ve said it 100x, programmers are actual aliens. or i’m an idiot. i had trouble keeping up with this very simple example. i failed two programming courses in a row while studying for my computer science degree. it made me drop out. i’m just not a programmer. kudos to those who are. it’s an incredible feat

5 сарын өмнө
Luminescent Lion
Luminescent Lion

Isnt the clock on the MoBo though, CPU just takes that and runs it through a multiplier to get its speed(in hertz), which it runs the instructions at.

5 сарын өмнө

Дараах

There is No Algorithm for Truth - with Tom Scott

59:35

There is No Algorithm for Truth - with Tom Scott

The Royal Institution

Үзсэн тоо 541

I'm Not A Robot ✅

7:40

I'm Not A Robot ✅

Tom Scott

Үзсэн тоо 1

How To Grow A Martian Salad On Earth

8:50

How To Grow A Martian Salad On Earth

Tom Scott

Үзсэн тоо 185

The Two Generals’ Problem

8:26

The Two Generals’ Problem

Tom Scott

Үзсэн тоо 2

Will YouTube Ever Run Out Of Video IDs?

5:10

Will YouTube Ever Run Out Of Video IDs?

Tom Scott

Үзсэн тоо 3

This Video Is Sponsored By ███ VPN

7:26

This Video Is Sponsored By ███ VPN

Tom Scott

Үзсэн тоо 1

Why Snow and Confetti Ruin YouTube Video Quality

4:20

How Auto-Tune Works

2:41

How Auto-Tune Works

Tom Scott

Үзсэн тоо 821

Why You Can't Trust Me

9:38

Why You Can't Trust Me

Tom Scott

Үзсэн тоо 1

Why Computers Can't Count Sometimes

8:44

Why Computers Can't Count Sometimes

Tom Scott

Үзсэн тоо 1

The Language Sounds That Could Exist, But Don't

6:31

The Image That Can Break Your Brain

1:43

The Image That Can Break Your Brain

Tom Scott

Үзсэн тоо 4

Why 1/1/1970 Bricks Your iPhone

5:00

Why 1/1/1970 Bricks Your iPhone

Tom Scott

Үзсэн тоо 4

Radioactive Bananas in Chernobyl

2:36

Radioactive Bananas in Chernobyl

Tom Scott

Үзсэн тоо 416

How Neurosurgeons Navigate Inside The Brain

7:18

How Neurosurgeons Navigate Inside The Brain

Tom Scott

Үзсэн тоо 362