Bitwise Operators 4: The Logical Shift Operation

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

КОМЕНТАРІ • 42

  • @caiodorn
    @caiodorn 3 роки тому +12

    How can this video have a thumbs down? This series is great, you've done an amazing job in explaining it, and the animations couple it perfectly.

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

      You're very kind. Comment much appreciated. Thanks :)KD

    • @hypergolic8468
      @hypergolic8468 8 місяців тому +1

      The thumbs down was a bit shifted off to the left, lost it's place on screen, you know what they are like. A great explanation, and well presented too!

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

    Probably the best video on bit shifting!

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

    concise and clear explanations. also, i really liked the examples which show exactly how it is actually used.

  • @marnierogers3931
    @marnierogers3931 2 роки тому +7

    This is such a life saver. Thanks for the context here where my uni lecturer failed.

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

      You're most welcome

    • @suleymanaghamoglanli4439
      @suleymanaghamoglanli4439 11 місяців тому

      I really feel so dumb. I don't understand anything my uni lecturer says, unlike my classmates. If it weren't for UA-cam tutorial videos, I would have failed already.

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

    DUDE !!!! Thanks a lot man :D Never felt so good after reading such a basic thing.

  • @ESLwithAlexey
    @ESLwithAlexey 2 роки тому +6

    This is so devine and clearly explained! Thanks a lot for the demonstration that is so easy to comprehend on such a complex matter. Perfect educational material!

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

    Thanks for the series, just watched everything :)

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

    Watching this video would've saved me half of 30 hours of headache on my computer assignment.
    Also what is the difference between >> and >>>

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

      These are operators used by programmers in various languages. >> is an arithmetic right shift which preserves the sign bit of a number encoded in binary, whereas >>> is a logical right shift (also known as an unsigned right shift) that treats the sign bit like all the other bits. For example -2 can be written in binary as 11111110. The leftmost bit is the sign bit, and a 1 at this position indicates that this is a negative number. When >> is applied (-2 >> 1), the bit pattern becomes 11111111, which is -1. Everything except the sign bit has moved right, so the existing sign bit is preserved. On the other hand, when the >>> operator is applied to 11111110 (-2 >>> 1) the sign bit is treated like any other bit, so everything including the sign bit moves right. The left hand side is padded with zeros and the result is 01111111, which is 127. Logical shifts are useful in cryptography.
      :)KD

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

      @@ComputerScienceLessons omg thank you!

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

    Your voice is what David attenborough is for nature documentaries but for computer science videos

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

    i appreciate you and your videos, smart kind human

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

    After watching the serious bitwise operators seem pretty logical after all

  • @kokoraiado5409
    @kokoraiado5409 11 місяців тому

    Superb video!

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

    Very clear. I think this will help me a lot!

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

    Felt elated while learning this :)

  • @yuchaofan
    @yuchaofan Рік тому +2

    great tutorial series

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

    Awesome explanation!

  • @MarstonH
    @MarstonH 7 місяців тому +1

    as always thank you

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

    if I am not wrong,
    The name is incorrect.
    the logical shift right would give the wrong answer for (-)negative values.
    because it would move the MSB which is important for signed values.
    The arithmetic shift is used for signed values. which would not affect the MSB.

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

    what is the difference between logical shift and arithmetic shift?

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

    why is 10.5 round to 10 and not 11?

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

    I always thought your channel photo was a picture of Jupiter 🤣🤣

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

      It's my daughter shouting through a hole in a rock when she was three year old :)KD

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

      @@ComputerScienceLessons :)

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

    yes