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
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.
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.
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?
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
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
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.
Bitwise operators is a crucial thing for embedded programming and emulation
I'm very pleased that you make this video
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.
Awesome video, thanks for explaining it so clearly.
You’re awesome, thank you for making me understand this!
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.
Thank you. I noted down your suggestion
Pretty clear. Much appreciation.
Excellent explanation, thank you sir.
you explained ~ very well, thanks
Awesome Content! Big Fan
Amazing video. Thank you.
Very good explanation thx!
thank you the explanation is very helpful
great video!!
thank you sir..these videoes are really helpful
excellent explanation
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?
you're the best
thank you sir!!
very nice video
thanks
Can you please tell me What is the use of these bitwise operator??
Here's a video to illustrate exactly that: code-vault.net/lesson/qxg3dupduu:1603733525904
Sir can pls can you explain flowchart for this bit wise operaters
I'm not exactly sure what you mean by that
Good explanation, but the NOT operator is missing the explanation as to why ~5 = -6 (rather than -5).
That has more to do with how negative numbers are represented in memory. I'll make a video on this
@@CodeVault great explanation
@@CodeVault can you please tag me in the video?
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
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
What is real application of it?
Good question. You could create a flag system with them. We'll release tomorrow a video about that.
👍
i feel like I am in class because i can see the teacher's expression too
Which books is best for c programming
This is a really good book if you already went through the basics: www.amazon.com/Effective-Introduction-Professional-Robert-Seacord/dp/1718501048
If,, float x=0.1;
Double y=0.1;
Then why, x==y is not true
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.
@@CodeVault thanks for clearing this doubt
the ads are atrocious
You’re awesome, thank you for making me understand this!
thanks