Introduction to CPU Pipelining

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ธ.ค. 2024

ความคิดเห็น • 102

  • @donaldwright2426
    @donaldwright2426 ปีที่แล้ว +6

    Breaking down technical topics like micro-electronics is not for everyone, but you've done a great job of translating something complex like a CPU pipeline into a simple, easy-to-grasp and understanding. Just thank you!

  • @eliasrezaei3931
    @eliasrezaei3931 11 หลายเดือนก่อน +5

    Best explanation ever! Never understood pipelining very well but your explanation made it so clear. Thanks!

    • @wizardcraftcode
      @wizardcraftcode  11 หลายเดือนก่อน +2

      WOOHOO!!!! Thank you so much!

  • @LG-qz8om
    @LG-qz8om 20 วันที่ผ่านมา

    I've been a programmer for a long time and never knew this.
    Thanks.

    • @wizardcraftcode
      @wizardcraftcode  20 วันที่ผ่านมา

      Very cool! One of the great things about this career is that there's always something new to learn. I'm glad you found something valuable here!

  • @vietC93
    @vietC93 หลายเดือนก่อน

    Thank you for sharing your knowledge! Your videos aid me apply best practices in C programming in my daily work. Going to spare more time to watch and learn from your content.

    • @wizardcraftcode
      @wizardcraftcode  หลายเดือนก่อน

      Thank you for such a nice comment! I'm really glad you find them helpful!!!

  • @C4rb0neum
    @C4rb0neum หลายเดือนก่อน

    I just wanted to learn about if and else and got the whole pipelining information for free! Thanks very useful

    • @wizardcraftcode
      @wizardcraftcode  หลายเดือนก่อน

      Bonus!!!!! I'm glad you found it useful!

  • @subhajitchatterjee1637
    @subhajitchatterjee1637 10 หลายเดือนก่อน +1

    I love how easy to understand this video is. Subscriber++

  • @mtushar
    @mtushar 3 ปีที่แล้ว +7

    Thank you, I never could before but this high level overview has helped me understand how conditional branching introduces inefficiency!

  • @Sviskebisk
    @Sviskebisk 2 ปีที่แล้ว

    Thank you for this. Structured, precise and to the point. I gained +5 intelligence from just this video.

    • @wizardcraftcode
      @wizardcraftcode  2 ปีที่แล้ว

      Thanks! That's a fun comment and I'm glad it helped!

  • @AlbertDongler
    @AlbertDongler 11 หลายเดือนก่อน

    Superbly explained, thank you for taking the time to put this together! 😁

    • @wizardcraftcode
      @wizardcraftcode  11 หลายเดือนก่อน

      Thanks! I'm glad it is helpful!!!

  • @xedover
    @xedover 2 ปีที่แล้ว

    Very nice explanation... I've been hearing about Pipelining CPUs, but until now I had no idea what they were talking about.

  • @jakubfrei3757
    @jakubfrei3757 หลายเดือนก่อน

    You deserve way more subs, thx :)

    • @wizardcraftcode
      @wizardcraftcode  หลายเดือนก่อน

      Thanks! I'm working on that! :D

  • @JJJ-ee5dc
    @JJJ-ee5dc 3 ปีที่แล้ว +2

    Omg so much quality content. blessed to found out this channel

    • @boitshepojoy6925
      @boitshepojoy6925 3 ปีที่แล้ว

      Tell me abt it
      Quality information for free!

    • @wizardcraftcode
      @wizardcraftcode  3 ปีที่แล้ว

      Thank you, both! I love it when my videos are helpful!

  • @amsonyoutube
    @amsonyoutube 3 ปีที่แล้ว +1

    Hey Merlin, you did fantastic job !!

  • @dghtucs
    @dghtucs 6 หลายเดือนก่อน

    Thank you for sharing knowledge selflessly!!!

    • @wizardcraftcode
      @wizardcraftcode  6 หลายเดือนก่อน

      It makes me really happy when people find them useful! Thank you!

  • @brian_kirk
    @brian_kirk 2 ปีที่แล้ว +1

    Thanks for making this! This was very helpful. You also have a great voice for narration and excellent pace! May have to check out all your other videos :)

  • @bowthunell
    @bowthunell 2 ปีที่แล้ว

    Thank you for this well explanation. It's very helpful.

  • @THERaikami1
    @THERaikami1 3 ปีที่แล้ว +1

    Thanks so much for this video. I have an interview and I'm sure they will ask me about pipelining!

    • @wizardcraftcode
      @wizardcraftcode  3 ปีที่แล้ว +1

      Good luck!

    • @THERaikami1
      @THERaikami1 3 ปีที่แล้ว

      @@wizardcraftcode Thanks I got the job!

    • @JJJ-ee5dc
      @JJJ-ee5dc 3 ปีที่แล้ว

      @@THERaikami1 good bro..

    • @wizardcraftcode
      @wizardcraftcode  3 ปีที่แล้ว

      @@THERaikami1 Woohoo!!!!

  • @favourmokwenye6387
    @favourmokwenye6387 ปีที่แล้ว

    super helpful!
    Really love how i understood it in no time

  • @r0m.1b
    @r0m.1b 3 ปีที่แล้ว

    Thanks so much for this video! Very clear insight of cpu pipelining for the noob I am 😊

    • @wizardcraftcode
      @wizardcraftcode  3 ปีที่แล้ว +1

      Glad it was helpful! That makes me happy

  • @Dcatts-i2z
    @Dcatts-i2z 3 ปีที่แล้ว

    I'm learning scripting for now but I enjoyed this.

  • @michaelcrainiciuc
    @michaelcrainiciuc ปีที่แล้ว

    Great explained and easy to understand!

  • @sushmithaguggella1782
    @sushmithaguggella1782 3 ปีที่แล้ว +1

    such beautiful explanation

    • @wizardcraftcode
      @wizardcraftcode  3 ปีที่แล้ว

      Thank you!!! That makes me very happy!

  • @pavanchytanya1283
    @pavanchytanya1283 3 ปีที่แล้ว +1

    Thank u mam you taught it so well , please suggest a book for processor architecture( computer architecture in general)

    • @wizardcraftcode
      @wizardcraftcode  3 ปีที่แล้ว

      I'm glad you liked it. For a book, I like Computer Organization and Design by Patterson and Hennessy. It's the standard textbook for lots of schools. Maybe other people can chime in with other suggestions!

  • @piecucci
    @piecucci 8 หลายเดือนก่อน

    what a gen! 💎 instant subscribe!

  • @azd1752
    @azd1752 3 ปีที่แล้ว

    Great job ! Thank you for the clear explanation, it is very helpful !

  • @Huehhee7777
    @Huehhee7777 3 ปีที่แล้ว +1

    Yo thanks , i have a very silly doubt here we saw 4 stage instructions and the first stage is fetch cycle , right? Correct me if i am wrong... In the fetch cycle the address of the instruction fetched is given to the address reg. And now the contents of the address reg is passed on the bus, then the instruction is fetched from memory right? Is the whole thing happens only at the first stage? For more clear view i will write like this
    Add reg.

    • @wizardcraftcode
      @wizardcraftcode  3 ปีที่แล้ว +1

      The stages of the pipeline all have to take the same amount of time, so they all have to be as long as the store stage. So, there's time for the fetch of an instruction in the fetch stage. The adding to the PC is done in a separate path, in parallel. That's what the Addr in that phase is doing while the fetch from memory of the instruction is happening. So, the things you wrote happen, but not sequentially. I hope that helps!

    • @Huehhee7777
      @Huehhee7777 3 ปีที่แล้ว +1

      @@wizardcraftcode thanks for taking your time to respond me👍

  • @nourghazal296
    @nourghazal296 2 ปีที่แล้ว

    Thank you alot, lets say that we keep all the stages the same but we add an extra execution stage. Would it not affect the speed of the CPU at all?

    • @wizardcraftcode
      @wizardcraftcode  2 ปีที่แล้ว

      Just duplicating the existing execution stage doesn't help because you can't get two instructions there fast enough (without duplicating everything). However, all of the stages have to take the same amount of time for the pipeline to work. If you had a really long execution stage and split it into two, then the "tick" of your pipeline (how fast things go from one stage to the next) would be doubled. When your pipeline was completely full, you'd pump out finished instructions at twice the speed.

  • @masbro1901
    @masbro1901 2 ปีที่แล้ว

    hi, what is stall and flush and branch penalty in this concept, and what is its impact to pipeline. thank you.

    • @wizardcraftcode
      @wizardcraftcode  2 ปีที่แล้ว +1

      I didn't cover stall in this video. Some pipelines are more complicated than the simple ones I talked about here and can recognize that two sequential instructions interfere with each other. Then they are smart enough to "stall" one until the data it needs is ready. Branch penalty is what I showed here - the cost of taking a conditional branch and how that empties the pipeline. That emptying of the pipeline is what "flush" means.

  • @jpmorallo
    @jpmorallo 7 หลายเดือนก่อน

    This is helpful thank you

  • @HenTrademark
    @HenTrademark ปีที่แล้ว

    Love your vids xx♥️♥️♥️♥️♥️

    • @carolwellington483
      @carolwellington483 ปีที่แล้ว

      Thank you!!!

    • @wizardcraftcode
      @wizardcraftcode  8 หลายเดือนก่อน

      Apparently, I replied from the wrong account! Thanks from this one, too!

  • @EngrUsmanx
    @EngrUsmanx 15 ชั่วโมงที่ผ่านมา

    Thanks ❤

  • @nourghazal296
    @nourghazal296 2 ปีที่แล้ว +1

    And what if I have 2 pipelines. Will the speed of the CPU double?

    • @wizardcraftcode
      @wizardcraftcode  2 ปีที่แล้ว +2

      That would essentially be a two core CPU. If your compiler distributes things across those cores well, yes, the speed will double.

  • @BlueNSour
    @BlueNSour 2 ปีที่แล้ว

    for compiled languages, wouldnt the compilers optimise the conditions for the conditional branching?

    • @wizardcraftcode
      @wizardcraftcode  8 หลายเดือนก่อน +1

      The compiler will, and the CPU will. My goal with this video was just to give a high level view of what is happening and why you should understand it

    • @BlueNSour
      @BlueNSour 8 หลายเดือนก่อน

      @@wizardcraftcode valuable insight you're sharing. Would love to see how the CPU might be able to do this for itself? I hadn't realised that was an option

    • @wizardcraftcode
      @wizardcraftcode  8 หลายเดือนก่อน

      @@BlueNSour I'll put that on the list of topics I should make videos about. Thanks!

  • @nurlanimanov9503
    @nurlanimanov9503 2 ปีที่แล้ว

    Thanks for nice video and explanation. my question is "How many stages can CPU maximum does in one cycle, I mean what is the limit? I don' think that it is unlimited right?"

    • @wizardcraftcode
      @wizardcraftcode  2 ปีที่แล้ว

      The stages of a pipeline run in parallel meaning they all execute every cycle. In theory, you could build an N stage pipeline for any N, but, in reality, there's a limit to how many are useful.

  • @rambazamba4164
    @rambazamba4164 2 ปีที่แล้ว

    oooommmg fuck yes the little animation is so helpful and motivating for adhd its such a relief every time hahaha

  • @fantasypvp
    @fantasypvp 2 ปีที่แล้ว

    now im wondering if cpu makers could improve the performance even more with parallelism on a singlethreaded application.
    so for example, if there are two paths of instructions being executed in a single code function, and some instructions didnt have much to do with others, maybe that instruction could be loaded into the cpu way before it is actually ready to be executed, and if the instruction after it doesnt rely on the result of that data, they could be processed in parallel by the same core.
    something like
    fn main() {
    let mut x = 0
    let mut y = 0
    for i in (0..1000).rev() {
    x *= 2
    y *= 2
    }
    }
    so for this code (rust), x and y are separate and dont depend on each other. would it be feasible to separate this into multiple threads purely using the cpu without any kind of explicit code to make it parallel?

    • @wizardcraftcode
      @wizardcraftcode  2 ปีที่แล้ว

      Actually, there are already optimizing compiler that will know to put those on different cores in your CPU. Essentially, the compiler can control the parallelism on the cores within a CPU without the programmer having to explicitly code the multi-threading.

    • @mikafoxx2717
      @mikafoxx2717 11 หลายเดือนก่อน

      Even single cores have had multiple execution units and do batches, they also are smart about doing things in a new order so that things don't conflict, they also use unnamed registers to start new operations that other registers haven't yet been cleared for since it's out of order. Pipelining gets you to scalar, or one operation max per clock cycle, since the Pentium 3 or something, we've done out of order super-scalar processing

    • @wizardcraftcode
      @wizardcraftcode  7 หลายเดือนก่อน

      That's so cool! So much magic underlying everything we do!

  • @Brekstahkid
    @Brekstahkid 6 หลายเดือนก่อน

    Awesome

  • @suuuken4977
    @suuuken4977 3 ปีที่แล้ว

    good work!

  • @nipunmihimal9092
    @nipunmihimal9092 2 ปีที่แล้ว

    Thanks lot❤

  • @JJJ-ee5dc
    @JJJ-ee5dc 3 ปีที่แล้ว

    Thanks from india

  • @mahseratokpas631
    @mahseratokpas631 3 ปีที่แล้ว

    It's a great explanation. Are you a professor?

    • @wizardcraftcode
      @wizardcraftcode  3 ปีที่แล้ว +1

      I'm glad you like it. Yes! I am a Software Engineering professor at Shippensburg University. Don't hold that against me! :)

  • @semibiotic
    @semibiotic 9 หลายเดือนก่อน

    ALU does not "execute" instruction, it only do the math commanded by CU. It is CU, which does execute the instruction.

    • @wizardcraftcode
      @wizardcraftcode  9 หลายเดือนก่อน

      You are correct. It executes the math necessary for the instruction. The rest of what I talked about is the high level view of the rest of what you are talking about. This video is intentionally high level, but I could have been more precise with my language at that point.

  • @artnevka779
    @artnevka779 3 ปีที่แล้ว

    robotic sound could improve

    • @wizardcraftcode
      @wizardcraftcode  3 ปีที่แล้ว

      I'll try to work on that! Thanks for the feedback

  • @sreerajchundayil588
    @sreerajchundayil588 3 ปีที่แล้ว +7

    Overall explanation is good. But that robotic voice part is irritating.

    • @wizardcraftcode
      @wizardcraftcode  3 ปีที่แล้ว +2

      I'll have to work on being a bit more animated. Thanks for the feedback!

    • @mtushar
      @mtushar 3 ปีที่แล้ว +4

      @@wizardcraftcode don't believe that, I love the animated part!

    • @KrisRyanStallard
      @KrisRyanStallard 18 วันที่ผ่านมา

      ​@wizardcraftcode your voice is fine and plenty animated for the topic and format. It sounds like a typical voice. I think people expect TH-cam presenters to sound like a TV presenter that works with a vocal coach.

  • @CandyHam
    @CandyHam 9 วันที่ผ่านมา +1

    Really did not need that other voice

    • @wizardcraftcode
      @wizardcraftcode  9 วันที่ผ่านมา

      Totally fair! Most of my students like her, but I use her less often than I used to. For me, it's easier to script these as a conversation because I'm used to talking to my students, but I'm getting better and better. Maybe you'd like my more recent videos better.