Bitwise Operations & Bit Masking

  Рет қаралды 39,606

Learn Learn Scratch Tutorials

Learn Learn Scratch Tutorials

Күн бұрын

Пікірлер: 46
@danha3107
@danha3107 2 жыл бұрын
I've spent so long trying to understand this on my own, with my prof, and with other videos but none made it click as easily as this one. Thank you so much
@chronosbat
@chronosbat 2 жыл бұрын
Same. I literally have a paragraph and 1 practice problem to try to write masking code 😭
@rilsosingkoireng1492
@rilsosingkoireng1492 2 жыл бұрын
the cleanest and best explanation ever on bit masking. great job!! thank you appreciate your hard work.
@marnierogers3931
@marnierogers3931 2 жыл бұрын
This video has saved my life. Have spent a few hours trying to decipher what my lecturer explained and this has cracked it. Thanks!
@learnlearnscratch
@learnlearnscratch 2 жыл бұрын
Glad it helped you out! :-)
@joshuahardy8011
@joshuahardy8011 14 күн бұрын
Great video. Cleared some things up that my text book did not do a good job of explaining. Thanks!
@haojiang4882
@haojiang4882 3 жыл бұрын
This is by far the clearest explanation on bit masking I have watched. Thank you so much. Subed.
@siomarapantarotto
@siomarapantarotto 2 жыл бұрын
Fantastic! I loved your tutorial. God bless you! Best content explaining bitwise that I found on the Internet. 🥰
@huyennguyenmaingoc468
@huyennguyenmaingoc468 9 ай бұрын
thank you for your explanation XD I have been searching for Bitwise explanation and this is the best video I ever seen.
@eddielicea3740
@eddielicea3740 4 ай бұрын
Wow, if everyone explained as you do. We'd get it on the first try! Great Job man!
@phamtanloc601
@phamtanloc601 3 ай бұрын
This video saved me a lot of time to learn bitwise. Thanks so much
@Shuchrid2
@Shuchrid2 Жыл бұрын
THIS IS FANTASTIC! Oh my god, you explained it so elegantly - I understood everything immediately!!! do note that on the last example (Clearing digit 5 to 0), the table showes a XOR gate table, instead of the OR gate table (:
@tachikoman9462
@tachikoman9462 3 жыл бұрын
The clearest explanation!!! Appreciate it so much!
@flokipanda
@flokipanda Жыл бұрын
Best tutorial on bitwise operators.
@goodhabits1805
@goodhabits1805 2 жыл бұрын
So clearly summarized! Amazing! Thank you so much!
@georgesmith9178
@georgesmith9178 Жыл бұрын
i am surprised you got very few likes over the 2 years this video has been on. Thumbs-up of course. Just three tips: 1. Don't point with your mouse - draw a rectangle or a circle around what you are trying to highlight. Your mouse pointer is small and learners have trouble tracking it (I asked several and we all agree :) ). 2. Please, put the word description of the bitwise operation next to its symbol, e.g., NOT !, AND &, etc. 3. For the last, more involved example, I would follow your explanation with a simplification: First, flip all original bits, then flip only the target bit (with an OR | mask), and finally flip everything in the masked result back (with a NOT !). Only the targeted bit ends up different from all the original bit we started with. This explanation just helps learners shift their attention from the very visible 0s and 1s to the way less visible Data, flipped, Mask, OR result, and Flipped back labels on the very right, which is probably what you want them to focus on. I would also draw two red rectangles around original target bit in the starting binary value and that bit in the final result. Best of luck. I know you will do great :).
@learnlearnscratch
@learnlearnscratch Жыл бұрын
Thank you very much for the tips!!! I'll make sure I incorporate them into future videos!
@HappyLife-fz8uu
@HappyLife-fz8uu 2 жыл бұрын
Thankyou so much! Your video saved my broken brain 👍🫶🏻
@dcy9846
@dcy9846 8 ай бұрын
For clearing bits, wouldn't you be able to use an AND instruction and use a mask that has all 1's but the ones you want to clear? 1111 0101 AND 1110 1111 would result in the same thing but in less operations since the other bits would remain the same?
@lancemarchetti8673
@lancemarchetti8673 Жыл бұрын
Great Explanation. I recently wrote a .js file that carries out a Bitwise NOT on a negated string and outputs it as Base64.
@blazingfest5885
@blazingfest5885 Жыл бұрын
could you also use a bitwise AND with a flipped mask to clear a digit to 0?
@pareshkumar6268
@pareshkumar6268 2 жыл бұрын
Thank u soo much bro!! understood everything on the first go
@learnlearnscratch
@learnlearnscratch 2 жыл бұрын
Glad it was helpful!!!
@OneLordeAnimeClips
@OneLordeAnimeClips 2 жыл бұрын
The first 4 minutes of this video did a better job explaining than a 45 minute lecture (and the convoluted ass explanations in the textbook).
@aaaminahammm4365
@aaaminahammm4365 2 жыл бұрын
Finally, i learned masking thank you
@dylanngo4454
@dylanngo4454 3 жыл бұрын
Thanks, It's simple to understand
@fionaleclair-robertson8998
@fionaleclair-robertson8998 3 жыл бұрын
worth more than 400 views amazing vid
@alexreffner2982
@alexreffner2982 4 ай бұрын
Great video!
@TresorElf
@TresorElf Жыл бұрын
you are a livesaver man
@tarassavchenko2317
@tarassavchenko2317 3 жыл бұрын
thank you!really clear explanation
@abhijeetpatil5170
@abhijeetpatil5170 2 жыл бұрын
Don't know for sure but can you check indexing of bits .
@James_Hello
@James_Hello 5 ай бұрын
Wonderful ❤
@cristidragosmatei
@cristidragosmatei 2 жыл бұрын
Outstanding, thank you
@akhilk5121
@akhilk5121 5 ай бұрын
Regarding clearing a bit So given the definition of bitmask as "A value where only the bit you want to act on is set to 1 and all other bits are 0" If we want to clear a bit we need to get the NOT of the above bit mask and then the result can do an AND with original number to clear that particular bit of interest. For me the order in which he explained was confusing. Hope this help people like me
@גלבןשיטרית
@גלבןשיטרית Жыл бұрын
First of all, The subject is well explained and the use of examples was great. But, my question is, in the last part of the video, why do we need to flip twice instead of doing 1111 0101 DATA & 1110 1111 MASK ---------------- 1110 0101 RESULT
@dzbanekkulka7424
@dzbanekkulka7424 Жыл бұрын
1|0 gives 1 and we want 0
@PiyushLaad1987
@PiyushLaad1987 2 жыл бұрын
Thank you :)
@kkh0101
@kkh0101 2 жыл бұрын
clearing a digit to 0 could be done with &= ~FLAG operation.
@tinal3991
@tinal3991 2 ай бұрын
Good video indeed
@q12x
@q12x 2 жыл бұрын
Excelent explained ! Why? because you used examples !
@jemuelespiritu1641
@jemuelespiritu1641 3 жыл бұрын
thank you very much sir
@SayheeKim
@SayheeKim Жыл бұрын
why can't you just do a AND mask to clear a bit to 0? input _ _ _ _ _ B _ _ _ _ AND mask 1 1 1 1 0 1 1 1 1 ---------------------------------------------- result _ _ _ _ 0 _ _ _ _ right? (bit B is cleared to 0 and all other bits are preserved?)
@neko2000gh
@neko2000gh 2 жыл бұрын
THANKS A LOTTT
@smellysox16
@smellysox16 4 жыл бұрын
Nice
@sysy_ep
@sysy_ep Жыл бұрын
Here is a Rust example of 3:17 or 5:05 :D fn main() { let x = 0b1011; // Byte let y = 0b1000; // What bit? println!("{:b}", x & y >> y -1) }
Register Transfer Notation
9:34
Learn Learn Scratch Tutorials
Рет қаралды 7 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Bitwise Operators and WHY we use them
8:41
Alex Hyett
Рет қаралды 100 М.
Binary Shifts Tutorial
9:13
Learn Learn Scratch Tutorials
Рет қаралды 44 М.
2683. Neighboring Bitwise XOR | Bit Manipulation
7:06
Aryan Mittal
Рет қаралды 1,1 М.
Transformers (how LLMs work) explained visually | DL5
27:14
3Blue1Brown
Рет қаралды 4,6 МЛН
How do I access a single bit?
11:07
Jacob Sorber
Рет қаралды 23 М.
Bit Manipulation
34:20
Make School
Рет қаралды 61 М.
Add Two Numbers Without The "+" Sign (Bit Shifting Basics)
18:25
Back To Back SWE
Рет қаралды 126 М.
Intro to Binary and Bitwise Operators in C++
21:40
The Cherno
Рет қаралды 140 М.
Binary to decimal can’t be that hard, right?
42:26
Ben Eater
Рет қаралды 834 М.
Bitwise Operators 4: The Logical Shift Operation
13:27
Computer Science Lessons
Рет қаралды 23 М.