Bitwise operators in C

Sdílet
Vložit
  • čas přidán 16. 12. 2019
  • Bitwise operators, what they are and how the work.
    Link to our hexadecimal, binary and decimal conversions course over at skillshare: skl.sh/2WIk8JP
    Check out our Discord server: / discord

Komentáře • 43

  • @goldhalowings
    @goldhalowings Před 4 lety +23

    Bitwise operators is a crucial thing for embedded programming and emulation
    I'm very pleased that you make this video

  • @techwithkingsley1861
    @techwithkingsley1861 Před rokem +5

    I initially thought of this as very difficult, but I have understood it clearly now. And that is also as a result of how easy you make it look through your speech and mannerisms. Thank you so much.

  • @norvigosracing6948
    @norvigosracing6948 Před 3 lety +3

    Awesome video, thanks for explaining it so clearly.

  • @carolineanderson4512
    @carolineanderson4512 Před 2 lety

    You’re awesome, thank you for making me understand this!

  • @grimvian
    @grimvian Před rokem +2

    I'm quite familiar with this topic since I learned 6502 assembler 40 years ago. Nevertheless, I found the video to be excellent and the pedagogical explanations were good.
    I have a suggestion: It would be great to have a video that covers the topic of half adders and full adders, as it would be beneficial for practice.

    • @CodeVault
      @CodeVault  Před rokem +1

      Thank you. I noted down your suggestion

  • @A.Abdul-Nasser
    @A.Abdul-Nasser Před 2 lety +1

    Pretty clear. Much appreciation.

  • @marioleon4102
    @marioleon4102 Před 2 lety +1

    Excellent explanation, thank you sir.

  • @eeneemeenee6236
    @eeneemeenee6236 Před rokem

    you explained ~ very well, thanks

  • @VahidNesro
    @VahidNesro Před 3 lety +1

    Awesome Content! Big Fan

  • @davebertaud
    @davebertaud Před 2 lety +1

    Amazing video. Thank you.

  • @jalalbounaim
    @jalalbounaim Před 2 lety +1

    Very good explanation thx!

  • @mpusgmdev2649
    @mpusgmdev2649 Před 2 lety +1

    thank you the explanation is very helpful

  • @dghevethng9681
    @dghevethng9681 Před 3 lety

    great video!!

  • @eva42sh
    @eva42sh Před 2 lety

    thank you sir..these videoes are really helpful

  • @yamarsarr7213
    @yamarsarr7213 Před rokem

    excellent explanation

  • @zyghom
    @zyghom Před 2 lety +2

    when people start learning boolean operators/logics/table they got completely stuck. I think (and I might be wrong) that the idea of teaching with table is confusing, asking students to think about "magic" table (wrrr...).
    While in fact it could be simpler explained by using the language we use every day:
    1- OR: "any 1 on input will give 1 on output" (is this really or? see below)
    2- AND: "all inputs must be 1 to give 1 on output" - super simple btw
    3- XOR: "1 on output only if EITHER of inputs is 1 not when all inputs are 1" - that complicates a bit with more than 2 variables but for 2 variables it stays
    4- NOT - it does not require further explanation
    the thing is: OR is confusing in the English spoken language because "1 or 1" is actually not OR (in English understanding) but AND (you have an apple AND I have an apple) - only the XOR is the real representation of OR (either I have an apple OR you have an apple)
    I am not sure (while reading my text above) if that is clearer than the table now but at least that is the way I always try to remember it rather than learning "the table"
    Edit:
    OR in bool is like ANY in English (any must be 1 to have 1)
    XOR in bool is like EITHER/OR in English (either must be 1 [but not both] to have 1)
    AND in bool is like ALL in English (all must be 1 to have 1)
    does it make sense?

  • @wasgehtabman89
    @wasgehtabman89 Před 5 měsíci

    you're the best

  • @shreyashbharati7395
    @shreyashbharati7395 Před rokem

    thank you sir!!

  • @emanuelebarbato
    @emanuelebarbato Před 2 lety

    very nice video

  • @nabila3534
    @nabila3534 Před 2 lety

    thanks

  • @ganeshrepaka7906
    @ganeshrepaka7906 Před 3 lety

    Can you please tell me What is the use of these bitwise operator??

    • @CodeVault
      @CodeVault  Před 3 lety

      Here's a video to illustrate exactly that: code-vault.net/lesson/qxg3dupduu:1603733525904

  • @127kiranmai2
    @127kiranmai2 Před 3 lety

    Sir can pls can you explain flowchart for this bit wise operaters

    • @CodeVault
      @CodeVault  Před 3 lety

      I'm not exactly sure what you mean by that

  • @AlexTechie
    @AlexTechie Před 2 lety +4

    Good explanation, but the NOT operator is missing the explanation as to why ~5 = -6 (rather than -5).

    • @CodeVault
      @CodeVault  Před 2 lety +4

      That has more to do with how negative numbers are represented in memory. I'll make a video on this

    • @reddybhanuprakash9163
      @reddybhanuprakash9163 Před 2 lety +1

      @@CodeVault great explanation

    • @twisted6148
      @twisted6148 Před 2 lety

      @@CodeVault can you please tag me in the video?

  • @lx6381
    @lx6381 Před 2 lety +1

    you still didn't explain why the inverse of 5 is -6.
    if i look at your 32 digit binary numer for example at 12:51
    the first 4 bits from the right are: 1010 = 10.
    i really don't understand how you get -6

    • @CodeVault
      @CodeVault  Před 2 lety +2

      It has to do with the way negative numbers are stored in memory. Negative numbers are always stored in what is called two's complement. Since we're dealing with signed integers, the first 1 (from the left) represents that the number is negative. To convert that binary number (11111010) to decimal here are the steps (I'm using only 8 bits here but it works just like in the video for 32 bits):
      1) Reverse all the binary digits 11111010 -> 00000101
      2) Add 1 to the result 00000101 + 1 = 00000110
      3) Convert the number to decimal 00000110 is 6 (since we are converting negative numbers, the result is -6)
      This video from ComputerPhile might help: czcams.com/video/lKTsv6iVxV4/video.html

  • @looploop6612
    @looploop6612 Před 4 lety

    What is real application of it?

    • @CodeVault
      @CodeVault  Před 4 lety +1

      Good question. You could create a flag system with them. We'll release tomorrow a video about that.

  • @arvindersingh9863
    @arvindersingh9863 Před 4 lety

    👍

  • @eva42sh
    @eva42sh Před 2 lety

    i feel like I am in class because i can see the teacher's expression too

  • @madhiranagender6758
    @madhiranagender6758 Před 3 lety

    Which books is best for c programming

    • @CodeVault
      @CodeVault  Před 3 lety

      This is a really good book if you already went through the basics: www.amazon.com/Effective-Introduction-Professional-Robert-Seacord/dp/1718501048

  • @arvindersingh9863
    @arvindersingh9863 Před 4 lety

    If,, float x=0.1;
    Double y=0.1;
    Then why, x==y is not true

    • @CodeVault
      @CodeVault  Před 4 lety +2

      The gist of it is that the technique used to store floats and doubles inside 32 and 64 bits doesn't allow for *exact* representation of certain rational numbers. They are just an approximation:
      0.1 is 0.100000001 (when it's stored in a float)
      0.1 is 0.10000000000000001 (when it's stored in a double)
      Thus, you get that x is not actually equal to y due to that minor difference.
      A workaround for this issue is to just cast y to a float before comparison: *x == (float) y*
      You can read more into this here: stackoverflow.com/questions/588004/is-floating-point-math-broken
      I somehow missed your previous question, sorry about that.

    • @arvindersingh9863
      @arvindersingh9863 Před 4 lety

      @@CodeVault thanks for clearing this doubt

  • @ismbks
    @ismbks Před 4 měsíci

    the ads are atrocious

  • @cyrusdev1701
    @cyrusdev1701 Před 2 lety

    You’re awesome, thank you for making me understand this!

  • @giroco8
    @giroco8 Před rokem

    thanks