ISA 2.4 MIPS: Addresses in branches and jumps

Поділитися
Вставка
  • Опубліковано 18 гру 2024

КОМЕНТАРІ • 76

  • @muhammedhosnyessa8002
    @muhammedhosnyessa8002 3 роки тому +29

    This guy saved me this semester.
    He deserves an oscar compared to my prof who is just rolling a bunch of slides.

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

    This guys explain it perfectly i wander why j never say his video he deserves more subscribers.

  • @alizwellscott
    @alizwellscott 6 років тому +9

    Damn! Mr.Schaffer, you are my savior!!! I've never found any other MIPS lecture that concise and easy to understand! Thank you so much XD

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

      Sorry to be so off topic but does any of you know a method to get back into an instagram account..?
      I somehow forgot my account password. I would appreciate any tips you can give me

  • @wagneralberto5456
    @wagneralberto5456 7 років тому +38

    you deserve everything that u desire, it's so satisfactory to be more smart everytime that i watcch one of your videos. TY MY Brother!

  • @jpohbw
    @jpohbw 8 років тому +1

    I have been searching through many forums to search for a nice explanation, but gave up and tried youtube instead. Found this vid. Thanks a lot! It was really helpful, especially the mention of labels, and the examples given.

  • @lordad
    @lordad 5 років тому +1

    This was the clearest and best structured well explained explanation i ever heard for jumps and branches in Mips ! When we had this topic in University i did not understand anything but this video is so clear and easy to understand. 10/10 job !

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

      Hi every one, I need your help guys...
      ■ Which registers are affected by a branch instruction?
      ■ How many bytes are used to store one instruction?
      ■ Can the computer execute an assembly instruction?
      Can someone help me please?

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

    You really just oversimplified the concept. Thank you so much!

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

    Thank you! I am going to have a computer organization exam tomorrow, this video helps a lot!

  • @ner0718
    @ner0718 10 місяців тому +4

    I wonder how crappy Universities have to be, if a guy on youtube can explain it to me perfectly in under 10 minutes, but they barely can.

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

    Best explanation in UA-cam, thank you!

  • @abuhorraira8081
    @abuhorraira8081 5 років тому +2

    better explanation then my 16500tk course instructor

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

    Thank you, I was looking for ages for this!

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

    Your explanation clear all my concepts. Thank you so much Sir. 👍

  • @maziarghorbani
    @maziarghorbani 8 років тому

    I should have waited little more. I got the answer from the loop example.
    Thank you for the great videos.

  • @bw-fd1uy
    @bw-fd1uy Рік тому

    This is perfectly clear explanation thank you so much sir !!

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

    i didnt found more consise and understandable than this series..thanks a lot

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

    Thank you very much, this is so much appreciated

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

    Very well explained, cannot thank you enough. You're rockstar guy

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

    Many many thanks sir for clearcut undertand the concept

  • @tatyanaroyer7880
    @tatyanaroyer7880 8 років тому

    This is a great video and made this clear as day for me. Thanks.

  • @nimit8849
    @nimit8849 7 років тому

    Thank you so much! Better explained than my professor!

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

    Excellent explanation!

  • @hiddensamphire5316
    @hiddensamphire5316 6 років тому +1

    great video...but the answer to how far you can jump with the branch instruction is (-2^17) to (2^17)-1 as the entire point of multiplying the number by 4 is so that we can extend the 16 bit immediate to 18 bit immediate.

    • @Momo-zu2vc
      @Momo-zu2vc 9 місяців тому

      Which is why the correct answer does say instructions instead of bytes! Additionally, you would actually not be able to jump (2^17) - 1 bytes since that's not a multiple of 4.

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

    i had a clear understanding.THANK YOU SO MUCH

  • @namigwe8842
    @namigwe8842 8 років тому +1

    Wow thank you so much, this was perfect.

  • @Zscor27
    @Zscor27 5 років тому +1

    Would be helpful if you showed how to calculate machine code for when you're actually presented with a label and not a number. So like, for your beq to 3, what if it said beq to label1, how you would find out that label1 = 3. And same for jump.

  • @asteok2740
    @asteok2740 Рік тому +1

    ксо ретейк, передаем привет

  • @liemh9290
    @liemh9290 5 років тому

    3:25 the 26 bits address look like it SHIFTED as well?

  • @luojihencha
    @luojihencha 8 років тому +5

    8:51 jump needs to plus 4. But previously, you said jump doesn't need to plus 4

    • @JGunlimited
      @JGunlimited 7 років тому +1

      I think it is a problem of confusing word choice. The instruction is *bne* despite the use of _jump_ in the question.

    • @tanjimbinfaruk9145
      @tanjimbinfaruk9145 6 років тому

      We add 4 to current PC in case of conditional jumps. (bne/beq) The jump instruction ( j ) is different from this.

  • @mohbit3336
    @mohbit3336 5 років тому

    also you can conclude from the above video the following equation : pc=oldpc+4+(offset * 4)
    from the above example suppose that we want to branch to address pc = 104 (should be multiple of 4 as discussed in the video) and current pc value =12 we want to know the offset value that we want to insert in the following instruction bnq R0,R1,offset so by using the above equation offset= (pc - (oldpc+4))/4 = (104 - (12+4))/4= 22,you can calculate oldpc value by counting the number of instruction and multiply by 4 oldpc= IN * 4.

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

    amazing video man

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

    Why when we calculate the new addresses for the "jumb", we need to replace the 26 bits of the PC? I think we can do the same with bne/beq by considering them as "relative offset". what is the logic behind replacing the whole value of the PC to a new value. similarly, when calculating addresses for beq/bnq, we can replace the values in the instruction with absolute values

  • @mohammed_mairajuddin_musharraf

    I think for Calculating Next 32 bit PC in JUMP instruction, first four bits of PC+4 must be concatenated with left shifted 26 bit immediate data.
    Correct me If I'm wrong.

  • @khalilrouatbi6345
    @khalilrouatbi6345 6 років тому

    man you just saved my life thx!

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

    2:50 how do you get that 16 bit imm?

  • @sharklion3
    @sharklion3 5 років тому

    Very helpful video, thank you!

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

    this is fantastic, thank you!

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

    Thank you, really helpful

  • @jessiegross8868
    @jessiegross8868 6 років тому

    I noticed a difference with RISC-V 32 assembler is that the I-format is 12 bit immediate. Why is lower than MIPS?

  • @BladedgeES
    @BladedgeES 8 років тому +2

    When you calculated the PC for the jump, where did you get the constant 2 from? I know that the command said j 2, but why 2?

    • @May-sy9jk
      @May-sy9jk 7 років тому

      it's the same as jump label, the "2" is actually label when you write assembly, but if you do not have assembler translate labels into machine code ,this will be the number that indicates second instruction in this case.(0 based), as you've already known ,memory in mips is 8 bits wide, so you have to combine 4 memory addresses together to form 1 instruction, if you want the second instruction in memory , 0-3(very first instruction which means 0th instruction) 4-7 (first instruction 1) 8-11(this is what you want)

  • @user-cvviwion
    @user-cvviwion 8 років тому

    7:34 I also heard that '=' operations take more CPU cycles, compare to '==', '=!' operations. In order to balance each instruction, MIPS provides only beq, bne.

  • @ladyexci
    @ladyexci 6 років тому

    I'm happily married, and yet, I feel a certain affection that I can't quite explain for you. Thank you for helping me out with your amazing videos!

  • @Ghaleon15
    @Ghaleon15 6 років тому

    How does Jump Register works?
    It's a R-type because it addresses a register, right? What happen to the rest of the bits (RS, RT, RD, Shamt, Func) ?

  • @عبداللهالنور-ز1د
    @عبداللهالنور-ز1د 6 років тому

    شكرا جزيلا .thank you soooo much

  • @maziarghorbani
    @maziarghorbani 8 років тому

    I have a question!
    While in I-format, after we sign extend the intermediate value, you mentioned that we shift it to get the two LSBs "00", however, according to what happens, "00" is just added to the value and has nothing to do with the intermediate value. Later we shift the intermediate to get the effect of multiply by 4.
    Is this correct?

  • @Logofatu114
    @Logofatu114 7 років тому

    When you say branch instruction address, you refer to the address the branch will jump at if its taken? In beq R5, R1, 3 , 3 is the branch address?

    • @tanjimbinfaruk9145
      @tanjimbinfaruk9145 6 років тому

      The branch instruction basically says if the expression is true then jump at that label.
      beq R5,R1,label
      We use label when writing assembly code. But later it gets translated into machine code and the label is replaced by an number which in this case is 3. So the instruction is basically saying that if R5 == R1 then go to label enumerated by 3. Here 3 is used to calculate the actual address where the jump will take place.

  • @Dks-2224
    @Dks-2224 Рік тому

    Ur the best…

  • @hahaman7211
    @hahaman7211 5 років тому

    great explanation!!!

  • @zahreddinesoualem3213
    @zahreddinesoualem3213 6 років тому

    but what happen with load and store is it the same !!

  • @ZachBugay
    @ZachBugay 8 років тому

    I am totally confused with calculating the destination register for Jumps. If I am currently at register 20, the binary is 10100. If you take the first 26, you still get 20 (decimal).

    • @JGunlimited
      @JGunlimited 7 років тому

      4:24 The jump value of 8 is obtained by ( ( 20 & 0xf0000000 ) | ( 2

    • @JGunlimited
      @JGunlimited 7 років тому

      Though I think there's an error and jump should be based on PC + 4, not PC. Such that ( ( 24 & 0xf0000000 ) | ( 2

    • @JGunlimited
      @JGunlimited 7 років тому

      The formula is ( ( ( PC + 4 ) & 0xf0000000 ) | ( immediate

    • @alexcipriani6003
      @alexcipriani6003 7 років тому

      he was talking about jumping (j) back to 8 from 20

  • @SPeeDKiLL45
    @SPeeDKiLL45 6 років тому

    beautifull explained

  • @fatimahassan3205
    @fatimahassan3205 6 років тому

    i think your course has been deleted from this website www.scalable-learning.com,because your enrollment key doesnot acccess to your couse. kindly check it

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

    Hi every one, I need your help guys...
    ■ Which registers are affected by a branch instruction?
    ■ How many bytes are used to store one instruction?
    ■ Can the computer execute an assembly instruction?
    Can someone help me please?

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

    nice video!!!

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

    in beq there is no value 3, it should be a label so I dont know what this is, so bad

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

      when u use SPIM (Mips simulator) , bne $t0,$s5,Exit is translated by the machine to : opcode=000101(in decimal 5) reg$t0=01000(in deimal 8) reg$s5=10101(in decimal 21) Exit label=000000000000010(in decimal 2) the value 3 is the value yielded by the machine when he want to compute the effectif address of the jump location! that's why it is calling immediate format, because the computer knows the offset from the BNE instruction to the destination address.... read this Great Book page 111, you'll undestand bunch of things ict.iitk.ac.in/wp-content/uploads/CS422-Computer-Architecture-ComputerOrganizationAndDesign5thEdition2014.pdf

  • @azkahV9432
    @azkahV9432 8 років тому

    Thank you!

  • @alexandrakung9905
    @alexandrakung9905 6 років тому

    wow!

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

    in mip we use labels, not numbers. For example on line 8: beq R5, R1, 3 ; would be beq, R5, R1, OTHER or beq R5, R1, EXAMPLE. How come you never mention this/explain how the labels would become numbers to do the math in your example that isn't even commonly used

  • @lg2389
    @lg2389 8 років тому

    I LOVE YOU

  • @shoshoar6414
    @shoshoar6414 7 років тому

    thank U ^_^

  • @Kitchen-Raccoon4572
    @Kitchen-Raccoon4572 6 років тому

    i love you

  • @MehmetAltuntasmehmetcc
    @MehmetAltuntasmehmetcc 6 років тому

    I hope you will get every chick your heart desires

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

    Thanks!